toBeTrue("Missing logo asset: {$f}"); } }); it('PWA icons exist in public/icons', function () { $base = base_path('public/icons'); foreach (['icon-192.png', 'icon-512.png', 'icon-512-maskable.png', 'apple-touch-icon.png', 'favicon-16.png', 'favicon-32.png'] as $f) { expect(File::exists("{$base}/{$f}"))->toBeTrue("Missing PWA icon: {$f}"); } }); it('PWA icon-192 is a real PNG (>= 4KB), not empty stub', function () { $size = filesize(base_path('public/icons/icon-192.png')); expect($size)->toBeGreaterThan(4000, "icon-192.png too small ({$size} bytes) — looks like empty stub"); }); it('PWA manifest exists, has icons array', function () { $path = base_path('public/manifest.webmanifest'); expect(File::exists($path))->toBeTrue('manifest.webmanifest missing'); $manifest = json_decode(File::get($path), true); expect($manifest)->toBeArray(); expect($manifest)->toHaveKeys(['name', 'short_name', 'icons']); expect($manifest['icons'])->toBeArray()->not->toBeEmpty(); }); it('brand component template exists', function () { expect(File::exists(base_path('resources/views/components/layout/brand.blade.php')))->toBeTrue(); }); it('brand component default variant renders icon + wordmark text', function () { $html = view('components.layout.brand')->render(); expect($html)->toContain('lernschiff-icon.svg'); expect($html)->toContain('Lernschiff'); expect($html)->toContain('aria-label="Lernschiff Home"'); }); it('brand component wordmark variant renders wordmark SVG', function () { $html = view('components.layout.brand', ['variant' => 'wordmark'])->render(); expect($html)->toContain('lernschiff-wordmark.svg'); }); it('brand component icon-only variant renders just icon', function () { $html = view('components.layout.brand', ['variant' => 'icon-only'])->render(); expect($html)->toContain('lernschiff-icon.svg'); expect($html)->not->toContain('lernschiff-wordmark.svg'); }); it('dashboard layout references favicon SVG + manifest', function () { $tpl = file_get_contents(base_path('resources/views/layouts/dashboard.blade.php')); expect($tpl)->toContain('logo/favicon.svg'); expect($tpl)->toContain('manifest.webmanifest'); expect($tpl)->toContain('apple-touch-icon'); }); it('guest layout references favicon SVG + manifest', function () { $tpl = file_get_contents(base_path('resources/views/layouts/guest.blade.php')); expect($tpl)->toContain('logo/favicon.svg'); expect($tpl)->toContain('manifest.webmanifest'); });