standard colours

This commit is contained in:
Mark Gregory
2026-06-23 15:32:05 +01:00
parent 3be4ff590f
commit a8cbb8e2ac
19 changed files with 330 additions and 56 deletions
@@ -97,7 +97,7 @@ final class SettingsCrudTest extends TestCase
->set('projectForm.team_id', $fixtures['team']->id)
->set('projectForm.title', 'Customer Portal')
->set('projectForm.slug', 'customer-portal')
->set('projectForm.color', 'cyan')
->set('projectForm.color', 'blue')
->call('saveProject')
->assertHasNoErrors();
$project = Project::query()->where('slug', 'customer-portal')->firstOrFail();
@@ -223,7 +223,7 @@ final class SettingsCrudTest extends TestCase
Livewire::test(SettingsManager::class)
->set('tagForm.name', 'VIP')
->set('tagForm.slug', 'vip')
->set('tagForm.color', 'pink')
->set('tagForm.color', 'purple')
->call('saveTag')
->assertHasNoErrors();
$tag = Tag::query()->where('slug', 'vip')->firstOrFail();
@@ -248,4 +248,22 @@ final class SettingsCrudTest extends TestCase
->assertHasNoErrors();
$this->assertDatabaseHas('helpdesk_products', ['id' => $product->id, 'version' => '1.1']);
}
public function test_helpdesk_colour_selectors_are_dropdowns_and_reject_unknown_values(): void
{
$this->seedLookupData();
$admin = $this->admin(['name' => 'Colour Settings Admin']);
$this->actingAs($admin);
Livewire::test(SettingsManager::class)
->assertSee('● Red — #dc2626')
->assertSee('● Green — #16a34a')
->set('statusForm.name', 'Invalid Colour')
->set('statusForm.slug', 'invalid-colour')
->set('statusForm.color', 'brown')
->set('statusForm.sort_order', 99)
->call('saveStatus')
->assertHasErrors(['statusForm.color']);
}
}