Clean up testing page object

pull/395/head
jimmay5469 6 years ago
parent 9f4fd398c2
commit 6c74f9f960
  1. 6
      apps/explorer_web/test/explorer_web/features/pages/transaction_list_page.ex
  2. 4
      apps/explorer_web/test/explorer_web/features/viewing_transactions_test.exs

@ -5,7 +5,7 @@ defmodule ExplorerWeb.TransactionListPage do
import Wallaby.Query, only: [css: 1, css: 2]
alias Explorer.Chain.{InternalTransaction, Transaction}
alias Explorer.Chain.{Transaction, Transaction}
def click_transaction(session, %Transaction{hash: transaction_hash}) do
click(session, css("[data-transaction-hash='#{transaction_hash}'] [data-test='transaction_hash_link']"))
@ -15,8 +15,8 @@ defmodule ExplorerWeb.TransactionListPage do
click(session, css("[data-test='pending_transactions_link']"))
end
def contract_creation(%InternalTransaction{created_contract_address_hash: hash}) do
css("[data-address-hash='#{hash}']", text: "Contract Creation")
def contract_creation(%Transaction{hash: hash}) do
css("[data-transaction-hash='#{hash}']", text: "Contract Creation")
end
def transaction(%Transaction{hash: transaction_hash}) do

@ -111,11 +111,11 @@ defmodule ExplorerWeb.ViewingTransactionsTest do
|> insert(to_address: nil)
|> with_block()
internal_transaction = insert(:internal_transaction_create, transaction: transaction, index: 0)
insert(:internal_transaction_create, transaction: transaction, index: 0)
session
|> TransactionListPage.visit_page()
|> assert_has(TransactionListPage.contract_creation(internal_transaction))
|> assert_has(TransactionListPage.contract_creation(transaction))
end
end

Loading…
Cancel
Save