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 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from inkwell.colors import NOTE_COLORS
|
||||||
from inkwell.notes.checklist import parse_items, render_item
|
from inkwell.notes.checklist import parse_items, render_item
|
||||||
from inkwell.notes.helpers import derive_display_title
|
from inkwell.notes.helpers import derive_display_title
|
||||||
from inkwell.notes.recurrence import REMINDER_RECURRENCES
|
from inkwell.notes.recurrence import REMINDER_RECURRENCES
|
||||||
@@ -52,3 +53,9 @@ def test_display_titles(case):
|
|||||||
|
|
||||||
def test_recurrences():
|
def test_recurrences():
|
||||||
assert REMINDER_RECURRENCES == set(FIXTURE["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"]}
|
||||||
|
|||||||
Reference in New Issue
Block a user