File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 44
55use App \Models \User ;
66use Illuminate \Foundation \Testing \RefreshDatabase ;
7- use Inertia \Testing \AssertableInertia ;
7+ use Inertia \Testing \AssertableInertia as Assert ;
88use Laravel \Fortify \Features ;
99use 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 }
You can’t perform that action at this time.
0 commit comments