Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/UsersTest.php
Show All 35 Lines | public function setUp(): void | ||||
$this->deleteTestUser('julia.roberts@kolab.org'); | $this->deleteTestUser('julia.roberts@kolab.org'); | ||||
$john = User::where('email', 'john@kolab.org')->first(); | $john = User::where('email', 'john@kolab.org')->first(); | ||||
$john->setSettings($this->profile); | $john->setSettings($this->profile); | ||||
UserAlias::where('user_id', $john->id) | UserAlias::where('user_id', $john->id) | ||||
->where('alias', 'john.test@kolab.org')->delete(); | ->where('alias', 'john.test@kolab.org')->delete(); | ||||
Entitlement::where('entitleable_id', $john->id)->whereIn('cost', [25, 100])->delete(); | $activesync_sku = Sku::withEnvTenantContext()->where('title', 'activesync')->first(); | ||||
$storage_sku = Sku::withEnvTenantContext()->where('title', 'storage')->first(); | |||||
Entitlement::where('entitleable_id', $john->id)->where('sku_id', $activesync_sku->id)->delete(); | |||||
Entitlement::where('cost', '>=', 5000)->delete(); | Entitlement::where('cost', '>=', 5000)->delete(); | ||||
Entitlement::where('cost', '=', 25)->where('sku_id', $storage_sku->id)->delete(); | |||||
$wallet = $john->wallets()->first(); | $wallet = $john->wallets()->first(); | ||||
$wallet->discount()->dissociate(); | $wallet->discount()->dissociate(); | ||||
$wallet->save(); | $wallet->save(); | ||||
$this->clearBetaEntitlements(); | $this->clearBetaEntitlements(); | ||||
$this->clearMeetEntitlements(); | $this->clearMeetEntitlements(); | ||||
} | } | ||||
/** | /** | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
*/ | */ | ||||
public function tearDown(): void | public function tearDown(): void | ||||
{ | { | ||||
$this->deleteTestUser('julia.roberts@kolab.org'); | $this->deleteTestUser('julia.roberts@kolab.org'); | ||||
$john = User::where('email', 'john@kolab.org')->first(); | $john = User::where('email', 'john@kolab.org')->first(); | ||||
$john->setSettings($this->profile); | $john->setSettings($this->profile); | ||||
UserAlias::where('user_id', $john->id) | UserAlias::where('user_id', $john->id) | ||||
->where('alias', 'john.test@kolab.org')->delete(); | ->where('alias', 'john.test@kolab.org')->delete(); | ||||
Entitlement::where('entitleable_id', $john->id)->whereIn('cost', [25, 100])->delete(); | $activesync_sku = Sku::withEnvTenantContext()->where('title', 'activesync')->first(); | ||||
$storage_sku = Sku::withEnvTenantContext()->where('title', 'storage')->first(); | |||||
Entitlement::where('entitleable_id', $john->id)->where('sku_id', $activesync_sku->id)->delete(); | |||||
Entitlement::where('cost', '>=', 5000)->delete(); | Entitlement::where('cost', '>=', 5000)->delete(); | ||||
Entitlement::where('cost', '=', 25)->where('sku_id', $storage_sku->id)->delete(); | |||||
$wallet = $john->wallets()->first(); | $wallet = $john->wallets()->first(); | ||||
$wallet->discount()->dissociate(); | $wallet->discount()->dissociate(); | ||||
$wallet->save(); | $wallet->save(); | ||||
$this->clearBetaEntitlements(); | $this->clearBetaEntitlements(); | ||||
$this->clearMeetEntitlements(); | $this->clearMeetEntitlements(); | ||||
▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | public function testInfo(): void | ||||
// Test subscriptions | // Test subscriptions | ||||
$browser->with('@form', function (Browser $browser) { | $browser->with('@form', function (Browser $browser) { | ||||
$browser->assertSeeIn('div.row:nth-child(9) label', 'Subscriptions') | $browser->assertSeeIn('div.row:nth-child(9) label', 'Subscriptions') | ||||
->assertVisible('@skus.row:nth-child(9)') | ->assertVisible('@skus.row:nth-child(9)') | ||||
->with('@skus', function ($browser) { | ->with('@skus', function ($browser) { | ||||
$browser->assertElementsCount('tbody tr', 6) | $browser->assertElementsCount('tbody tr', 6) | ||||
// Mailbox SKU | // Mailbox SKU | ||||
->assertSeeIn('tbody tr:nth-child(1) td.name', 'User Mailbox') | ->assertSeeIn('tbody tr:nth-child(1) td.name', 'User Mailbox') | ||||
->assertSeeIn('tbody tr:nth-child(1) td.price', '4,44 CHF/month') | ->assertSeeIn('tbody tr:nth-child(1) td.price', '5,00 CHF/month') | ||||
->assertChecked('tbody tr:nth-child(1) td.selection input') | ->assertChecked('tbody tr:nth-child(1) td.selection input') | ||||
->assertDisabled('tbody tr:nth-child(1) td.selection input') | ->assertDisabled('tbody tr:nth-child(1) td.selection input') | ||||
->assertTip( | ->assertTip( | ||||
'tbody tr:nth-child(1) td.buttons button', | 'tbody tr:nth-child(1) td.buttons button', | ||||
'Just a mailbox' | 'Just a mailbox' | ||||
) | ) | ||||
// Storage SKU | // Storage SKU | ||||
->assertSeeIn('tbody tr:nth-child(2) td.name', 'Storage Quota') | ->assertSeeIn('tbody tr:nth-child(2) td.name', 'Storage Quota') | ||||
->assertSeeIn('tr:nth-child(2) td.price', '0,00 CHF/month') | ->assertSeeIn('tr:nth-child(2) td.price', '0,00 CHF/month') | ||||
->assertChecked('tbody tr:nth-child(2) td.selection input') | ->assertChecked('tbody tr:nth-child(2) td.selection input') | ||||
->assertDisabled('tbody tr:nth-child(2) td.selection input') | ->assertDisabled('tbody tr:nth-child(2) td.selection input') | ||||
->assertTip( | ->assertTip( | ||||
'tbody tr:nth-child(2) td.buttons button', | 'tbody tr:nth-child(2) td.buttons button', | ||||
'Some wiggle room' | 'Some wiggle room' | ||||
) | ) | ||||
->with(new QuotaInput('tbody tr:nth-child(2) .range-input'), function ($browser) { | ->with(new QuotaInput('tbody tr:nth-child(2) .range-input'), function ($browser) { | ||||
$browser->assertQuotaValue(2)->setQuotaValue(3); | $browser->assertQuotaValue(5)->setQuotaValue(6); | ||||
}) | }) | ||||
->assertSeeIn('tr:nth-child(2) td.price', '0,25 CHF/month') | ->assertSeeIn('tr:nth-child(2) td.price', '0,25 CHF/month') | ||||
// groupware SKU | // groupware SKU | ||||
->assertSeeIn('tbody tr:nth-child(3) td.name', 'Groupware Features') | ->assertSeeIn('tbody tr:nth-child(3) td.name', 'Groupware Features') | ||||
->assertSeeIn('tbody tr:nth-child(3) td.price', '5,55 CHF/month') | ->assertSeeIn('tbody tr:nth-child(3) td.price', '4,90 CHF/month') | ||||
->assertChecked('tbody tr:nth-child(3) td.selection input') | ->assertChecked('tbody tr:nth-child(3) td.selection input') | ||||
->assertEnabled('tbody tr:nth-child(3) td.selection input') | ->assertEnabled('tbody tr:nth-child(3) td.selection input') | ||||
->assertTip( | ->assertTip( | ||||
'tbody tr:nth-child(3) td.buttons button', | 'tbody tr:nth-child(3) td.buttons button', | ||||
'Groupware functions like Calendar, Tasks, Notes, etc.' | 'Groupware functions like Calendar, Tasks, Notes, etc.' | ||||
) | ) | ||||
// ActiveSync SKU | // ActiveSync SKU | ||||
->assertSeeIn('tbody tr:nth-child(4) td.name', 'Activesync') | ->assertSeeIn('tbody tr:nth-child(4) td.name', 'Activesync') | ||||
->assertSeeIn('tbody tr:nth-child(4) td.price', '1,00 CHF/month') | ->assertSeeIn('tbody tr:nth-child(4) td.price', '0,00 CHF/month') | ||||
->assertNotChecked('tbody tr:nth-child(4) td.selection input') | ->assertNotChecked('tbody tr:nth-child(4) td.selection input') | ||||
->assertEnabled('tbody tr:nth-child(4) td.selection input') | ->assertEnabled('tbody tr:nth-child(4) td.selection input') | ||||
->assertTip( | ->assertTip( | ||||
'tbody tr:nth-child(4) td.buttons button', | 'tbody tr:nth-child(4) td.buttons button', | ||||
'Mobile synchronization' | 'Mobile synchronization' | ||||
) | ) | ||||
// 2FA SKU | // 2FA SKU | ||||
->assertSeeIn('tbody tr:nth-child(5) td.name', '2-Factor Authentication') | ->assertSeeIn('tbody tr:nth-child(5) td.name', '2-Factor Authentication') | ||||
Show All 18 Lines | public function testInfo(): void | ||||
->assertMissing('@skus table + .hint') | ->assertMissing('@skus table + .hint') | ||||
->click('button[type=submit]') | ->click('button[type=submit]') | ||||
->assertToast(Toast::TYPE_SUCCESS, 'User data updated successfully.'); | ->assertToast(Toast::TYPE_SUCCESS, 'User data updated successfully.'); | ||||
}) | }) | ||||
->on(new UserList()) | ->on(new UserList()) | ||||
->click('@table tr:nth-child(3) a') | ->click('@table tr:nth-child(3) a') | ||||
->on(new UserInfo()); | ->on(new UserInfo()); | ||||
$expected = ['activesync', 'groupware', 'mailbox', 'storage', 'storage', 'storage']; | $expected = ['activesync', 'groupware', 'mailbox', | ||||
'storage', 'storage', 'storage', 'storage', 'storage', 'storage']; | |||||
$this->assertUserEntitlements($john, $expected); | $this->assertUserEntitlements($john, $expected); | ||||
// Test subscriptions interaction | // Test subscriptions interaction | ||||
$browser->with('@form', function (Browser $browser) { | $browser->with('@form', function (Browser $browser) { | ||||
$browser->with('@skus', function ($browser) { | $browser->with('@skus', function ($browser) { | ||||
// Uncheck 'groupware', expect activesync unchecked | // Uncheck 'groupware', expect activesync unchecked | ||||
$browser->click('#sku-input-groupware') | $browser->click('#sku-input-groupware') | ||||
->assertNotChecked('#sku-input-groupware') | ->assertNotChecked('#sku-input-groupware') | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | public function testNewUser(): void | ||||
->assertSeeIn('div.row:nth-child(7) label', 'Confirm Password') | ->assertSeeIn('div.row:nth-child(7) label', 'Confirm Password') | ||||
->assertValue('div.row:nth-child(7) input[type=password]', '') | ->assertValue('div.row:nth-child(7) input[type=password]', '') | ||||
->assertSeeIn('div.row:nth-child(8) label', 'Package') | ->assertSeeIn('div.row:nth-child(8) label', 'Package') | ||||
// assert packages list widget, select "Lite Account" | // assert packages list widget, select "Lite Account" | ||||
->with('@packages', function ($browser) { | ->with('@packages', function ($browser) { | ||||
$browser->assertElementsCount('tbody tr', 2) | $browser->assertElementsCount('tbody tr', 2) | ||||
->assertSeeIn('tbody tr:nth-child(1)', 'Groupware Account') | ->assertSeeIn('tbody tr:nth-child(1)', 'Groupware Account') | ||||
->assertSeeIn('tbody tr:nth-child(2)', 'Lite Account') | ->assertSeeIn('tbody tr:nth-child(2)', 'Lite Account') | ||||
->assertSeeIn('tbody tr:nth-child(1) .price', '9,99 CHF/month') | ->assertSeeIn('tbody tr:nth-child(1) .price', '9,90 CHF/month') | ||||
->assertSeeIn('tbody tr:nth-child(2) .price', '4,44 CHF/month') | ->assertSeeIn('tbody tr:nth-child(2) .price', '5,00 CHF/month') | ||||
->assertChecked('tbody tr:nth-child(1) input') | ->assertChecked('tbody tr:nth-child(1) input') | ||||
->click('tbody tr:nth-child(2) input') | ->click('tbody tr:nth-child(2) input') | ||||
->assertNotChecked('tbody tr:nth-child(1) input') | ->assertNotChecked('tbody tr:nth-child(1) input') | ||||
->assertChecked('tbody tr:nth-child(2) input'); | ->assertChecked('tbody tr:nth-child(2) input'); | ||||
}) | }) | ||||
->assertMissing('@packages table + .hint') | ->assertMissing('@packages table + .hint') | ||||
->assertSeeIn('button[type=submit]', 'Submit'); | ->assertSeeIn('button[type=submit]', 'Submit'); | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public function testNewUser(): void | ||||
->whenAvailable('@table', function (Browser $browser) { | ->whenAvailable('@table', function (Browser $browser) { | ||||
$browser->assertElementsCount('tbody tr', 5) | $browser->assertElementsCount('tbody tr', 5) | ||||
->assertSeeIn('tbody tr:nth-child(4) a', 'julia.roberts@kolab.org'); | ->assertSeeIn('tbody tr:nth-child(4) a', 'julia.roberts@kolab.org'); | ||||
}); | }); | ||||
$julia = User::where('email', 'julia.roberts@kolab.org')->first(); | $julia = User::where('email', 'julia.roberts@kolab.org')->first(); | ||||
$alias = UserAlias::where('user_id', $julia->id)->where('alias', 'julia.roberts2@kolab.org')->first(); | $alias = UserAlias::where('user_id', $julia->id)->where('alias', 'julia.roberts2@kolab.org')->first(); | ||||
$this->assertTrue(!empty($alias)); | $this->assertTrue(!empty($alias)); | ||||
$this->assertUserEntitlements($julia, ['mailbox', 'storage', 'storage']); | $this->assertUserEntitlements($julia, ['mailbox', 'storage', 'storage', 'storage', 'storage', 'storage']); | ||||
$this->assertSame('Julia', $julia->getSetting('first_name')); | $this->assertSame('Julia', $julia->getSetting('first_name')); | ||||
$this->assertSame('Roberts', $julia->getSetting('last_name')); | $this->assertSame('Roberts', $julia->getSetting('last_name')); | ||||
$this->assertSame('Test Org', $julia->getSetting('organization')); | $this->assertSame('Test Org', $julia->getSetting('organization')); | ||||
// Some additional tests for the list input widget | // Some additional tests for the list input widget | ||||
$browser->click('tbody tr:nth-child(4) a') | $browser->click('tbody tr:nth-child(4) a') | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->with(new ListInput('#aliases'), function (Browser $browser) { | ->with(new ListInput('#aliases'), function (Browser $browser) { | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | public function testDiscountedPrices(): void | ||||
->click('@table tr:nth-child(2) a') // joe@kolab.org | ->click('@table tr:nth-child(2) a') // joe@kolab.org | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->with('@form', function (Browser $browser) { | ->with('@form', function (Browser $browser) { | ||||
$browser->whenAvailable('@skus', function (Browser $browser) { | $browser->whenAvailable('@skus', function (Browser $browser) { | ||||
$quota_input = new QuotaInput('tbody tr:nth-child(2) .range-input'); | $quota_input = new QuotaInput('tbody tr:nth-child(2) .range-input'); | ||||
$browser->waitFor('tbody tr') | $browser->waitFor('tbody tr') | ||||
->assertElementsCount('tbody tr', 6) | ->assertElementsCount('tbody tr', 6) | ||||
// Mailbox SKU | // Mailbox SKU | ||||
->assertSeeIn('tbody tr:nth-child(1) td.price', '3,99 CHF/month¹') | ->assertSeeIn('tbody tr:nth-child(1) td.price', '4,50 CHF/month¹') | ||||
// Storage SKU | // Storage SKU | ||||
->assertSeeIn('tr:nth-child(2) td.price', '0,00 CHF/month¹') | ->assertSeeIn('tr:nth-child(2) td.price', '0,00 CHF/month¹') | ||||
->with($quota_input, function (Browser $browser) { | ->with($quota_input, function (Browser $browser) { | ||||
$browser->setQuotaValue(100); | $browser->setQuotaValue(100); | ||||
}) | }) | ||||
->assertSeeIn('tr:nth-child(2) td.price', '22,05 CHF/month¹') | ->assertSeeIn('tr:nth-child(2) td.price', '21,37 CHF/month¹') | ||||
// groupware SKU | // groupware SKU | ||||
->assertSeeIn('tbody tr:nth-child(3) td.price', '4,99 CHF/month¹') | ->assertSeeIn('tbody tr:nth-child(3) td.price', '4,41 CHF/month¹') | ||||
// ActiveSync SKU | // ActiveSync SKU | ||||
->assertSeeIn('tbody tr:nth-child(4) td.price', '0,90 CHF/month¹') | ->assertSeeIn('tbody tr:nth-child(4) td.price', '0,00 CHF/month¹') | ||||
// 2FA SKU | // 2FA SKU | ||||
->assertSeeIn('tbody tr:nth-child(5) td.price', '0,00 CHF/month¹'); | ->assertSeeIn('tbody tr:nth-child(5) td.price', '0,00 CHF/month¹'); | ||||
}) | }) | ||||
->assertSeeIn('@skus table + .hint', '¹ applied discount: 10% - Test voucher'); | ->assertSeeIn('@skus table + .hint', '¹ applied discount: 10% - Test voucher'); | ||||
}); | }); | ||||
}); | }); | ||||
// Packages on new user page | // Packages on new user page | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit(new UserList()) | $browser->visit(new UserList()) | ||||
->click('button.create-user') | ->click('button.create-user') | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->with('@form', function (Browser $browser) { | ->with('@form', function (Browser $browser) { | ||||
$browser->whenAvailable('@packages', function (Browser $browser) { | $browser->whenAvailable('@packages', function (Browser $browser) { | ||||
$browser->assertElementsCount('tbody tr', 2) | $browser->assertElementsCount('tbody tr', 2) | ||||
->assertSeeIn('tbody tr:nth-child(1) .price', '8,99 CHF/month¹') // Groupware | ->assertSeeIn('tbody tr:nth-child(1) .price', '8,91 CHF/month¹') // Groupware | ||||
->assertSeeIn('tbody tr:nth-child(2) .price', '3,99 CHF/month¹'); // Lite | ->assertSeeIn('tbody tr:nth-child(2) .price', '4,50 CHF/month¹'); // Lite | ||||
}) | }) | ||||
->assertSeeIn('@packages table + .hint', '¹ applied discount: 10% - Test voucher'); | ->assertSeeIn('@packages table + .hint', '¹ applied discount: 10% - Test voucher'); | ||||
}); | }); | ||||
}); | }); | ||||
// Test using entitlement cost instead of the SKU cost | // Test using entitlement cost instead of the SKU cost | ||||
$this->browse(function (Browser $browser) use ($wallet) { | $this->browse(function (Browser $browser) use ($wallet) { | ||||
$joe = User::where('email', 'joe@kolab.org')->first(); | $joe = User::where('email', 'joe@kolab.org')->first(); | ||||
$beta_sku = Sku::where('title', 'beta')->first(); | $beta_sku = Sku::withEnvTenantContext()->where('title', 'beta')->first(); | ||||
$storage_sku = Sku::where('title', 'storage')->first(); | $storage_sku = Sku::withEnvTenantContext()->where('title', 'storage')->first(); | ||||
// Add an extra storage and beta entitlement with different prices | // Add an extra storage and beta entitlement with different prices | ||||
Entitlement::create([ | Entitlement::create([ | ||||
'wallet_id' => $wallet->id, | 'wallet_id' => $wallet->id, | ||||
'sku_id' => $beta_sku->id, | 'sku_id' => $beta_sku->id, | ||||
'cost' => 5010, | 'cost' => 5010, | ||||
'entitleable_id' => $joe->id, | 'entitleable_id' => $joe->id, | ||||
'entitleable_type' => User::class | 'entitleable_type' => User::class | ||||
Show All 12 Lines | public function testDiscountedPrices(): void | ||||
$browser->whenAvailable('@skus', function (Browser $browser) { | $browser->whenAvailable('@skus', function (Browser $browser) { | ||||
$quota_input = new QuotaInput('tbody tr:nth-child(2) .range-input'); | $quota_input = new QuotaInput('tbody tr:nth-child(2) .range-input'); | ||||
$browser->waitFor('tbody tr') | $browser->waitFor('tbody tr') | ||||
// Beta SKU | // Beta SKU | ||||
->assertSeeIn('tbody tr:nth-child(7) td.price', '45,09 CHF/month¹') | ->assertSeeIn('tbody tr:nth-child(7) td.price', '45,09 CHF/month¹') | ||||
// Storage SKU | // Storage SKU | ||||
->assertSeeIn('tr:nth-child(2) td.price', '45,00 CHF/month¹') | ->assertSeeIn('tr:nth-child(2) td.price', '45,00 CHF/month¹') | ||||
->with($quota_input, function (Browser $browser) { | ->with($quota_input, function (Browser $browser) { | ||||
$browser->setQuotaValue(4); | $browser->setQuotaValue(7); | ||||
}) | }) | ||||
->assertSeeIn('tr:nth-child(2) td.price', '45,22 CHF/month¹') | ->assertSeeIn('tr:nth-child(2) td.price', '45,22 CHF/month¹') | ||||
->with($quota_input, function (Browser $browser) { | ->with($quota_input, function (Browser $browser) { | ||||
$browser->setQuotaValue(2); | $browser->setQuotaValue(5); | ||||
}) | }) | ||||
->assertSeeIn('tr:nth-child(2) td.price', '0,00 CHF/month¹'); | ->assertSeeIn('tr:nth-child(2) td.price', '0,00 CHF/month¹'); | ||||
}) | }) | ||||
->assertSeeIn('@skus table + .hint', '¹ applied discount: 10% - Test voucher'); | ->assertSeeIn('@skus table + .hint', '¹ applied discount: 10% - Test voucher'); | ||||
}); | }); | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test beta entitlements | * Test beta entitlements | ||||
* | * | ||||
* @depends testList | * @depends testList | ||||
*/ | */ | ||||
public function testBetaEntitlements(): void | 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::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', 8) | $browser->assertElementsCount('tbody tr', 8) | ||||
// 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)') | ||||
Show All 33 Lines | public function testBetaEntitlements(): void | ||||
->acceptDialog() | ->acceptDialog() | ||||
// Enable Beta and Distlist and submit | // Enable Beta and Distlist and submit | ||||
->click('#sku-input-beta') | ->click('#sku-input-beta') | ||||
->click('#sku-input-distlist'); | ->click('#sku-input-distlist'); | ||||
}) | }) | ||||
->click('button[type=submit]') | ->click('button[type=submit]') | ||||
->assertToast(Toast::TYPE_SUCCESS, 'User data updated successfully.'); | ->assertToast(Toast::TYPE_SUCCESS, 'User data updated successfully.'); | ||||
$expected = ['beta', 'distlist', 'groupware', 'mailbox', 'storage', 'storage']; | $expected = [ | ||||
'beta', | |||||
'distlist', | |||||
'groupware', | |||||
'mailbox', | |||||
'storage', 'storage', 'storage', 'storage', 'storage' | |||||
]; | |||||
$this->assertUserEntitlements($john, $expected); | $this->assertUserEntitlements($john, $expected); | ||||
$browser->visit('/user/' . $john->id) | $browser->visit('/user/' . $john->id) | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->click('#sku-input-beta') | ->click('#sku-input-beta') | ||||
->click('button[type=submit]') | ->click('button[type=submit]') | ||||
->assertToast(Toast::TYPE_SUCCESS, 'User data updated successfully.'); | ->assertToast(Toast::TYPE_SUCCESS, 'User data updated successfully.'); | ||||
$expected = ['groupware', 'mailbox', 'storage', 'storage']; | $expected = [ | ||||
'groupware', | |||||
'mailbox', | |||||
'storage', 'storage', 'storage', 'storage', 'storage' | |||||
]; | |||||
$this->assertUserEntitlements($john, $expected); | $this->assertUserEntitlements($john, $expected); | ||||
}); | }); | ||||
// TODO: Test that the Distlist SKU is not available for users that aren't a group account owners | // TODO: Test that the Distlist SKU is not available for users that aren't a group account owners | ||||
// TODO: Test that entitlements change has immediate effect on the available items in dashboard | // TODO: Test that entitlements change has immediate effect on the available items in dashboard | ||||
// i.e. does not require a page reload nor re-login. | // i.e. does not require a page reload nor re-login. | ||||
} | } | ||||
} | } |