Auth: convert auth views and verification email to Nova layout
This commit is contained in:
53
tests/Feature/Auth/OnboardingUxTest.php
Normal file
53
tests/Feature/Auth/OnboardingUxTest.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
it('shows onboarding progress and status on setup password page', function () {
|
||||
$user = User::factory()->create([
|
||||
'onboarding_step' => 'verified',
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->withSession(['status' => 'Email verified. Continue with password setup.'])
|
||||
->get('/setup/password')
|
||||
->assertOk()
|
||||
->assertSee('Email')
|
||||
->assertSee('Verified')
|
||||
->assertSee('Password')
|
||||
->assertSee('Username')
|
||||
->assertSee('Email verified. Continue with password setup.');
|
||||
});
|
||||
|
||||
it('shows onboarding progress and status on setup username page', function () {
|
||||
$user = User::factory()->create([
|
||||
'onboarding_step' => 'password',
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->withSession(['status' => 'Password saved. Choose your public username to finish setup.'])
|
||||
->get('/setup/username')
|
||||
->assertOk()
|
||||
->assertSee('Email')
|
||||
->assertSee('Verified')
|
||||
->assertSee('Password')
|
||||
->assertSee('Username')
|
||||
->assertSee('Password saved. Choose your public username to finish setup.');
|
||||
});
|
||||
|
||||
it('returns clear validation message for weak setup password', function () {
|
||||
$user = User::factory()->create([
|
||||
'onboarding_step' => 'verified',
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->from('/setup/password')
|
||||
->post('/setup/password', [
|
||||
'password' => 'short',
|
||||
'password_confirmation' => 'short',
|
||||
])
|
||||
->assertRedirect('/setup/password')
|
||||
->assertSessionHasErrors('password');
|
||||
});
|
||||
Reference in New Issue
Block a user