Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/UsersTest.php
Show First 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | public function testInfo(): void | ||||
->assertNotChecked('#sku-input-2fa') | ->assertNotChecked('#sku-input-2fa') | ||||
->assertNotReadonly('#sku-input-activesync'); | ->assertNotReadonly('#sku-input-activesync'); | ||||
}); | }); | ||||
}); | }); | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test user settings tab | |||||
* | |||||
* @depends testInfo | |||||
*/ | |||||
public function testUserSettings(): void | |||||
{ | |||||
$john = $this->getTestUser('john@kolab.org'); | |||||
$john->setSetting('greylisting', null); | |||||
$this->browse(function (Browser $browser) { | |||||
$browser->on(new UserInfo()) | |||||
->assertElementsCount('@nav a', 2) | |||||
->assertSeeIn('@nav #tab-general', 'General') | |||||
->assertSeeIn('@nav #tab-settings', 'Settings') | |||||
->click('@nav #tab-settings') | |||||
->with('#settings form', function (Browser $browser) { | |||||
$browser->assertSeeIn('div.row:nth-child(1) label', 'Greylisting') | |||||
->click('div.row:nth-child(1) input[type=checkbox]:checked') | |||||
->click('button[type=submit]') | |||||
->assertToast(Toast::TYPE_SUCCESS, 'User settings updated successfully.'); | |||||
}); | |||||
}); | |||||
$this->assertSame('false', $john->fresh()->getSetting('greylisting')); | |||||
} | |||||
/** | |||||
* Test user adding page | * Test user adding page | ||||
* | * | ||||
* @depends testList | * @depends testList | ||||
*/ | */ | ||||
public function testNewUser(): void | public function testNewUser(): void | ||||
{ | { | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit(new UserList()) | $browser->visit(new UserList()) | ||||
▲ Show 20 Lines • Show All 335 Lines • Show Last 20 Lines |