Merge pull request #946 from poanetwork/txn-dropdown-menu

Add transaction dropdown menu to navbar
pull/955/head
Andrew Cravenho 6 years ago committed by GitHub
commit e4e79adea1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex
  2. 55
      apps/block_scout_web/lib/block_scout_web/templates/pending_transaction/index.html.eex
  3. 55
      apps/block_scout_web/lib/block_scout_web/templates/transaction/index.html.eex
  4. 50
      apps/block_scout_web/priv/gettext/default.pot
  5. 50
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  6. 8
      apps/block_scout_web/test/block_scout_web/features/pages/transaction_list_page.ex
  7. 9
      apps/block_scout_web/test/block_scout_web/features/viewing_transactions_test.exs

@ -15,7 +15,7 @@
</span> </span>
<%= gettext("Blocks") %> <%= gettext("Blocks") %>
</a> </a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> <div class="dropdown-menu" aria-labelledby="navbarBlocksDropdown">
<%= link to: block_path(@conn, :index), class: "dropdown-item" do %> <%= link to: block_path(@conn, :index), class: "dropdown-item" do %>
<%= gettext("Blocks") %> <%= gettext("Blocks") %>
<% end %> <% end %>
@ -27,13 +27,26 @@
<% end %> <% end %>
</div> </div>
</li> </li>
<li class="nav-item"> <li class="nav-item dropdown">
<%= link to: transaction_path(@conn, :index), class: "nav-link topnav-nav-link" do %> <a href="#" role="button" id="navbarTransactionsDropdown" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="nav-link-icon"> <span class="nav-link-icon">
<%= render BlockScoutWeb.IconsView, "_transaction_icon.html" %> <%= render BlockScoutWeb.IconsView, "_transaction_icon.html" %>
</span> </span>
<%= gettext("Transactions") %> <%= gettext("Transactions") %>
<% end %> </a>
<div class="dropdown-menu" aria-labeledby="navbarTransactionsDropdown">
<%= link(
gettext("Validated"),
class: "dropdown-item",
to: transaction_path(@conn, :index)
) %>
<%= link(
gettext("Pending"),
class: "dropdown-item",
"data-test": "pending_transactions_link",
to: pending_transaction_path(@conn, :index)
) %>
</div>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<%= link to: address_path(@conn, :index), class: "nav-link topnav-nav-link" do %> <%= link to: address_path(@conn, :index), class: "nav-link topnav-nav-link" do %>

@ -1,48 +1,14 @@
<section class="container" data-page="transaction-pending-list"> <section class="container" data-page="transaction-pending-list">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-body">
<!-- DESKTOP TAB NAV -->
<ul class="nav nav-tabs card-header-tabs d-none d-md-inline-flex">
<li class="nav-item">
<%= link(
gettext("Validated"),
class: "nav-link",
to: transaction_path(@conn, :index)
) %>
</li>
<li class="nav-item">
<%= link(
gettext("Pending"),
class: "nav-link active",
"data-test": "pending_transactions_link",
to: pending_transaction_path(@conn, :index)
) %>
</li>
</ul>
<!-- MOBILE DROPDOWN NAV --> <h1><%= gettext "Pending Transactions" %></h1>
<ul class="nav nav-tabs card-header-tabs d-lg-none"> <p>
<li class="nav-item dropdown flex-fill text-center"> <%= gettext("Showing") %>
<a class="nav-link active dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"><%= gettext("Pending") %></a> <span data-selector="transaction-pending-count"><%= Cldr.Number.to_string!(@pending_transaction_count, format: "#,###") %></span>
<div class="dropdown-menu"> <%= gettext("Pending Transactions") %>
<%= link( </p>
gettext("Validated"),
class: "dropdown-item",
to: transaction_path(@conn, :index)
) %>
<%= link(
gettext("Pending"),
class: "dropdown-item active",
"data-test": "pending_transactions_link",
to: pending_transaction_path(@conn, :index)
) %>
</div>
</li>
</ul>
</div>
<div class="card-body">
<div data-selector="channel-batching-message" style="display:none;"> <div data-selector="channel-batching-message" style="display:none;">
<div data-selector="reload-button" class="alert alert-info"> <div data-selector="reload-button" class="alert alert-info">
<a href="#" class="alert-link"><span data-selector="channel-batching-count"></span> <%= gettext "More transactions have come in" %></a> <a href="#" class="alert-link"><span data-selector="channel-batching-count"></span> <%= gettext "More transactions have come in" %></a>
@ -53,12 +19,7 @@
<a href="#" class="alert-link"><%= gettext "Connection Lost, click to load newer transactions" %></a> <a href="#" class="alert-link"><%= gettext "Connection Lost, click to load newer transactions" %></a>
</div> </div>
</div> </div>
<h2 class="card-title mb-0"><%= gettext "Transactions" %></h2>
<p>
<%= gettext("Showing") %>
<span data-selector="transaction-pending-count"><%= Cldr.Number.to_string!(@pending_transaction_count, format: "#,###") %></span>
<%= gettext("Pending Transactions") %>
</p>
<span data-selector="transactions-pending-list"> <span data-selector="transactions-pending-list">
<%= for transaction <- @transactions do %> <%= for transaction <- @transactions do %>
<%= render BlockScoutWeb.TransactionView, "_tile.html", transaction: transaction %> <%= render BlockScoutWeb.TransactionView, "_tile.html", transaction: transaction %>

@ -1,48 +1,14 @@
<section class="container" data-page="transaction-list"> <section class="container" data-page="transaction-list">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-body">
<!-- DESKTOP TAB NAV -->
<ul class="nav nav-tabs card-header-tabs d-none d-lg-inline-flex">
<li class="nav-item">
<%= link(
gettext("Validated"),
class: "nav-link active",
to: transaction_path(@conn, :index)
) %>
</li>
<li class="nav-item">
<%= link(
gettext("Pending"),
class: "nav-link",
"data-test": "pending_transactions_link",
to: pending_transaction_path(@conn, :index)
) %>
</li>
</ul>
<!-- MOBILE DROPDOWN NAV --> <h1><%= gettext "Validated Transactions" %></h1>
<ul class="nav nav-tabs card-header-tabs d-lg-none"> <p>
<li class="nav-item dropdown flex-fill text-center"> <%= gettext("Showing") %>
<a class="nav-link active dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"><%= gettext("Validated") %></a> <span data-selector="transaction-count"><%= Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###") %></span>
<div class="dropdown-menu"> <%= gettext("Validated Transactions") %>
<%= link( </p>
gettext("Validated"),
class: "dropdown-item active",
to: transaction_path(@conn, :index)
) %>
<%= link(
gettext("Pending"),
class: "dropdown-item",
"data-test": "pending_transactions_link",
to: pending_transaction_path(@conn, :index)
) %>
</div>
</li>
</ul>
</div>
<div class="card-body">
<div data-selector="channel-batching-message" class="d-none"> <div data-selector="channel-batching-message" class="d-none">
<div data-selector="reload-button" class="alert alert-info"> <div data-selector="reload-button" class="alert alert-info">
<a href="#" class="alert-link"><span data-selector="channel-batching-count"></span> <%= gettext "More transactions have come in" %></a> <a href="#" class="alert-link"><span data-selector="channel-batching-count"></span> <%= gettext "More transactions have come in" %></a>
@ -53,12 +19,7 @@
<a href="#" class="alert-link"><%= gettext "Connection Lost, click to load newer transactions" %></a> <a href="#" class="alert-link"><%= gettext "Connection Lost, click to load newer transactions" %></a>
</div> </div>
</div> </div>
<h1><%= gettext "Transactions" %></h1>
<p>
<%= gettext("Showing") %>
<span data-selector="transaction-count"><%= Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###") %></span>
<%= gettext("Validated Transactions") %>
</p>
<span data-selector="transactions-list"> <span data-selector="transactions-list">
<%= for transaction <- @transactions do %> <%= for transaction <- @transactions do %>
<%= render BlockScoutWeb.TransactionView, "_tile.html", transaction: transaction %> <%= render BlockScoutWeb.TransactionView, "_tile.html", transaction: transaction %>

