From 3766d59b2eda5b90902f9f5d68220c67041de0fb Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 8 Oct 2026 14:28:43 -0400 Subject: [PATCH] The server's palette is checked against the shared fixture's hues The web already checked its tint keys against grammar.json; the server's NOTE_COLORS, which normalize_color accepts, had no such guard. It is now the fixture's hues plus "default". The core has no palette to check: it stores whatever the UI (which only offers palette keys) or the server sends. DRY pass #2, batch 3 (#5372). Co-Authored-By: Claude Opus 5.5 --- tests/test_grammar_fixture.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_grammar_fixture.py b/tests/test_grammar_fixture.py index 84dec3d..89091ef 100644 --- a/tests/test_grammar_fixture.py +++ b/tests/test_grammar_fixture.py @@ -12,6 +12,7 @@ from pathlib import Path import pytest +from inkwell.colors import NOTE_COLORS from inkwell.notes.checklist import parse_items, render_item from inkwell.notes.helpers import derive_display_title from inkwell.notes.recurrence import REMINDER_RECURRENCES @@ -52,3 +53,9 @@ def test_display_titles(case): def test_recurrences(): assert REMINDER_RECURRENCES == set(FIXTURE["recurrences"]) + + +def test_palette_keys(): + """The palette the server accepts is the fixture's hues plus `default`, the key + unrecognised input lands on. The web checks the same hues (DERIVED_TINT_KEYS).""" + assert NOTE_COLORS == {"default", *FIXTURE["tint"]["keys"]}