Scope transaction css selector

pull/376/head
Stamates 6 years ago
parent 8426f64a92
commit 372721b5c7
  1. 2
      apps/explorer_web/lib/explorer_web/templates/address_internal_transaction/_internal_transaction.html.eex
  2. 2
      apps/explorer_web/lib/explorer_web/templates/address_transaction/_transaction.html.eex
  3. 2
      apps/explorer_web/lib/explorer_web/templates/block_transaction/index.html.eex
  4. 2
      apps/explorer_web/lib/explorer_web/templates/chain/_transactions.html.eex
  5. 2
      apps/explorer_web/lib/explorer_web/templates/pending_transaction/index.html.eex
  6. 5
      apps/explorer_web/lib/explorer_web/templates/transaction/_link.html.eex
  7. 2
      apps/explorer_web/lib/explorer_web/templates/transaction/index.html.eex
  8. 2
      apps/explorer_web/test/explorer_web/features/pages/address_page.ex
  9. 4
      apps/explorer_web/test/explorer_web/features/pages/transaction_list_page.ex

@ -1,5 +1,5 @@
<div class="tile tile-type-internal-transaction fade-in" data-test="internal_transaction"> <div class="tile tile-type-internal-transaction fade-in" data-test="internal_transaction">
<div class="row"> <div class="row" data-test="transaction_hash" data-transaction-hash="<%= @internal_transaction.transaction_hash %>">
<div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label"> <div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label">
<%= gettext("Internal Transaction") %> <%= gettext("Internal Transaction") %>
</div> </div>

@ -1,4 +1,4 @@
<div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(@transaction) %> fade-in"> <div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(@transaction) %> fade-in" data-transaction-hash="<%= @transaction.hash %>">
<div class="row"> <div class="row">
<div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label"> <div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label">
<%= ExplorerWeb.TransactionView.transaction_display_type(@transaction) %> <%= ExplorerWeb.TransactionView.transaction_display_type(@transaction) %>

@ -147,7 +147,7 @@
</thead> </thead>
<tbody> <tbody>
<%= for transaction <- @transactions do %> <%= for transaction <- @transactions do %>
<tr> <tr data-transaction-hash="<%= transaction.hash %>">
<td> <td>
<div class="transaction__dot transaction__dot--<%= status(transaction) %>"></div> <div class="transaction__dot transaction__dot--<%= status(transaction) %>"></div>
</td> </td>

@ -3,7 +3,7 @@
<%= link(gettext("View All Transactions →"), to: transaction_path(@conn, :index, Gettext.get_locale), class: "button button--secondary button--xsmall float-right") %> <%= link(gettext("View All Transactions →"), to: transaction_path(@conn, :index, Gettext.get_locale), class: "button button--secondary button--xsmall float-right") %>
<h2 class="card-title"><%= gettext "Transactions" %></h2> <h2 class="card-title"><%= gettext "Transactions" %></h2>
<%= for transaction <- @chain.transactions do %> <%= for transaction <- @chain.transactions do %>
<div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-test="<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>"> <div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-test="<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-transaction-hash="<%= transaction.hash %>">
<div class="row" data-test="chain_transaction"> <div class="row" data-test="chain_transaction">
<div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label"> <div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label">
<%= ExplorerWeb.TransactionView.transaction_display_type(transaction) %> <%= ExplorerWeb.TransactionView.transaction_display_type(transaction) %>

@ -41,7 +41,7 @@
</thead> </thead>
<tbody> <tbody>
<%= for transaction <- @transactions do %> <%= for transaction <- @transactions do %>
<tr> <tr data-transaction-hash="<%= transaction.hash %>">
<td> <td>
<div class="transaction__dot transaction__dot--pending"></div> <div class="transaction__dot transaction__dot--pending"></div>
</td> </td>

@ -1,5 +1,4 @@
<%= link(@transaction_hash , <%= link(@transaction_hash,
to: transaction_path(ExplorerWeb.Endpoint, :show, @locale, @transaction_hash), to: transaction_path(ExplorerWeb.Endpoint, :show, @locale, @transaction_hash),
"data-test": "transaction_hash", "data-test": "transaction_hash_link",
"data-transaction-hash": @transaction_hash,
"class": "tile-title text-truncate") %> "class": "tile-title text-truncate") %>

@ -42,7 +42,7 @@
</thead> </thead>
<tbody> <tbody>
<%= for transaction <- @transactions do %> <%= for transaction <- @transactions do %>
<tr> <tr data-transaction-hash="<%= transaction.hash %>">
<td> <td>
<div class="transaction__dot transaction__dot--<%= status(transaction) %>"></div> <div class="transaction__dot transaction__dot--<%= status(transaction) %>"></div>
</td> </td>

@ -40,7 +40,7 @@ defmodule ExplorerWeb.AddressPage do
end end
def transaction(transaction_hash) do def transaction(transaction_hash) do
css("[data-test='transaction_hash'][data-transaction-hash='#{transaction_hash}']") css("[data-transaction-hash='#{transaction_hash}']")
end end
def transaction_count do def transaction_count do

@ -8,7 +8,7 @@ defmodule ExplorerWeb.TransactionListPage do
alias Explorer.Chain.{InternalTransaction, Transaction} alias Explorer.Chain.{InternalTransaction, Transaction}
def click_transaction(session, %Transaction{hash: transaction_hash}) do def click_transaction(session, %Transaction{hash: transaction_hash}) do
click(session, css("[data-test='transaction_hash'][data-transaction-hash='#{transaction_hash}']")) click(session, css("[data-transaction-hash='#{transaction_hash}'] [data-test='transaction_hash_link']"))
end end
def click_pending(session) do def click_pending(session) do
@ -20,7 +20,7 @@ defmodule ExplorerWeb.TransactionListPage do
end end
def transaction(%Transaction{hash: transaction_hash}) do def transaction(%Transaction{hash: transaction_hash}) do
css("[data-test='transaction_hash'][data-transaction-hash='#{transaction_hash}']") css("[data-transaction-hash='#{transaction_hash}']")
end end
def visit_page(session) do def visit_page(session) do

Loading…
Cancel
Save