mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 23:18:10 +00:00
Install Breeze
This commit is contained in:
parent
337c77f8a2
commit
32d63c09e7
55 changed files with 5782 additions and 88 deletions
41
tests/Feature/Auth/PasswordUpdateTest.php
Normal file
41
tests/Feature/Auth/PasswordUpdateTest.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Auth;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
test('password can be updated', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user);
|
||||
|
||||
$component = Volt::test('profile.update-password-form')
|
||||
->set('current_password', 'password')
|
||||
->set('password', 'new-password')
|
||||
->set('password_confirmation', 'new-password')
|
||||
->call('updatePassword');
|
||||
|
||||
$component
|
||||
->assertHasNoErrors()
|
||||
->assertNoRedirect();
|
||||
|
||||
$this->assertTrue(Hash::check('new-password', $user->refresh()->password));
|
||||
});
|
||||
|
||||
test('correct password must be provided to update password', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user);
|
||||
|
||||
$component = Volt::test('profile.update-password-form')
|
||||
->set('current_password', 'wrong-password')
|
||||
->set('password', 'new-password')
|
||||
->set('password_confirmation', 'new-password')
|
||||
->call('updatePassword');
|
||||
|
||||
$component
|
||||
->assertHasErrors(['current_password'])
|
||||
->assertNoRedirect();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue