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