Skip to content

Commit 444e8a3

Browse files
committed
Fix starter-kit error message using laravel/fortify
Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 0aae2ca commit 444e8a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/Browser/Auth/PasswordConfirmationTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use App\Models\User;
4+
use Composer\InstalledVersions;
45

56
use function Pest\Laravel\actingAs;
67

@@ -28,11 +29,14 @@
2829
test('password is not confirmed with invalid password', function () {
2930
actingAs(User::factory()->create());
3031

32+
// @TODO: The following check is only required to handle starter-kit without 2 factor authentication.
33+
$usesTwoFactorAuthentication = InstalledVersions::isInstalled('laravel/fortify');
34+
3135
visit(route('password.confirm'))
3236
->fill('password', 'wrong-password')
3337
->press('@confirm-password-button')
3438
->assertUrlIs(route('password.confirm'))
35-
->assertSee('The provided password is incorrect.')
39+
->assertSee($usesTwoFactorAuthentication ? 'The provided password was incorrect.' : 'The provided password is incorrect.')
3640
->assertNoConsoleLogs()
3741
->assertNoJavaScriptErrors();
3842
});

0 commit comments

Comments
 (0)