Let the admin choose one of eight colour profiles
linter / quality (push) Successful in 1m3s
tests / ci (8.5) (push) Successful in 2m8s
docker / test (8.5) (push) Successful in 2m15s
docker / build-and-push (push) Failing after 7m22s
docker / release (push) Skipped

Indigo (the default), Blue, Teal, Green, Amber, Rose and Violet in the
Vibrant style and Graphite in the Neutral style are generated from
config into the stylesheet. Admin settings opens with a colour profile
card: a swatch previews the profile on the page, and Save Settings
stores it as color_profile, which AppServiceProvider hands to the
package's resolver, so every page, mail and error page wears it. An
unknown profile is refused, and a saved one that disappears falls back
to indigo.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V9NnLxnPp8vaaurb3Z1MFy
This commit is contained in:
Andreas Reinhold / reini
2026-09-13 15:06:47 +02:00
co-authored by Claude Opus 5
parent 27e322c352
commit 21bea9646d
21 changed files with 2645 additions and 12 deletions
+29
View File
@@ -128,3 +128,32 @@ test('admin can remove the logo through its dialog', function () {
expect(Setting::get('site_logo'))->toBeNull();
Storage::disk('public')->assertMissing($path);
});
test('admin chooses the colour profile, starting from the saved one', function () {
$admin = User::query()->where('is_admin', true)->first();
Livewire::actingAs($admin)
->test(AdminSettings::class)
->assertSet('colorProfile', 'indigo')
->set('colorProfile', 'teal')
->call('saveSettings')
->assertHasNoErrors();
expect(Setting::get('color_profile'))->toBe('teal');
Livewire::actingAs($admin)
->test(AdminSettings::class)
->assertSet('colorProfile', 'teal');
});
test('a colour profile that was not generated is refused', function () {
$admin = User::query()->where('is_admin', true)->first();
Livewire::actingAs($admin)
->test(AdminSettings::class)
->set('colorProfile', 'ocean')
->call('saveSettings')
->assertHasErrors(['colorProfile' => 'in']);
expect(Setting::get('color_profile'))->toBeNull();
});