24-9: auth pages type and controls — implemented, QA Review

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Naser Mansour
2026-10-31 18:55:09 +02:00
parent 2c068277a2
commit 01ff077a5c
8 changed files with 82 additions and 5 deletions
@@ -0,0 +1,45 @@
<?php
use App\Models\User;
test('auth pages load the public stylesheet and the site-auth body class but no public script', function () {
foreach (['/login', '/forgot-password'] as $url) {
$html = $this->get($url)->assertOk()->getContent();
expect($html)
->toContain('class="site-auth')
->toMatch('~build/assets/public-[\w-]+\.css~')
->not->toMatch('~build/assets/public-[\w-]+\.js~')
->toContain('Markazi+Text');
expect($html)->not->toContain('style="font-family: var(--font-');
}
});
test('all three auth layouts include the fonts, the stylesheet and the body class', function () {
foreach (['split', 'card', 'simple'] as $layout) {
$src = file_get_contents(resource_path("views/components/layouts/auth/$layout.blade.php"));
expect($src)
->toContain("@include('partials.site-fonts')")
->toContain("@vite(['resources/css/public.css'])")
->toContain('site-auth')
->not->toContain('style="font-family: var(--font-');
}
});
test('the auth styles are scoped under body.site-auth', function () {
$css = file_get_contents(resource_path('css/public.css'));
expect($css)
->toContain('body.site-auth{')
->toContain('body.site-auth input[type=email]')
->toContain('body.site-auth button[type=submit]')
->toContain('border-radius:999px');
});
test('dashboards carry neither the stylesheet nor site-auth', function () {
foreach ([[User::factory()->admin()->create(), '/admin/dashboard'], [User::factory()->individual()->create(), '/client/dashboard']] as [$user, $url]) {
$html = $this->actingAs($user)->get($url)->assertOk()->getContent();
expect($html)->not->toContain('public.css')->not->toContain('site-auth');
}
});