From 55f9fae9ab79e84e54856d77bceac8978a159f70 Mon Sep 17 00:00:00 2001 From: brufdev Date: Sat, 26 Jul 2025 21:51:23 +0100 Subject: [PATCH] Add test to complete dashboard code coverage --- tests/Feature/Dashboard/IndexTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/Feature/Dashboard/IndexTest.php b/tests/Feature/Dashboard/IndexTest.php index 18e9ff1..409e91c 100644 --- a/tests/Feature/Dashboard/IndexTest.php +++ b/tests/Feature/Dashboard/IndexTest.php @@ -18,3 +18,13 @@ it('redirects user to vaults page', function (): void { ->test(Index::class) ->assertRedirect(route('vaults.index')); }); + +it('redirects user to last visited page', function (): void { + $user = User::factory()->hasVaults(1)->create([ + 'last_visited_url' => route('vaults.show', ['vaultId' => 1], false), + ]); + + Livewire::actingAs($user) + ->test(Index::class) + ->assertRedirect(route('vaults.show', ['vaultId' => 1])); +});