Mercurial > packages > auth
diff stubs/default/pest-tests/Feature/Auth/PasswordConfirmationTest.php @ 0:90e38de8f2ba
Initial Commit
| author | luka |
|---|---|
| date | Wed, 13 Aug 2025 22:17:20 -0400 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stubs/default/pest-tests/Feature/Auth/PasswordConfirmationTest.php Wed Aug 13 22:17:20 2025 -0400 @@ -0,0 +1,32 @@ +<?php + +use App\Models\User; + +test('confirm password screen can be rendered', function () { + $user = User::factory()->create(); + + $response = $this->actingAs($user)->get('/confirm-password'); + + $response->assertStatus(200); +}); + +test('password can be confirmed', function () { + $user = User::factory()->create(); + + $response = $this->actingAs($user)->post('/confirm-password', [ + 'password' => 'password', + ]); + + $response->assertRedirect(); + $response->assertSessionHasNoErrors(); +}); + +test('password is not confirmed with invalid password', function () { + $user = User::factory()->create(); + + $response = $this->actingAs($user)->post('/confirm-password', [ + 'password' => 'wrong-password', + ]); + + $response->assertSessionHasErrors(); +});
