Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/WalletTest.php
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | class WalletTest extends TestCaseDusk | ||||
* | * | ||||
* @depends testDashboard | * @depends testDashboard | ||||
*/ | */ | ||||
public function testWallet(): void | public function testWallet(): void | ||||
{ | { | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->click('@links .link-wallet') | $browser->click('@links .link-wallet') | ||||
->on(new WalletPage()) | ->on(new WalletPage()) | ||||
->assertSeeIn('#wallet .card-title', 'Account balance') | ->assertSeeIn('#wallet .card-title', 'Account balance -12,34 CHF') | ||||
->assertSeeIn('#wallet .card-text', 'Current account balance is -12,34 CHF'); | ->assertSeeIn('#wallet .card-title .text-danger', '-12,34 CHF') | ||||
->assertSeeIn('#wallet .card-text', 'You are out of credit'); | |||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test Receipts tab | * Test Receipts tab | ||||
*/ | */ | ||||
public function testReceipts(): void | public function testReceipts(): void | ||||
{ | { | ||||
Show All 9 Lines | public function testReceipts(): void | ||||
->submitLogon('wallets-controller@kolabnow.com', 'simple123', true); | ->submitLogon('wallets-controller@kolabnow.com', 'simple123', true); | ||||
}); | }); | ||||
// Assert Receipts tab content when there's no receipts available | // Assert Receipts tab content when there's no receipts available | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->on(new Dashboard()) | $browser->on(new Dashboard()) | ||||
->click('@links .link-wallet') | ->click('@links .link-wallet') | ||||
->on(new WalletPage()) | ->on(new WalletPage()) | ||||
->assertSeeIn('#wallet .card-title', 'Account balance 0,00 CHF') | |||||
->assertSeeIn('#wallet .card-title .text-success', '0,00 CHF') | |||||
->assertSeeIn('#wallet .card-text', 'You are in your free trial period.') | |||||
->assertSeeIn('@nav #tab-receipts', 'Receipts') | ->assertSeeIn('@nav #tab-receipts', 'Receipts') | ||||
->with('@receipts-tab', function (Browser $browser) { | ->with('@receipts-tab', function (Browser $browser) { | ||||
$browser->waitUntilMissing('.app-loader') | $browser->waitUntilMissing('.app-loader') | ||||
->assertSeeIn('p', 'There are no receipts for payments') | ->assertSeeIn('p', 'There are no receipts for payments') | ||||
->assertDontSeeIn('p', 'Here you can download') | ->assertDontSeeIn('p', 'Here you can download') | ||||
->assertMissing('select') | ->assertMissing('select') | ||||
->assertMissing('button'); | ->assertMissing('button'); | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |