Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Reseller/DashboardTest.php
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | class DashboardTest extends TestCaseDusk | ||||
/** | /** | ||||
* Test user search | * Test user search | ||||
*/ | */ | ||||
public function testSearch(): void | public function testSearch(): void | ||||
{ | { | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit(new Home()) | $browser->visit(new Home()) | ||||
->submitLogon('reseller@kolabnow.com', 'reseller', true) | ->submitLogon('reseller@' . \config('app.domain'), \App\Utils::generatePassphrase(), true) | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->assertFocused('@search input') | ->assertFocused('@search input') | ||||
->assertMissing('@search table'); | ->assertMissing('@search table'); | ||||
// Test search with no results | // Test search with no results | ||||
$browser->type('@search input', 'unknown') | $browser->type('@search input', 'unknown') | ||||
->click('@search form button') | ->click('@search form button') | ||||
->assertToast(Toast::TYPE_INFO, '0 user accounts have been found.') | ->assertToast(Toast::TYPE_INFO, '0 user accounts have been found.') | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | class DashboardTest extends TestCaseDusk | ||||
/** | /** | ||||
* Test user search deleted user/domain | * Test user search deleted user/domain | ||||
*/ | */ | ||||
public function testSearchDeleted(): void | public function testSearchDeleted(): void | ||||
{ | { | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit(new Home()) | $browser->visit(new Home()) | ||||
->submitLogon('reseller@kolabnow.com', 'reseller', true) | ->submitLogon('reseller@' . \config('app.domain'), \App\Utils::generatePassphrase(), true) | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->assertFocused('@search input') | ->assertFocused('@search input') | ||||
->assertMissing('@search table'); | ->assertMissing('@search table'); | ||||
// Deleted users/domains | // Deleted users/domains | ||||
$domain = $this->getTestDomain('testsearch.com', ['type' => \App\Domain::TYPE_EXTERNAL]); | $domain = $this->getTestDomain('testsearch.com', ['type' => \App\Domain::TYPE_EXTERNAL]); | ||||
$user = $this->getTestUser('test@testsearch.com'); | $user = $this->getTestUser('test@testsearch.com'); | ||||
$plan = \App\Plan::where('title', 'group')->first(); | $plan = \App\Plan::where('title', 'group')->first(); | ||||
Show All 24 Lines |