fix remaining tests

pull/2825/head
Ayrat Badykov 5 years ago
parent 84c5bba391
commit 1667bdef0c
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/block_scout_web/lib/block_scout_web/templates/address_token/_tokens.html.eex
  2. 2
      apps/block_scout_web/lib/block_scout_web/templates/address_token_balance/_tokens.html.eex
  3. 2
      apps/block_scout_web/lib/block_scout_web/templates/tokens/inventory/_token.html.eex
  4. 6
      apps/block_scout_web/test/block_scout_web/controllers/address_token_controller_test.exs
  5. 31
      apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs

@ -2,7 +2,7 @@
<div class="row justify-content align-items-center">
<div class="col-md-7 d-flex flex-column mt-3 mt-md-0">
<%= link(
to: address_token_transfers_path(@conn, :index, @address.hash, @token.contract_address_hash),
to: address_token_transfers_path(@conn, :index, to_string(@address.hash), to_string(@token.contract_address_hash)),
class: "tile-title-lg",
"data-test": "token_transfers_#{@token.contract_address_hash}"
) do %>

@ -11,7 +11,7 @@
data-token-symbol="<%= token_balance.token.symbol %>"
>
<%= link(
to: token_path(@conn, :show, token_balance.token.contract_address_hash),
to: token_path(@conn, :show, to_string(token_balance.token.contract_address_hash)),
class: "dropdown-item"
) do %>
<div class="row">

@ -10,7 +10,7 @@
<span class="d-flex flex-md-row flex-column mt-3 mt-md-0">
<span class="mr-1"><%= gettext "Token ID" %>:</span>
<span class="tile-title">
<%= link(@token_transfer.token_id, to: token_instance_path(@conn, :show, @token.contract_address_hash, to_string(@token_transfer.token_id))) %>
<%= link(@token_transfer.token_id, to: token_instance_path(@conn, :show, "#{@token.contract_address_hash}", "#{@token_transfer.token_id}")) %>
</span>
</span>

@ -57,7 +57,7 @@ defmodule BlockScoutWeb.AddressTokenControllerTest do
to_address: address
)
conn = get(conn, address_token_path(conn, :index, address), type: "JSON")
conn = get(conn, address_token_path(conn, :index, to_string(address.hash)), type: "JSON")
{:ok, %{"items" => items}} =
conn.resp_body
@ -99,7 +99,7 @@ defmodule BlockScoutWeb.AddressTokenControllerTest do
%Token{name: name, type: type, inserted_at: inserted_at} = token
conn =
get(conn, address_token_path(BlockScoutWeb.Endpoint, :index, address.hash), %{
get(conn, address_token_path(BlockScoutWeb.Endpoint, :index, to_string(address.hash)), %{
"token_name" => name,
"token_type" => type,
"token_inserted_at" => inserted_at,
@ -131,7 +131,7 @@ defmodule BlockScoutWeb.AddressTokenControllerTest do
insert(:token_transfer, token_contract_address: token.contract_address, from_address: address)
end)
conn = get(conn, address_token_path(BlockScoutWeb.Endpoint, :index, address.hash), type: "JSON")
conn = get(conn, address_token_path(BlockScoutWeb.Endpoint, :index, to_string(address.hash)), type: "JSON")
{:ok, %{"next_page_path" => next_page_path}} =
conn.resp_body

@ -336,37 +336,6 @@ defmodule BlockScoutWeb.ViewingAddressesTest do
|> refute_has(AddressPage.token_transfer(transaction, taft, count: 1))
end
test "transactions with multiple token transfers shows only the first one by default", %{
addresses: addresses,
block: block,
session: session
} do
lincoln = addresses.lincoln
taft = addresses.taft
contract_address = insert(:contract_address)
insert(:token, contract_address: contract_address)
transaction =
:transaction
|> insert(from_address: lincoln, to_address: contract_address)
|> with_block(block)
insert_list(
3,
:token_transfer,
from_address: lincoln,
to_address: taft,
transaction: transaction,
token_contract_address: contract_address
)
session
|> AddressPage.visit_page(lincoln)
|> assert_has(AddressPage.token_transfers(transaction, count: 1))
end
test "transaction with multiple token transfers shows all transfers if expanded", %{
addresses: addresses,
block: block,

Loading…
Cancel
Save