Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 1m3s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 1m16s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 1m20s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m29s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m33s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m28s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m33s
CI / Build-Artefakte aktuell (pull_request) Failing after 52s
- Nüchterne, professionelle Optik: neutrale Flächen, Markenfarbe nur als Akzent, Inter-Schrift (lokal) - Zweizeiliger Header mit Suche, Hauptnavigation und Avatar-Menü - Startseite mit Begrüßungskarte, Schnellzugriffen und „Neu im Team“ - Personenverzeichnis mit Suche, Abteilungsfilter und Seitenaufteilung - Markenfarbe exakt übernommen, Abstufungen serverseitig in OKLCH (ColorPalette) – gemeinsam für Portal und Admin, keine Farbberechnung im Browser - Schnellzugriffe im Admin pflegbar - Filament-Avatare lokal statt über ui-avatars.com (DSGVO) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
72 lines
2.4 KiB
PHP
72 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Models\User;
|
|
use App\Support\Settings;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Inertia\Testing\AssertableInertia as Assert;
|
|
use Tests\TestCase;
|
|
|
|
class DashboardTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_dashboard_shows_default_quick_links(): void
|
|
{
|
|
$this->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);
|
|
}
|
|
}
|