Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/StatusTest.php
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | public function testDashboard(): void | ||||
$john->save(); | $john->save(); | ||||
$this->browse(function ($browser) use ($john, $domain) { | $this->browse(function ($browser) use ($john, $domain) { | ||||
$browser->visit(new Home()) | $browser->visit(new Home()) | ||||
->submitLogon('john@kolab.org', 'simple123', true) | ->submitLogon('john@kolab.org', 'simple123', true) | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->with(new Status(), function ($browser) use ($john) { | ->with(new Status(), function ($browser) use ($john) { | ||||
$browser->assertSeeIn('@body', 'We are preparing your account') | $browser->assertSeeIn('@body', 'We are preparing your account') | ||||
->assertProgress(28, 'Creating a mailbox...', 'pending') | ->assertProgress(71, 'Creating a mailbox...', 'pending') | ||||
->assertMissing('#status-verify') | ->assertMissing('#status-verify') | ||||
->assertMissing('#status-link') | ->assertMissing('#status-link') | ||||
->assertMissing('@refresh-button') | ->assertMissing('@refresh-button') | ||||
->assertMissing('@refresh-text'); | ->assertMissing('@refresh-text'); | ||||
$john->status |= User::STATUS_IMAP_READY; | $john->status |= User::STATUS_IMAP_READY; | ||||
$john->save(); | $john->save(); | ||||
Show All 34 Lines | public function testDashboard(): void | ||||
$john->status ^= User::STATUS_IMAP_READY; | $john->status ^= User::STATUS_IMAP_READY; | ||||
} | } | ||||
$john->save(); | $john->save(); | ||||
$this->browse(function ($browser) use ($john, $domain) { | $this->browse(function ($browser) use ($john, $domain) { | ||||
$browser->visit(new Dashboard()) | $browser->visit(new Dashboard()) | ||||
->with(new Status(), function ($browser) use ($john, $domain) { | ->with(new Status(), function ($browser) use ($john, $domain) { | ||||
$browser->assertSeeIn('@body', 'We are preparing your account') | $browser->assertSeeIn('@body', 'We are preparing your account') | ||||
->assertProgress(28, 'Creating a mailbox...', 'failed') | ->assertProgress(71, 'Creating a mailbox...', 'failed') | ||||
->assertVisible('@refresh-button') | ->assertVisible('@refresh-button') | ||||
->assertVisible('@refresh-text'); | ->assertVisible('@refresh-text'); | ||||
if ($john->refresh()->isImapReady()) { | if ($john->refresh()->isImapReady()) { | ||||
$john->status ^= User::STATUS_IMAP_READY; | $john->status ^= User::STATUS_IMAP_READY; | ||||
$john->save(); | $john->save(); | ||||
} | } | ||||
$domain->status |= Domain::STATUS_CONFIRMED; | $domain->status |= Domain::STATUS_CONFIRMED; | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | public function testUserStatus(): void | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->with('@form', function (Browser $browser) { | ->with('@form', function (Browser $browser) { | ||||
// Assert state in the user edit form | // Assert state in the user edit form | ||||
$browser->assertSeeIn('div.row:nth-child(1) label', 'Status') | $browser->assertSeeIn('div.row:nth-child(1) label', 'Status') | ||||
->assertSeeIn('div.row:nth-child(1) #status', 'Not Ready'); | ->assertSeeIn('div.row:nth-child(1) #status', 'Not Ready'); | ||||
}) | }) | ||||
->with(new Status(), function ($browser) use ($john) { | ->with(new Status(), function ($browser) use ($john) { | ||||
$browser->assertSeeIn('@body', 'We are preparing the user account') | $browser->assertSeeIn('@body', 'We are preparing the user account') | ||||
->assertProgress(28, 'Creating a mailbox...', 'pending') | ->assertProgress(71, 'Creating a mailbox...', 'pending') | ||||
->assertMissing('#status-verify') | ->assertMissing('#status-verify') | ||||
->assertMissing('#status-link') | ->assertMissing('#status-link') | ||||
->assertMissing('@refresh-button') | ->assertMissing('@refresh-button') | ||||
->assertMissing('@refresh-text'); | ->assertMissing('@refresh-text'); | ||||
$john->status |= User::STATUS_IMAP_READY; | $john->status |= User::STATUS_IMAP_READY; | ||||
$john->save(); | $john->save(); | ||||
Show All 21 Lines |