mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
Install Breeze
This commit is contained in:
parent
337c77f8a2
commit
32d63c09e7
55 changed files with 5782 additions and 88 deletions
46
tests/Feature/Auth/PasswordConfirmationTest.php
Normal file
46
tests/Feature/Auth/PasswordConfirmationTest.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Auth;
|
||||
|
||||
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
|
||||
->assertSeeVolt('pages.auth.confirm-password')
|
||||
->assertStatus(200);
|
||||
});
|
||||
|
||||
test('password can be confirmed', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user);
|
||||
|
||||
$component = Volt::test('pages.auth.confirm-password')
|
||||
->set('password', 'password');
|
||||
|
||||
$component->call('confirmPassword');
|
||||
|
||||
$component
|
||||
->assertRedirect('/dashboard')
|
||||
->assertHasNoErrors();
|
||||
});
|
||||
|
||||
test('password is not confirmed with invalid password', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user);
|
||||
|
||||
$component = Volt::test('pages.auth.confirm-password')
|
||||
->set('password', 'wrong-password');
|
||||
|
||||
$component->call('confirmPassword');
|
||||
|
||||
$component
|
||||
->assertNoRedirect()
|
||||
->assertHasErrors('password');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue