test(landing): assert a signed-in visitor stays on the landing page
This commit is contained in:
parent
200283e32a
commit
6d74440c75
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
use function Pest\Laravel\actingAs;
|
||||
|
||||
it('keeps a signed-in visitor on the landing page', function () {
|
||||
actingAs(User::factory()->onboarded()->create());
|
||||
|
||||
$page = visit('/');
|
||||
|
||||
// The wait is the point: a client-side redirect would fire on a timer, so
|
||||
// asserting the path immediately would pass even with one in place.
|
||||
$page->wait(4)
|
||||
->assertPathIs('/')
|
||||
->assertSee('Whisper Money')
|
||||
->assertNoJavascriptErrors();
|
||||
});
|
||||
Loading…
Reference in New Issue