From 194b21f618bc7d021a6260ae285463ce29b170dd Mon Sep 17 00:00:00 2001 From: Bhargav Raviya Date: Sun, 30 Jul 2023 20:52:20 +0530 Subject: [PATCH 1/7] change path and routes --- stubs/auth/app/{Http => }/Livewire/Auth/Login.php | 2 +- .../{Http => }/Livewire/Auth/Passwords/Confirm.php | 2 +- .../app/{Http => }/Livewire/Auth/Passwords/Email.php | 2 +- .../app/{Http => }/Livewire/Auth/Passwords/Reset.php | 2 +- stubs/auth/app/{Http => }/Livewire/Auth/Register.php | 2 +- stubs/auth/app/{Http => }/Livewire/Auth/Verify.php | 2 +- stubs/auth/routes/web.php | 12 ++++++------ 7 files changed, 12 insertions(+), 12 deletions(-) rename stubs/auth/app/{Http => }/Livewire/Auth/Login.php (96%) rename stubs/auth/app/{Http => }/Livewire/Auth/Passwords/Confirm.php (91%) rename stubs/auth/app/{Http => }/Livewire/Auth/Passwords/Email.php (95%) rename stubs/auth/app/{Http => }/Livewire/Auth/Passwords/Reset.php (97%) rename stubs/auth/app/{Http => }/Livewire/Auth/Register.php (97%) rename stubs/auth/app/{Http => }/Livewire/Auth/Verify.php (93%) diff --git a/stubs/auth/app/Http/Livewire/Auth/Login.php b/stubs/auth/app/Livewire/Auth/Login.php similarity index 96% rename from stubs/auth/app/Http/Livewire/Auth/Login.php rename to stubs/auth/app/Livewire/Auth/Login.php index 681c7fe..2578892 100644 --- a/stubs/auth/app/Http/Livewire/Auth/Login.php +++ b/stubs/auth/app/Livewire/Auth/Login.php @@ -1,6 +1,6 @@ Date: Sun, 30 Jul 2023 21:04:13 +0530 Subject: [PATCH 2/7] missing file name extension --- stubs/default/{postcss.config.cjs => postcss.config.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename stubs/default/{postcss.config.cjs => postcss.config.js} (100%) 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 From 2c402d4b93d25d85b7e51b57a438032ef192777e Mon Sep 17 00:00:00 2001 From: Bhargav Raviya Date: Mon, 31 Jul 2023 21:58:55 +0530 Subject: [PATCH 3/7] change in test case --- stubs/auth/tests/Feature/Auth/VerifyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ From c23a569703f6a137d4ec806168cca721ad99aca2 Mon Sep 17 00:00:00 2001 From: Bhargav Raviya Date: Mon, 31 Jul 2023 22:02:47 +0530 Subject: [PATCH 4/7] change verify file --- stubs/auth/app/Livewire/Auth/Verify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/auth/app/Livewire/Auth/Verify.php b/stubs/auth/app/Livewire/Auth/Verify.php index 4a1a5be..b8f0af3 100644 --- a/stubs/auth/app/Livewire/Auth/Verify.php +++ b/stubs/auth/app/Livewire/Auth/Verify.php @@ -16,7 +16,7 @@ public function resend() Auth::user()->sendEmailVerificationNotification(); - $this->emit('resent'); + $this->dispatch('resent'); session()->flash('resent'); } From dc7cf101772600c29dd426154e73348684c4dca3 Mon Sep 17 00:00:00 2001 From: Bhargav Raviya Date: Mon, 31 Jul 2023 22:19:39 +0530 Subject: [PATCH 5/7] remove route service provider --- stubs/auth/app/Livewire/Auth/Login.php | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/auth/app/Livewire/Auth/Login.php b/stubs/auth/app/Livewire/Auth/Login.php index 2578892..67c7e66 100644 --- a/stubs/auth/app/Livewire/Auth/Login.php +++ b/stubs/auth/app/Livewire/Auth/Login.php @@ -2,7 +2,6 @@ namespace App\Livewire\Auth; -use App\Providers\RouteServiceProvider; use Illuminate\Support\Facades\Auth; use Livewire\Component; From bacc052525dccebbe879e934c1798304d7dd1df3 Mon Sep 17 00:00:00 2001 From: Bhargav Raviya Date: Sat, 2 Sep 2023 12:29:55 +0530 Subject: [PATCH 6/7] change in test case --- stubs/auth/tests/Feature/Auth/LoginTest.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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') From 2c8ec7f5c719e66821154c1e65b9464ce983601d Mon Sep 17 00:00:00 2001 From: Bhargav Raviya <46953122+bhargavraviya@users.noreply.github.com> Date: Fri, 20 Oct 2023 14:39:43 +0530 Subject: [PATCH 7/7] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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