test(landing): assert a signed-in visitor stays on the landing page

This commit is contained in:
Víctor Falcón 2026-08-11 15:46:09 +02:00
parent 200283e32a
commit 6d74440c75
1 changed files with 18 additions and 0 deletions

View File

@ -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();
});