Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 14m38s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 14m13s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 11m56s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 11m44s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 56m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 1h2m6s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m30s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 47s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m13s
Einstellung interface (classic|app) im Erscheinungsbild; data-ui am Wurzelelement, warme Tokens, Karten mit Schatten, Menüpunkte als Pillen; Startseite dreispaltig. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
64 lines
2.1 KiB
PHP
64 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Dashboard\Homepage;
|
|
use App\Models\User;
|
|
use App\Support\Theme\Theme;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class InterfaceSwitchTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
private function publish(array $values): array
|
|
{
|
|
$theme = app(Theme::class);
|
|
$theme->saveDraft($values);
|
|
app()->call([$theme, 'publish']);
|
|
|
|
return $theme->published();
|
|
}
|
|
|
|
public function test_switching_to_the_app_takes_matching_font_and_corners(): void
|
|
{
|
|
$published = $this->publish(['interface' => 'app']);
|
|
|
|
$this->assertSame('app', $published['interface']);
|
|
$this->assertSame('figtree', $published['font_body']);
|
|
$this->assertSame('round', $published['radius']);
|
|
|
|
// Zurück: wieder die Voreinstellung der klassischen Oberfläche
|
|
$published = $this->publish(['interface' => 'classic']);
|
|
$this->assertSame('inter', $published['font_body']);
|
|
$this->assertSame('medium', $published['radius']);
|
|
}
|
|
|
|
public function test_own_font_choice_survives_the_switch(): void
|
|
{
|
|
$this->publish(['font_body' => 'lora', 'radius' => 'small']);
|
|
$published = $this->publish(['interface' => 'app']);
|
|
|
|
$this->assertSame('lora', $published['font_body']);
|
|
$this->assertSame('small', $published['radius']);
|
|
}
|
|
|
|
public function test_page_carries_the_interface_and_the_app_uses_the_tile_start_page(): void
|
|
{
|
|
$this->publish(['interface' => 'app']);
|
|
app(Homepage::class)->setMode('builder');
|
|
|
|
$response = $this->actingAs(User::factory()->create())->get('/');
|
|
|
|
$response->assertOk()->assertSee('data-ui="app"', false);
|
|
$response->assertInertia(fn ($page) => $page->where('branding.interface', 'app')->has('widgets')->missing('content'));
|
|
}
|
|
|
|
public function test_classic_is_the_default(): void
|
|
{
|
|
$this->actingAs(User::factory()->create())->get('/')
|
|
->assertSee('data-ui="classic"', false)
|
|
->assertInertia(fn ($page) => $page->where('branding.interface', 'classic'));
|
|
}
|
|
}
|