Files
Nexora/tests/Feature/Auth/PasswordConfirmationTest.php
Javi 356f56eebd
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
first commit
2025-04-23 00:14:33 +06:00

38 lines
936 B
PHP

<?php
use App\Models\User;
use Livewire\Volt\Volt;
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();
$this->actingAs($user);
$response = Volt::test('auth.confirm-password')
->set('password', 'password')
->call('confirmPassword');
$response
->assertHasNoErrors()
->assertRedirect(route('dashboard', absolute: false));
});
test('password is not confirmed with invalid password', function () {
$user = User::factory()->create();
$this->actingAs($user);
$response = Volt::test('auth.confirm-password')
->set('password', 'wrong-password')
->call('confirmPassword');
$response->assertHasErrors(['password']);
});