Skip to content

Commit b931cb3

Browse files
committed
Merge branch 'replace_password_reset_with_fortify' into repalce_register_with_fortify
2 parents 92f2e62 + 6d7577c commit b931cb3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/Feature/Auth/TwoFactorChallengeTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use App\Models\User;
66
use Illuminate\Foundation\Testing\RefreshDatabase;
7-
use Inertia\Testing\AssertableInertia;
7+
use Inertia\Testing\AssertableInertia as Assert;
88
use Laravel\Fortify\Features;
99
use Tests\TestCase;
1010

@@ -36,14 +36,20 @@ public function test_two_factor_challenge_can_be_rendered(): void
3636

3737
$user = User::factory()->create();
3838

39+
$user->forceFill([
40+
'two_factor_secret' => encrypt('test-secret'),
41+
'two_factor_recovery_codes' => encrypt(json_encode(['code1', 'code2'])),
42+
'two_factor_confirmed_at' => now(),
43+
])->save();
44+
3945
$this->post(route('login'), [
4046
'email' => $user->email,
4147
'password' => 'password',
4248
]);
4349

4450
$this->get(route('two-factor.login'))
4551
->assertOk()
46-
->assertInertia(fn (AssertableInertia $page) => $page
52+
->assertInertia(fn (Assert $page) => $page
4753
->component('auth/TwoFactorChallenge')
4854
);
4955
}

0 commit comments

Comments
 (0)