Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/StatusTest.php
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | public function testUserStatus(): void | ||||
$this->browse(function ($browser) { | $this->browse(function ($browser) { | ||||
$browser->visit(new Dashboard()) | $browser->visit(new Dashboard()) | ||||
->click('@links a.link-users') | ->click('@links a.link-users') | ||||
->on(new UserList()) | ->on(new UserList()) | ||||
// Assert user status icons | // Assert user status icons | ||||
->assertVisible('@table tbody tr:first-child td:first-child svg.fa-user.text-success') | ->assertVisible('@table tbody tr:first-child td:first-child svg.fa-user.text-success') | ||||
->assertText('@table tbody tr:first-child td:first-child svg title', 'Active') | ->assertText('@table tbody tr:first-child td:first-child svg title', 'Active') | ||||
->assertVisible('@table tbody tr:nth-child(2) td:first-child svg.fa-user.text-danger') | ->assertVisible('@table tbody tr:nth-child(3) td:first-child svg.fa-user.text-danger') | ||||
->assertText('@table tbody tr:nth-child(2) td:first-child svg title', 'Not Ready') | ->assertText('@table tbody tr:nth-child(3) td:first-child svg title', 'Not Ready') | ||||
->click('@table tbody tr:nth-child(2) td:first-child a') | ->click('@table tbody tr:nth-child(3) td:first-child a') | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->with('@form', function (Browser $browser) { | ->with('@form', function (Browser $browser) { | ||||
// Assert stet in the user edit form | // Assert stet 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'); | ||||
}); | }); | ||||
// TODO: The status should also be live-updated here | // TODO: The status should also be live-updated here | ||||
// Maybe when we have proper websocket communication | // Maybe when we have proper websocket communication | ||||
}); | }); | ||||
} | } | ||||
} | } |