mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-16 16:37:47 +00:00
refactor: upgrade to Livewire 4
This commit is contained in:
parent
c94dd89361
commit
a15645ad88
56 changed files with 166 additions and 278 deletions
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Livewire\Volt\Volt as LivewireVolt;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
|
|
@ -14,7 +13,7 @@ test('login screen can be rendered', function (): void {
|
|||
test('users can authenticate using the login screen', function (): void {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = LivewireVolt::test('auth.login')
|
||||
$response = Livewire::test('auth.login')
|
||||
->set('email', $user->email)
|
||||
->set('password', 'password')
|
||||
->call('login');
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
|
|
@ -18,7 +17,7 @@ test('password can be confirmed', function (): void {
|
|||
|
||||
$this->actingAs($user);
|
||||
|
||||
$response = Volt::test('auth.confirm-password')
|
||||
$response = Livewire::test('auth.confirm-password')
|
||||
->set('password', 'password')
|
||||
->call('confirmPassword');
|
||||
|
||||
|
|
@ -32,7 +31,7 @@ test('password is not confirmed with invalid password', function (): void {
|
|||
|
||||
$this->actingAs($user);
|
||||
|
||||
$response = Volt::test('auth.confirm-password')
|
||||
$response = Livewire::test('auth.confirm-password')
|
||||
->set('password', 'wrong-password')
|
||||
->call('confirmPassword');
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
use App\Models\User;
|
||||
use Illuminate\Auth\Notifications\ResetPassword;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
|
|
@ -18,7 +17,7 @@ test('reset password link can be requested', function (): void {
|
|||
|
||||
$user = User::factory()->create();
|
||||
|
||||
Volt::test('auth.forgot-password')
|
||||
Livewire::test('auth.forgot-password')
|
||||
->set('email', $user->email)
|
||||
->call('sendPasswordResetLink');
|
||||
|
||||
|
|
@ -30,7 +29,7 @@ test('reset password screen can be rendered', function (): void {
|
|||
|
||||
$user = User::factory()->create();
|
||||
|
||||
Volt::test('auth.forgot-password')
|
||||
Livewire::test('auth.forgot-password')
|
||||
->set('email', $user->email)
|
||||
->call('sendPasswordResetLink');
|
||||
|
||||
|
|
@ -48,12 +47,12 @@ test('password can be reset with valid token', function (): void {
|
|||
|
||||
$user = User::factory()->create();
|
||||
|
||||
Volt::test('auth.forgot-password')
|
||||
Livewire::test('auth.forgot-password')
|
||||
->set('email', $user->email)
|
||||
->call('sendPasswordResetLink');
|
||||
|
||||
Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user): true {
|
||||
$response = Volt::test('auth.reset-password', ['token' => $notification->token])
|
||||
$response = Livewire::test('auth.reset-password', ['token' => $notification->token])
|
||||
->set('email', $user->email)
|
||||
->set('password', 'password')
|
||||
->set('password_confirmation', 'password')
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('registration screen can be rendered', function (): void {
|
||||
|
|
@ -11,7 +9,7 @@ test('registration screen can be rendered', function (): void {
|
|||
});
|
||||
|
||||
test('new users can register', function (): void {
|
||||
$response = Volt::test('auth.register')
|
||||
$response = Livewire::test('auth.register')
|
||||
->set('name', 'Test User')
|
||||
->set('email', 'test@example.com')
|
||||
->set('password', 'password')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue