KSA-ORACLE-ALLACCESSKEYS/tests/Feature/Auth/PasswordConfirmationTest.php
Nyavokevin 9e5cc5ab1a
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
add dark theme
2025-09-18 20:34:07 +03:00

34 lines
880 B
PHP

<?php
use App\Models\User;
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
test('confirm password screen can be rendered', function () {
$user = User::factory()->create();
$response = $this->actingAs($user)->get(route('password.confirm'));
$response->assertStatus(200);
});
test('password can be confirmed', function () {
$user = User::factory()->create();
$response = $this->actingAs($user)->post(route('password.confirm.store'), [
'password' => 'password',
]);
$response->assertRedirect();
$response->assertSessionHasNoErrors();
});
test('password is not confirmed with invalid password', function () {
$user = User::factory()->create();
$response = $this->actingAs($user)->post(route('password.confirm.store'), [
'password' => 'wrong-password',
]);
$response->assertSessionHasErrors();
});