Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Reseller/WalletTest.php
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | public function testDashboard(): void | ||||
Wallet::where('user_id', $reseller->id)->update(['balance' => 125]); | Wallet::where('user_id', $reseller->id)->update(['balance' => 125]); | ||||
// Positive balance | // Positive balance | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit(new Home()) | $browser->visit(new Home()) | ||||
->submitLogon('reseller@' . \config('app.domain'), \App\Utils::generatePassphrase(), true) | ->submitLogon('reseller@' . \config('app.domain'), \App\Utils::generatePassphrase(), true) | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->assertSeeIn('@links .link-wallet .name', 'Wallet') | ->assertSeeIn('@links .link-wallet .name', 'Wallet') | ||||
->assertSeeIn('@links .link-wallet .badge-success', '1,25 CHF'); | ->assertSeeIn('@links .link-wallet .badge.bg-success', '1,25 CHF'); | ||||
}); | }); | ||||
Wallet::where('user_id', $reseller->id)->update(['balance' => -1234]); | Wallet::where('user_id', $reseller->id)->update(['balance' => -1234]); | ||||
// Negative balance | // Negative balance | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit(new Dashboard()) | $browser->visit(new Dashboard()) | ||||
->assertSeeIn('@links .link-wallet .name', 'Wallet') | ->assertSeeIn('@links .link-wallet .name', 'Wallet') | ||||
->assertSeeIn('@links .link-wallet .badge-danger', '-12,34 CHF'); | ->assertSeeIn('@links .link-wallet .badge.bg-danger', '-12,34 CHF'); | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test wallet page | * Test wallet page | ||||
* | * | ||||
* @depends testDashboard | * @depends testDashboard | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |