diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 982830f..85e0cc6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | cd ../app - composer require livewire/livewire:^2.0 + composer require livewire/livewire:^3.0 composer config repositories.local '{"type": "path", "url": "../tall"}' --file composer.json composer require laravel-frontend-presets/tall:@dev - name: Install preset diff --git a/stubs/auth/app/Http/Livewire/Auth/Login.php b/stubs/auth/app/Livewire/Auth/Login.php similarity index 91% rename from stubs/auth/app/Http/Livewire/Auth/Login.php rename to stubs/auth/app/Livewire/Auth/Login.php index 681c7fe..67c7e66 100644 --- a/stubs/auth/app/Http/Livewire/Auth/Login.php +++ b/stubs/auth/app/Livewire/Auth/Login.php @@ -1,8 +1,7 @@ sendEmailVerificationNotification(); - $this->emit('resent'); + $this->dispatch('resent'); session()->flash('resent'); } diff --git a/stubs/auth/routes/web.php b/stubs/auth/routes/web.php index ba25156..cab49c3 100644 --- a/stubs/auth/routes/web.php +++ b/stubs/auth/routes/web.php @@ -2,12 +2,12 @@ use App\Http\Controllers\Auth\EmailVerificationController; use App\Http\Controllers\Auth\LogoutController; -use App\Http\Livewire\Auth\Login; -use App\Http\Livewire\Auth\Passwords\Confirm; -use App\Http\Livewire\Auth\Passwords\Email; -use App\Http\Livewire\Auth\Passwords\Reset; -use App\Http\Livewire\Auth\Register; -use App\Http\Livewire\Auth\Verify; +use App\Livewire\Auth\Login; +use App\Livewire\Auth\Passwords\Confirm; +use App\Livewire\Auth\Passwords\Email; +use App\Livewire\Auth\Passwords\Reset; +use App\Livewire\Auth\Register; +use App\Livewire\Auth\Verify; use Illuminate\Support\Facades\Route; /* diff --git a/stubs/auth/tests/Feature/Auth/LoginTest.php b/stubs/auth/tests/Feature/Auth/LoginTest.php index 80813b8..a70c214 100644 --- a/stubs/auth/tests/Feature/Auth/LoginTest.php +++ b/stubs/auth/tests/Feature/Auth/LoginTest.php @@ -3,6 +3,7 @@ namespace Tests\Feature\Auth; use App\Models\User; +use App\Livewire\Auth\Login; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; @@ -18,7 +19,7 @@ public function can_view_login_page() { $this->get(route('login')) ->assertSuccessful() - ->assertSeeLivewire('auth.login'); + ->assertSeeLivewire(Login::class); } /** @test */ @@ -37,7 +38,7 @@ public function a_user_can_login() { $user = User::factory()->create(['password' => Hash::make('password')]); - Livewire::test('auth.login') + Livewire::test(Login::class) ->set('email', $user->email) ->set('password', 'password') ->call('authenticate'); @@ -50,7 +51,7 @@ public function is_redirected_to_the_home_page_after_login() { $user = User::factory()->create(['password' => Hash::make('password')]); - Livewire::test('auth.login') + Livewire::test(Login::class) ->set('email', $user->email) ->set('password', 'password') ->call('authenticate') @@ -62,7 +63,7 @@ public function email_is_required() { $user = User::factory()->create(['password' => Hash::make('password')]); - Livewire::test('auth.login') + Livewire::test(Login::class) ->set('password', 'password') ->call('authenticate') ->assertHasErrors(['email' => 'required']); @@ -73,7 +74,7 @@ public function email_must_be_valid_email() { $user = User::factory()->create(['password' => Hash::make('password')]); - Livewire::test('auth.login') + Livewire::test(Login::class) ->set('email', 'invalid-email') ->set('password', 'password') ->call('authenticate') @@ -85,7 +86,7 @@ public function password_is_required() { $user = User::factory()->create(['password' => Hash::make('password')]); - Livewire::test('auth.login') + Livewire::test(Login::class) ->set('email', $user->email) ->call('authenticate') ->assertHasErrors(['password' => 'required']); @@ -96,7 +97,7 @@ public function bad_login_attempt_shows_message() { $user = User::factory()->create(); - Livewire::test('auth.login') + Livewire::test(Login::class) ->set('email', $user->email) ->set('password', 'bad-password') ->call('authenticate') diff --git a/stubs/auth/tests/Feature/Auth/VerifyTest.php b/stubs/auth/tests/Feature/Auth/VerifyTest.php index bb989b0..c36fbb7 100644 --- a/stubs/auth/tests/Feature/Auth/VerifyTest.php +++ b/stubs/auth/tests/Feature/Auth/VerifyTest.php @@ -40,7 +40,7 @@ public function can_resend_verification_email() Livewire::test('auth.verify') ->call('resend') - ->assertEmitted('resent'); + ->assertDispatched('resent'); } /** @test */ diff --git a/stubs/default/postcss.config.cjs b/stubs/default/postcss.config.js similarity index 100% rename from stubs/default/postcss.config.cjs rename to stubs/default/postcss.config.js