Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change path and routes #132

Merged
merged 7 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php

namespace App\Http\Livewire\Auth;
namespace App\Livewire\Auth;

use App\Providers\RouteServiceProvider;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire\Auth\Passwords;
namespace App\Livewire\Auth\Passwords;

use Livewire\Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire\Auth\Passwords;
namespace App\Livewire\Auth\Passwords;

use Livewire\Component;
use Illuminate\Support\Facades\Password;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire\Auth\Passwords;
namespace App\Livewire\Auth\Passwords;

use App\Providers\RouteServiceProvider;
use Livewire\Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire\Auth;
namespace App\Livewire\Auth;

use App\Providers\RouteServiceProvider;
use App\Models\User;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire\Auth;
namespace App\Livewire\Auth;

use App\Providers\RouteServiceProvider;
use Illuminate\Support\Facades\Auth;
Expand All @@ -16,7 +16,7 @@ public function resend()

Auth::user()->sendEmailVerificationNotification();

$this->emit('resent');
$this->dispatch('resent');

session()->flash('resent');
}
Expand Down
12 changes: 6 additions & 6 deletions stubs/auth/routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down
15 changes: 8 additions & 7 deletions stubs/auth/tests/Feature/Auth/LoginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -18,7 +19,7 @@ public function can_view_login_page()
{
$this->get(route('login'))
->assertSuccessful()
->assertSeeLivewire('auth.login');
->assertSeeLivewire(Login::class);
}

/** @test */
Expand All @@ -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');
Expand All @@ -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')
Expand All @@ -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']);
Expand All @@ -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')
Expand All @@ -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']);
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion stubs/auth/tests/Feature/Auth/VerifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function can_resend_verification_email()

Livewire::test('auth.verify')
->call('resend')
->assertEmitted('resent');
->assertDispatched('resent');
}

/** @test */
Expand Down
File renamed without changes.