20-02-2026
This commit is contained in:
parent
854ce02bf6
commit
4d6b4930b2
128 changed files with 18247 additions and 2093 deletions
|
|
@ -1,12 +1,14 @@
|
|||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Notifications\ResetPassword;
|
||||
use App\Notifications\CustomResetPasswordNotification;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
test('reset password link screen can be rendered', function () {
|
||||
$response = $this->get('/forgot-password');
|
||||
$portalUrl = 'https://'.config('domains.domain_portal');
|
||||
|
||||
$response = $this->get($portalUrl.'/forgot-password');
|
||||
|
||||
$response->assertStatus(200);
|
||||
});
|
||||
|
|
@ -20,7 +22,7 @@ test('reset password link can be requested', function () {
|
|||
->set('email', $user->email)
|
||||
->call('sendPasswordResetLink');
|
||||
|
||||
Notification::assertSentTo($user, ResetPassword::class);
|
||||
Notification::assertSentTo($user, CustomResetPasswordNotification::class);
|
||||
});
|
||||
|
||||
test('reset password screen can be rendered', function () {
|
||||
|
|
@ -32,8 +34,10 @@ test('reset password screen can be rendered', function () {
|
|||
->set('email', $user->email)
|
||||
->call('sendPasswordResetLink');
|
||||
|
||||
Notification::assertSentTo($user, ResetPassword::class, function ($notification) {
|
||||
$response = $this->get('/reset-password/'.$notification->token);
|
||||
Notification::assertSentTo($user, CustomResetPasswordNotification::class, function ($notification) {
|
||||
$portalUrl = 'https://'.config('domains.domain_portal');
|
||||
|
||||
$response = $this->get($portalUrl.'/reset-password/'.$notification->token);
|
||||
|
||||
$response->assertStatus(200);
|
||||
|
||||
|
|
@ -50,7 +54,7 @@ test('password can be reset with valid token', function () {
|
|||
->set('email', $user->email)
|
||||
->call('sendPasswordResetLink');
|
||||
|
||||
Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) {
|
||||
Notification::assertSentTo($user, CustomResetPasswordNotification::class, function ($notification) use ($user) {
|
||||
$response = Volt::test('auth.reset-password', ['token' => $notification->token])
|
||||
->set('email', $user->email)
|
||||
->set('password', 'password')
|
||||
|
|
@ -59,7 +63,7 @@ test('password can be reset with valid token', function () {
|
|||
|
||||
$response
|
||||
->assertHasNoErrors()
|
||||
->assertRedirect(route('login', absolute: false));
|
||||
->assertRedirect(route('login'));
|
||||
|
||||
return true;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue