actingAs(User::factory()->create())->get('/')->assertOk(); $links = $this->dashboardWidget($response, 'core.quick-links')['links']; $this->assertCount(2, $links); $this->assertSame('/personen', $links[0]['url']); } 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'], ]); $links = $this->dashboardWidget($this->actingAs(User::factory()->create())->get('/'), 'core.quick-links')['links']; $this->assertSame('clock', $links[0]['icon']); $this->assertTrue($links[0]['new_tab']); $this->assertSame('#', $links[1]['url']); $this->assertSame('link', $links[1]['icon']); } 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()]); $response = $this->actingAs($me)->get('/'); $people = $this->dashboardWidget($response, 'core.new-colleagues')['people']; $this->assertCount(1, $people); $this->assertSame($new->id, $people[0]['id']); $this->assertSame(3, $this->dashboardWidget($response, 'core.people-search')['count']); } 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); } }