['view' => 'livewire.dashboard.placeholder', 'marker' => 'dashboard-skeleton'], SubjectsIndex::class => ['view' => 'livewire.subjects.placeholder', 'marker' => 'subjects-skeleton'], TasksIndex::class => ['view' => 'livewire.tasks.placeholder', 'marker' => 'tasks-skeleton'], PhotoHelpIndex::class => ['view' => 'livewire.photo-help.placeholder', 'marker' => 'photo-help-skeleton'], RewardsIndex::class => ['view' => 'livewire.rewards.placeholder', 'marker' => 'rewards-skeleton'], ProgressIndex::class => ['view' => 'livewire.progress.placeholder', 'marker' => 'progress-skeleton'], NotificationsIndex::class => ['view' => 'livewire.notifications.placeholder', 'marker' => 'notifications-skeleton'], SettingsIndex::class => ['view' => 'livewire.settings.placeholder', 'marker' => 'settings-skeleton'], ]; foreach ($placeholderMap as $class => $meta) { it("{$class} returns its OWN placeholder view ({$meta['view']})", function () use ($class, $meta) { $view = $class::placeholder([]); expect($view->getName())->toBe($meta['view']); }); it("placeholder for {$class} has unique data-testid (\"{$meta['marker']}\")", function () use ($class, $meta) { $html = $class::placeholder([])->render(); expect($html)->toContain($meta['marker']); }); } it('photo-help placeholder pre-declares Alpine x-data with preview state', function () { // Fixes "Alpine Expression Error: preview is not defined" during Lazy // hydration — placeholder must mount the same x-data scope as the real view. $html = PhotoHelpIndex::placeholder([])->render(); expect($html)->toContain('x-data'); expect($html)->toContain('preview'); }); it('skeleton blade components exist for composition', function () { foreach (['stat-tile', 'subject-card', 'table-row', 'header', 'card'] as $component) { $path = "resources/views/components/skeleton/{$component}.blade.php"; expect(file_exists(base_path($path)))->toBeTrue("Missing skeleton component: {$path}"); } });