Prime-Chat/tests/Feature/Auth/PasswordConfirmationTest.php

25 lines
591 B
PHP
Raw Normal View History

2024-12-19 07:21:23 +04:00
<?php
use App\Models\User;
2025-01-16 22:22:38 +04:00
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
2024-12-19 07:21:23 +04:00
test('confirm password screen can be rendered', function () {
$user = User::factory()->create();
$response = $this->actingAs($user)->get('/confirm-password');
$response->assertStatus(200);
});
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();
});