Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/WalletTest.php
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | public function testHistory(): void | ||||
$this->browse(function (Browser $browser) use ($pages, $wallet) { | $this->browse(function (Browser $browser) use ($pages, $wallet) { | ||||
$browser->on(new Dashboard()) | $browser->on(new Dashboard()) | ||||
->click('@links .link-wallet') | ->click('@links .link-wallet') | ||||
->on(new WalletPage()) | ->on(new WalletPage()) | ||||
->assertSeeIn('@nav #tab-history', 'History') | ->assertSeeIn('@nav #tab-history', 'History') | ||||
->with('@history-tab', function (Browser $browser) use ($pages, $wallet) { | ->with('@history-tab', function (Browser $browser) use ($pages, $wallet) { | ||||
$browser->assertElementsCount('table tbody tr', 10) | $browser->assertElementsCount('table tbody tr', 10) | ||||
->assertMissing('table td.email') | |||||
->assertSeeIn('#transactions-loader button', 'Load more'); | ->assertSeeIn('#transactions-loader button', 'Load more'); | ||||
foreach ($pages[0] as $idx => $transaction) { | foreach ($pages[0] as $idx => $transaction) { | ||||
$selector = 'table tbody tr:nth-child(' . ($idx + 1) . ')'; | $selector = 'table tbody tr:nth-child(' . ($idx + 1) . ')'; | ||||
$priceStyle = $transaction->type == Transaction::WALLET_AWARD ? 'text-success' : 'text-danger'; | $priceStyle = $transaction->type == Transaction::WALLET_AWARD ? 'text-success' : 'text-danger'; | ||||
$browser->assertSeeIn("$selector td.description", $transaction->shortDescription()) | $browser->assertSeeIn("$selector td.description", $transaction->shortDescription()) | ||||
->assertMissing("$selector td.selection button") | ->assertMissing("$selector td.selection button") | ||||
->assertVisible("$selector td.price.{$priceStyle}"); | ->assertVisible("$selector td.price.{$priceStyle}"); | ||||
Show All 31 Lines |