@ -84,7 +84,7 @@ msgid "A string with the name of the module to be invoked."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:51 #: lib/block_scout_web/templates/layout/_topnav.html.eex:64
msgid "API" msgid "API"
msgstr "" msgstr ""
@ -99,7 +99,7 @@ msgid "API for the %{subnetwork} - BlockScout"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:43 #: lib/block_scout_web/templates/layout/_topnav.html.eex:56
msgid "Accounts" msgid "Accounts"
msgstr "" msgstr ""
@ -258,8 +258,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_transaction/index.html.eex:14 #: lib/block_scout_web/templates/address_transaction/index.html.eex:14
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:53 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:19
#: lib/block_scout_web/templates/transaction/index.html.eex:53 #: lib/block_scout_web/templates/transaction/index.html.eex:19
msgid "Connection Lost, click to load newer transactions" msgid "Connection Lost, click to load newer transactions"
msgstr "" msgstr ""
@ -579,8 +579,8 @@ msgid "More internal transactions have come in"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:48 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:14
#: lib/block_scout_web/templates/transaction/index.html.eex:48 #: lib/block_scout_web/templates/transaction/index.html.eex:14
msgid "More transactions have come in" msgid "More transactions have come in"
msgstr "" msgstr ""
@ -642,9 +642,9 @@ msgstr ""
#: lib/block_scout_web/templates/address_validation/index.html.eex:117 #: lib/block_scout_web/templates/address_validation/index.html.eex:117
#: lib/block_scout_web/templates/block/index.html.eex:20 #: lib/block_scout_web/templates/block/index.html.eex:20
#: lib/block_scout_web/templates/block_transaction/index.html.eex:50 #: lib/block_scout_web/templates/block_transaction/index.html.eex:50
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:70 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:31
#: lib/block_scout_web/templates/tokens/transfer/index.html.eex:34 #: lib/block_scout_web/templates/tokens/transfer/index.html.eex:34
#: lib/block_scout_web/templates/transaction/index.html.eex:70 #: lib/block_scout_web/templates/transaction/index.html.eex:31
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:24 #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:24
msgid "Older" msgid "Older"
msgstr "" msgstr ""
@ -660,12 +660,12 @@ msgid "Owner Address"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:82 #: lib/block_scout_web/templates/layout/_topnav.html.eex:95
msgid "POA Core" msgid "POA Core"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:81 #: lib/block_scout_web/templates/layout/_topnav.html.eex:94
msgid "POA Sokol" msgid "POA Sokol"
msgstr "" msgstr ""
@ -685,11 +685,7 @@ msgid "Parent Hash"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:16 #: lib/block_scout_web/templates/layout/_topnav.html.eex:44
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:27
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:35
#: lib/block_scout_web/templates/transaction/index.html.eex:16
#: lib/block_scout_web/templates/transaction/index.html.eex:35
#: lib/block_scout_web/templates/transaction/overview.html.eex:54 #: lib/block_scout_web/templates/transaction/overview.html.eex:54
#: lib/block_scout_web/views/transaction_view.ex:57 #: lib/block_scout_web/views/transaction_view.ex:57
#: lib/block_scout_web/views/transaction_view.ex:83 #: lib/block_scout_web/views/transaction_view.ex:83
@ -698,7 +694,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_transaction/index.html.eex:60 #: lib/block_scout_web/templates/address_transaction/index.html.eex:60
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:60 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:5
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:9
msgid "Pending Transactions" msgid "Pending Transactions"
msgstr "" msgstr ""
@ -760,13 +757,13 @@ msgid "Responses"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:58 #: lib/block_scout_web/templates/layout/_topnav.html.eex:71
#: lib/block_scout_web/templates/layout/_topnav.html.eex:65 #: lib/block_scout_web/templates/layout/_topnav.html.eex:78
msgid "Search" msgid "Search"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:58 #: lib/block_scout_web/templates/layout/_topnav.html.eex:71
msgid "Search by address, transaction hash, or block number" msgid "Search by address, transaction hash, or block number"
msgstr "" msgstr ""
@ -792,8 +789,8 @@ msgid "Show QR Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:58 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:7
#: lib/block_scout_web/templates/transaction/index.html.eex:58 #: lib/block_scout_web/templates/transaction/index.html.eex:7
msgid "Showing" msgid "Showing"
msgstr "" msgstr ""
@ -1004,8 +1001,6 @@ msgstr ""
#: lib/block_scout_web/templates/block_transaction/index.html.eex:35 #: lib/block_scout_web/templates/block_transaction/index.html.eex:35
#: lib/block_scout_web/templates/chain/show.html.eex:71 #: lib/block_scout_web/templates/chain/show.html.eex:71
#: lib/block_scout_web/templates/layout/_topnav.html.eex:35 #: lib/block_scout_web/templates/layout/_topnav.html.eex:35
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:56
#: lib/block_scout_web/templates/transaction/index.html.eex:56
#: lib/block_scout_web/views/address_view.ex:208 #: lib/block_scout_web/views/address_view.ex:208
msgid "Transactions" msgid "Transactions"
msgstr "" msgstr ""
@ -1048,16 +1043,13 @@ msgid "Used"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:9 #: lib/block_scout_web/templates/layout/_topnav.html.eex:39
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:30
#: lib/block_scout_web/templates/transaction/index.html.eex:9
#: lib/block_scout_web/templates/transaction/index.html.eex:27
#: lib/block_scout_web/templates/transaction/index.html.eex:30
msgid "Validated" msgid "Validated"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/index.html.eex:60 #: lib/block_scout_web/templates/transaction/index.html.eex:5
#: lib/block_scout_web/templates/transaction/index.html.eex:9
msgid "Validated Transactions" msgid "Validated Transactions"
msgstr "" msgstr ""

