Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/UsersTest.php
Show First 20 Lines • Show All 705 Lines • ▼ Show 20 Lines | public function testBetaEntitlements(): void | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$john = User::where('email', 'john@kolab.org')->first(); | $john = User::where('email', 'john@kolab.org')->first(); | ||||
$sku = Sku::withEnvTenantContext()->where('title', 'beta')->first(); | $sku = Sku::withEnvTenantContext()->where('title', 'beta')->first(); | ||||
$john->assignSku($sku); | $john->assignSku($sku); | ||||
$browser->visit('/user/' . $john->id) | $browser->visit('/user/' . $john->id) | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->with('@skus', function ($browser) { | ->with('@skus', function ($browser) { | ||||
$browser->assertElementsCount('tbody tr', 9) | $browser->assertElementsCount('tbody tr', 10) | ||||
// Meet SKU | // Meet SKU | ||||
->assertSeeIn('tbody tr:nth-child(6) td.name', 'Voice & Video Conferencing (public beta)') | ->assertSeeIn('tbody tr:nth-child(6) td.name', 'Voice & Video Conferencing (public beta)') | ||||
->assertSeeIn('tr:nth-child(6) td.price', '0,00 CHF/month') | ->assertSeeIn('tr:nth-child(6) td.price', '0,00 CHF/month') | ||||
->assertNotChecked('tbody tr:nth-child(6) td.selection input') | ->assertNotChecked('tbody tr:nth-child(6) td.selection input') | ||||
->assertEnabled('tbody tr:nth-child(6) td.selection input') | ->assertEnabled('tbody tr:nth-child(6) td.selection input') | ||||
->assertTip( | ->assertTip( | ||||
'tbody tr:nth-child(6) td.buttons button', | 'tbody tr:nth-child(6) td.buttons button', | ||||
'Video conferencing tool' | 'Video conferencing tool' | ||||
Show All 11 Lines | public function testBetaEntitlements(): void | ||||
->assertSeeIn('tbody tr:nth-child(8) td.name', 'Calendaring resources') | ->assertSeeIn('tbody tr:nth-child(8) td.name', 'Calendaring resources') | ||||
->assertSeeIn('tr:nth-child(8) td.price', '0,00 CHF/month') | ->assertSeeIn('tr:nth-child(8) td.price', '0,00 CHF/month') | ||||
->assertNotChecked('tbody tr:nth-child(8) td.selection input') | ->assertNotChecked('tbody tr:nth-child(8) td.selection input') | ||||
->assertEnabled('tbody tr:nth-child(8) td.selection input') | ->assertEnabled('tbody tr:nth-child(8) td.selection input') | ||||
->assertTip( | ->assertTip( | ||||
'tbody tr:nth-child(8) td.buttons button', | 'tbody tr:nth-child(8) td.buttons button', | ||||
'Access to calendaring resources' | 'Access to calendaring resources' | ||||
) | ) | ||||
// Distlist SKU | // Shared folders SKU | ||||
->assertSeeIn('tbody tr:nth-child(9) td.name', 'Distribution lists') | ->assertSeeIn('tbody tr:nth-child(9) td.name', 'Shared folders') | ||||
->assertSeeIn('tr:nth-child(9) td.price', '0,00 CHF/month') | ->assertSeeIn('tr:nth-child(9) td.price', '0,00 CHF/month') | ||||
->assertNotChecked('tbody tr:nth-child(9) td.selection input') | ->assertNotChecked('tbody tr:nth-child(9) td.selection input') | ||||
->assertEnabled('tbody tr:nth-child(9) td.selection input') | ->assertEnabled('tbody tr:nth-child(9) td.selection input') | ||||
->assertTip( | ->assertTip( | ||||
'tbody tr:nth-child(9) td.buttons button', | 'tbody tr:nth-child(9) td.buttons button', | ||||
'Access to shared folders' | |||||
) | |||||
// Distlist SKU | |||||
->assertSeeIn('tbody tr:nth-child(10) td.name', 'Distribution lists') | |||||
->assertSeeIn('tr:nth-child(10) td.price', '0,00 CHF/month') | |||||
->assertNotChecked('tbody tr:nth-child(10) td.selection input') | |||||
->assertEnabled('tbody tr:nth-child(10) td.selection input') | |||||
->assertTip( | |||||
'tbody tr:nth-child(10) td.buttons button', | |||||
'Access to mail distribution lists' | 'Access to mail distribution lists' | ||||
) | ) | ||||
// Check Distlist, Uncheck Beta, expect Distlist unchecked | // Check Distlist, Uncheck Beta, expect Distlist unchecked | ||||
->click('#sku-input-distlist') | ->click('#sku-input-distlist') | ||||
->click('#sku-input-beta') | ->click('#sku-input-beta') | ||||
->assertNotChecked('#sku-input-beta') | ->assertNotChecked('#sku-input-beta') | ||||
->assertNotChecked('#sku-input-distlist') | ->assertNotChecked('#sku-input-distlist') | ||||
// Click Distlist expect an alert | // Click Distlist expect an alert | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |