refactor: rebase on Livewire 4 starter kit

This commit is contained in:
Benjamin Nussbaum 2026-01-15 21:55:24 +01:00
parent b097b0a7d7
commit e660da46fb
69 changed files with 1967 additions and 942 deletions

View file

@ -17,9 +17,7 @@ test('reset password link can be requested', function (): void {
$user = User::factory()->create();
Livewire::test('auth.forgot-password')
->set('email', $user->email)
->call('sendPasswordResetLink');
$this->post(route('password.request'), ['email' => $user->email]);
Notification::assertSentTo($user, ResetPassword::class);
});
@ -29,14 +27,12 @@ test('reset password screen can be rendered', function (): void {
$user = User::factory()->create();
Livewire::test('auth.forgot-password')
->set('email', $user->email)
->call('sendPasswordResetLink');
$this->post(route('password.request'), ['email' => $user->email]);
Notification::assertSentTo($user, ResetPassword::class, function ($notification): true {
$response = $this->get('/reset-password/'.$notification->token);
$response = $this->get(route('password.reset', $notification->token));
$response->assertStatus(200);
$response->assertOk();
return true;
});
@ -47,19 +43,18 @@ test('password can be reset with valid token', function (): void {
$user = User::factory()->create();
Livewire::test('auth.forgot-password')
->set('email', $user->email)
->call('sendPasswordResetLink');
$this->post(route('password.request'), ['email' => $user->email]);
Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user): true {
$response = Livewire::test('auth.reset-password', ['token' => $notification->token])
->set('email', $user->email)
->set('password', 'password')
->set('password_confirmation', 'password')
->call('resetPassword');
$response = $this->post(route('password.update'), [
'token' => $notification->token,
'email' => $user->email,
'password' => 'password',
'password_confirmation' => 'password',
]);
$response
->assertHasNoErrors()
->assertSessionHasNoErrors()
->assertRedirect(route('login', absolute: false));
return true;