@ -84,7 +84,7 @@ msgid "A string with the name of the module to be invoked."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:51 #: lib/block_scout_web/templates/layout/_topnav.html.eex:64
msgid "API" msgid "API"
msgstr "" msgstr ""
@ -99,7 +99,7 @@ msgid "API for the %{subnetwork} - BlockScout"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:43 #: lib/block_scout_web/templates/layout/_topnav.html.eex:56
msgid "Accounts" msgid "Accounts"
msgstr "" msgstr ""
@ -258,8 +258,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_transaction/index.html.eex:14 #: lib/block_scout_web/templates/address_transaction/index.html.eex:14
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:53 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:19
#: lib/block_scout_web/templates/transaction/index.html.eex:53 #: lib/block_scout_web/templates/transaction/index.html.eex:19
msgid "Connection Lost, click to load newer transactions" msgid "Connection Lost, click to load newer transactions"
msgstr "" msgstr ""
@ -579,8 +579,8 @@ msgid "More internal transactions have come in"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:48 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:14
#: lib/block_scout_web/templates/transaction/index.html.eex:48 #: lib/block_scout_web/templates/transaction/index.html.eex:14
msgid "More transactions have come in" msgid "More transactions have come in"
msgstr "" msgstr ""
@ -642,9 +642,9 @@ msgstr ""
#: lib/block_scout_web/templates/address_validation/index.html.eex:117 #: lib/block_scout_web/templates/address_validation/index.html.eex:117
#: lib/block_scout_web/templates/block/index.html.eex:20 #: lib/block_scout_web/templates/block/index.html.eex:20
#: lib/block_scout_web/templates/block_transaction/index.html.eex:50 #: lib/block_scout_web/templates/block_transaction/index.html.eex:50
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:70 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:31
#: lib/block_scout_web/templates/tokens/transfer/index.html.eex:34 #: lib/block_scout_web/templates/tokens/transfer/index.html.eex:34
#: lib/block_scout_web/templates/transaction/index.html.eex:70 #: lib/block_scout_web/templates/transaction/index.html.eex:31
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:24 #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:24
msgid "Older" msgid "Older"
msgstr "" msgstr ""
@ -660,12 +660,12 @@ msgid "Owner Address"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:82 #: lib/block_scout_web/templates/layout/_topnav.html.eex:95
msgid "POA Core" msgid "POA Core"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:81 #: lib/block_scout_web/templates/layout/_topnav.html.eex:94
msgid "POA Sokol" msgid "POA Sokol"
msgstr "" msgstr ""
@ -685,11 +685,7 @@ msgid "Parent Hash"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:16 #: lib/block_scout_web/templates/layout/_topnav.html.eex:44
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:27
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:35
#: lib/block_scout_web/templates/transaction/index.html.eex:16
#: lib/block_scout_web/templates/transaction/index.html.eex:35
#: lib/block_scout_web/templates/transaction/overview.html.eex:54 #: lib/block_scout_web/templates/transaction/overview.html.eex:54
#: lib/block_scout_web/views/transaction_view.ex:57 #: lib/block_scout_web/views/transaction_view.ex:57
#: lib/block_scout_web/views/transaction_view.ex:83 #: lib/block_scout_web/views/transaction_view.ex:83
@ -698,7 +694,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_transaction/index.html.eex:60 #: lib/block_scout_web/templates/address_transaction/index.html.eex:60
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:60 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:5
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:9
msgid "Pending Transactions" msgid "Pending Transactions"
msgstr "" msgstr ""
@ -760,13 +757,13 @@ msgid "Responses"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:58 #: lib/block_scout_web/templates/layout/_topnav.html.eex:71
#: lib/block_scout_web/templates/layout/_topnav.html.eex:65 #: lib/block_scout_web/templates/layout/_topnav.html.eex:78
msgid "Search" msgid "Search"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:58 #: lib/block_scout_web/templates/layout/_topnav.html.eex:71
msgid "Search by address, transaction hash, or block number" msgid "Search by address, transaction hash, or block number"
msgstr "" msgstr ""
@ -792,8 +789,8 @@ msgid "Show QR Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:58 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:7
#: lib/block_scout_web/templates/transaction/index.html.eex:58 #: lib/block_scout_web/templates/transaction/index.html.eex:7
msgid "Showing" msgid "Showing"
msgstr "" msgstr ""
@ -1004,8 +1001,6 @@ msgstr ""
#: lib/block_scout_web/templates/block_transaction/index.html.eex:35 #: lib/block_scout_web/templates/block_transaction/index.html.eex:35
#: lib/block_scout_web/templates/chain/show.html.eex:71 #: lib/block_scout_web/templates/chain/show.html.eex:71
#: lib/block_scout_web/templates/layout/_topnav.html.eex:35 #: lib/block_scout_web/templates/layout/_topnav.html.eex:35
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:56
#: lib/block_scout_web/templates/transaction/index.html.eex:56
#: lib/block_scout_web/views/address_view.ex:208 #: lib/block_scout_web/views/address_view.ex:208
msgid "Transactions" msgid "Transactions"
msgstr "" msgstr ""
@ -1048,16 +1043,13 @@ msgid "Used"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:9 #: lib/block_scout_web/templates/layout/_topnav.html.eex:39
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:30
#: lib/block_scout_web/templates/transaction/index.html.eex:9
#: lib/block_scout_web/templates/transaction/index.html.eex:27
#: lib/block_scout_web/templates/transaction/index.html.eex:30
msgid "Validated" msgid "Validated"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/index.html.eex:60 #: lib/block_scout_web/templates/transaction/index.html.eex:5
#: lib/block_scout_web/templates/transaction/index.html.eex:9
msgid "Validated Transactions" msgid "Validated Transactions"
msgstr "" msgstr ""

@ -11,10 +11,6 @@ defmodule BlockScoutWeb.TransactionListPage do
click(session, css("[data-transaction-hash='#{transaction_hash}'] [data-test='transaction_hash_link']")) click(session, css("[data-transaction-hash='#{transaction_hash}'] [data-test='transaction_hash_link']"))
end end
def click_pending(session) do
click(session, css("[data-test='pending_transactions_link']"))
end
def contract_creation(%Transaction{hash: hash}) do def contract_creation(%Transaction{hash: hash}) do
css("[data-transaction-hash='#{hash}'] [data-test='transaction_type']", text: "Contract Creation") css("[data-transaction-hash='#{hash}'] [data-test='transaction_type']", text: "Contract Creation")
end end
@ -30,4 +26,8 @@ defmodule BlockScoutWeb.TransactionListPage do
def visit_page(session) do def visit_page(session) do
visit(session, "/txs") visit(session, "/txs")
end end
def visit_pending_transactions_page(session) do
visit(session, "/pending_transactions")
end
end end

@ -74,10 +74,13 @@ defmodule BlockScoutWeb.ViewingTransactionsTest do
|> refute_has(TransactionListPage.transaction(pending)) |> refute_has(TransactionListPage.transaction(pending))
end end
test "viewing the pending tab", %{pending: pending, pending_contract: pending_contract, session: session} do test "viewing the pending tranasctions list", %{
pending: pending,
pending_contract: pending_contract,
session: session
} do
session session
|> TransactionListPage.visit_page() |> TransactionListPage.visit_pending_transactions_page()
|> TransactionListPage.click_pending()
|> assert_has(TransactionListPage.transaction(pending)) |> assert_has(TransactionListPage.transaction(pending))
|> assert_has(TransactionListPage.transaction(pending_contract)) |> assert_has(TransactionListPage.transaction(pending_contract))
|> assert_has(TransactionListPage.transaction_status(pending_contract)) |> assert_has(TransactionListPage.transaction_status(pending_contract))

Loading…
Cancel
Save