actingAs(User::factory()->create()) ->get('/') ->assertInertia(fn (Assert $page) => $page ->has('quickLinks', 2) ->where('quickLinks.0.url', '/personen')); } public function test_configured_quick_links_are_sanitized(): void { app(Settings::class)->set('portal.quick_links', [ ['label' => 'Zeiterfassung', 'url' => 'https://zeit.example.com', 'icon' => 'clock', 'new_tab' => true], ['label' => 'Böse', 'url' => 'javascript:alert(1)', 'icon' => 'unbekannt'], ]); $this->actingAs(User::factory()->create()) ->get('/') ->assertInertia(fn (Assert $page) => $page ->where('quickLinks.0.icon', 'clock') ->where('quickLinks.0.new_tab', true) ->where('quickLinks.1.url', '#') ->where('quickLinks.1.icon', 'link')); } public function test_new_colleagues_exclude_self_inactive_and_old_accounts(): void { $me = User::factory()->create(); $new = User::factory()->create(); User::factory()->inactive()->create(); User::factory()->create(['created_at' => now()->subYear()]); $this->actingAs($me) ->get('/') ->assertInertia(fn (Assert $page) => $page ->has('newColleagues.data', 1) ->where('newColleagues.data.0.id', $new->id) ->where('peopleCount', 3)); } public function test_brand_colors_are_rendered_as_css_variables(): void { app(Settings::class)->set('branding.primary_color', '#E20074'); $this->actingAs(User::factory()->create()) ->get('/') ->assertSee('--brand:#E20074', false) ->assertSee('--brand-600:#E20074', false) ->assertSee('--brand-foreground:#FFFFFF', false); } public function test_dark_theme_is_applied_server_side(): void { $this->actingAs(User::factory()->create(['theme' => 'dark'])) ->get('/') ->assertSee('class="dark"', false); } }