Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Admin/UserTest.php
Show First 20 Lines • Show All 549 Lines • ▼ Show 20 Lines | public function testSuspendAndUnsuspend(): void | ||||
->assertToast(Toast::TYPE_SUCCESS, 'User unsuspended successfully.') | ->assertToast(Toast::TYPE_SUCCESS, 'User unsuspended successfully.') | ||||
->assertSeeIn('@user-info #status span.text-success', 'Active') | ->assertSeeIn('@user-info #status span.text-success', 'Active') | ||||
->assertVisible('@user-info #button-suspend') | ->assertVisible('@user-info #button-suspend') | ||||
->assertMissing('@user-info #button-unsuspend'); | ->assertMissing('@user-info #button-unsuspend'); | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test the Resync button | |||||
*/ | |||||
public function testResync(): void | |||||
{ | |||||
$this->browse(function (Browser $browser) { | |||||
$john = $this->getTestUser('john@kolab.org'); | |||||
$browser->visit(new UserPage($john->id)) | |||||
->assertSeeIn('@user-info #button-resync', 'Resync') | |||||
->click('@user-info #button-resync') | |||||
->assertToast(Toast::TYPE_SUCCESS, "User synchronization have been started."); | |||||
}); | |||||
} | |||||
/** | |||||
* Test resetting 2FA for the user | * Test resetting 2FA for the user | ||||
*/ | */ | ||||
public function testReset2FA(): void | public function testReset2FA(): void | ||||
{ | { | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$user = $this->getTestUser('userstest1@kolabnow.com'); | $user = $this->getTestUser('userstest1@kolabnow.com'); | ||||
$sku2fa = Sku::withEnvTenantContext()->where('title', '2fa')->first(); | $sku2fa = Sku::withEnvTenantContext()->where('title', '2fa')->first(); | ||||
$user->assignSku($sku2fa); | $user->assignSku($sku2fa); | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |