Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Reseller/UserFinancesTest.php
Show First 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | public function testWalletDiscount(): void | ||||
$browser->click('@body select') | $browser->click('@body select') | ||||
->click('@body select option:nth-child(2)') | ->click('@body select option:nth-child(2)') | ||||
->click('@button-action'); | ->click('@button-action'); | ||||
}) | }) | ||||
->assertToast(Toast::TYPE_SUCCESS, 'User wallet updated successfully.') | ->assertToast(Toast::TYPE_SUCCESS, 'User wallet updated successfully.') | ||||
->assertSeeIn('#discount span', '10% - Test voucher') | ->assertSeeIn('#discount span', '10% - Test voucher') | ||||
->click('@nav #tab-subscriptions') | ->click('@nav #tab-subscriptions') | ||||
->with('@user-subscriptions', function (Browser $browser) { | ->with('@user-subscriptions', function (Browser $browser) { | ||||
$browser->assertSeeIn('table tbody tr:nth-child(1) td:last-child', '3,99 CHF/month¹') | $browser->assertSeeIn('table tbody tr:nth-child(1) td:last-child', '4,50 CHF/month¹') | ||||
->assertSeeIn('table tbody tr:nth-child(2) td:last-child', '0,00 CHF/month¹') | ->assertSeeIn('table tbody tr:nth-child(2) td:last-child', '0,00 CHF/month¹') | ||||
->assertSeeIn('table tbody tr:nth-child(3) td:last-child', '4,99 CHF/month¹') | ->assertSeeIn('table tbody tr:nth-child(3) td:last-child', '4,41 CHF/month¹') | ||||
->assertSeeIn('table + .hint', '¹ applied discount: 10% - Test voucher'); | ->assertSeeIn('table + .hint', '¹ applied discount: 10% - Test voucher'); | ||||
}) | }) | ||||
// Change back to 'none' | // Change back to 'none' | ||||
->click('@nav #tab-finances') | ->click('@nav #tab-finances') | ||||
->click('@user-finances #discount button') | ->click('@user-finances #discount button') | ||||
->with(new Dialog('#discount-dialog'), function (Browser $browser) { | ->with(new Dialog('#discount-dialog'), function (Browser $browser) { | ||||
$browser->click('@body select') | $browser->click('@body select') | ||||
->click('@body select option:nth-child(1)') | ->click('@body select option:nth-child(1)') | ||||
->click('@button-action'); | ->click('@button-action'); | ||||
}) | }) | ||||
->assertToast(Toast::TYPE_SUCCESS, 'User wallet updated successfully.') | ->assertToast(Toast::TYPE_SUCCESS, 'User wallet updated successfully.') | ||||
->assertSeeIn('#discount span', 'none') | ->assertSeeIn('#discount span', 'none') | ||||
->click('@nav #tab-subscriptions') | ->click('@nav #tab-subscriptions') | ||||
->with('@user-subscriptions', function (Browser $browser) { | ->with('@user-subscriptions', function (Browser $browser) { | ||||
$browser->assertSeeIn('table tbody tr:nth-child(1) td:last-child', '4,44 CHF/month') | $browser->assertSeeIn('table tbody tr:nth-child(1) td:last-child', '5,00 CHF/month') | ||||
->assertSeeIn('table tbody tr:nth-child(2) td:last-child', '0,00 CHF/month') | ->assertSeeIn('table tbody tr:nth-child(2) td:last-child', '0,00 CHF/month') | ||||
->assertSeeIn('table tbody tr:nth-child(3) td:last-child', '5,55 CHF/month') | ->assertSeeIn('table tbody tr:nth-child(3) td:last-child', '4,90 CHF/month') | ||||
->assertMissing('table + .hint'); | ->assertMissing('table + .hint'); | ||||
}); | }); | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test awarding/penalizing a wallet | * Test awarding/penalizing a wallet | ||||
* | * | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |