feat: Phase 2 - admin layout, dashboard, page CRUD, subscribers, user management

This commit is contained in:
2026-04-03 20:09:20 +02:00
parent 904cf1241b
commit 78e1be3e3b
27 changed files with 404 additions and 33 deletions

View File

@@ -27,7 +27,7 @@ class AuthenticationTest extends TestCase
]);
$this->assertAuthenticated();
$response->assertRedirect(route('dashboard', absolute: false));
$response->assertRedirect(route('admin.dashboard', absolute: false));
}
public function test_users_can_not_authenticate_with_invalid_password(): void

View File

@@ -38,7 +38,7 @@ class EmailVerificationTest extends TestCase
Event::assertDispatched(Verified::class);
$this->assertTrue($user->fresh()->hasVerifiedEmail());
$response->assertRedirect(route('dashboard', absolute: false).'?verified=1');
$response->assertRedirect(route('admin.dashboard', absolute: false).'?verified=1');
}
public function test_email_is_not_verified_with_invalid_hash(): void

View File

@@ -17,7 +17,7 @@ class PasswordUpdateTest extends TestCase
$response = $this
->actingAs($user)
->from('/profile')
->from('/admin/profile')
->put('/password', [
'current_password' => 'password',
'password' => 'new-password',
@@ -26,7 +26,7 @@ class PasswordUpdateTest extends TestCase
$response
->assertSessionHasNoErrors()
->assertRedirect('/profile');
->assertRedirect('/admin/profile');
$this->assertTrue(Hash::check('new-password', $user->refresh()->password));
}
@@ -37,7 +37,7 @@ class PasswordUpdateTest extends TestCase
$response = $this
->actingAs($user)
->from('/profile')
->from('/admin/profile')
->put('/password', [
'current_password' => 'wrong-password',
'password' => 'new-password',
@@ -46,6 +46,6 @@ class PasswordUpdateTest extends TestCase
$response
->assertSessionHasErrorsIn('updatePassword', 'current_password')
->assertRedirect('/profile');
->assertRedirect('/admin/profile');
}
}

View File

@@ -26,6 +26,6 @@ class RegistrationTest extends TestCase
]);
$this->assertAuthenticated();
$response->assertRedirect(route('dashboard', absolute: false));
$response->assertRedirect(route('admin.dashboard', absolute: false));
}
}

View File

@@ -16,7 +16,7 @@ class ProfileTest extends TestCase
$response = $this
->actingAs($user)
->get('/profile');
->get('/admin/profile');
$response->assertOk();
}
@@ -27,14 +27,14 @@ class ProfileTest extends TestCase
$response = $this
->actingAs($user)
->patch('/profile', [
->patch('/admin/profile', [
'name' => 'Test User',
'email' => 'test@example.com',
]);
$response
->assertSessionHasNoErrors()
->assertRedirect('/profile');
->assertRedirect('/admin/profile');
$user->refresh();
@@ -49,14 +49,14 @@ class ProfileTest extends TestCase
$response = $this
->actingAs($user)
->patch('/profile', [
->patch('/admin/profile', [
'name' => 'Test User',
'email' => $user->email,
]);
$response
->assertSessionHasNoErrors()
->assertRedirect('/profile');
->assertRedirect('/admin/profile');
$this->assertNotNull($user->refresh()->email_verified_at);
}
@@ -67,7 +67,7 @@ class ProfileTest extends TestCase
$response = $this
->actingAs($user)
->delete('/profile', [
->delete('/admin/profile', [
'password' => 'password',
]);
@@ -85,14 +85,14 @@ class ProfileTest extends TestCase
$response = $this
->actingAs($user)
->from('/profile')
->delete('/profile', [
->from('/admin/profile')
->delete('/admin/profile', [
'password' => 'wrong-password',
]);
$response
->assertSessionHasErrorsIn('userDeletion', 'password')
->assertRedirect('/profile');
->assertRedirect('/admin/profile');
$this->assertNotNull($user->fresh());
}