diff --git a/CLAUDE.md b/CLAUDE.md index 06b3b5f..0ff977e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -76,13 +76,14 @@ Plain HTML selects break the visual consistency of the UI. ## Pre-Commit Checks (MANDATORY) -Before every commit, run the relevant linters and fix any issues: +Before every commit, run the relevant checks and fix any issues: - **Python changes**: `cd server && ruff check src/ tests/ --fix` - **TypeScript changes**: `cd server && npx tsc --noEmit && npm run build` - **Both**: Run both checks +- **Always run tests**: `cd server && py -3.13 -m pytest tests/ --no-cov -q` — all tests MUST pass before committing. Do NOT commit code that fails tests. -Do NOT commit code that fails linting. Fix the issues first. +Do NOT commit code that fails linting or tests. Fix the issues first. ## General Guidelines diff --git a/server/src/wled_controller/storage/base_store.py b/server/src/wled_controller/storage/base_store.py index 6b2a2e0..7ba6c32 100644 --- a/server/src/wled_controller/storage/base_store.py +++ b/server/src/wled_controller/storage/base_store.py @@ -24,6 +24,12 @@ def freeze_saves() -> None: logger.info("Store saves frozen — awaiting server restart") +def unfreeze_saves() -> None: + """Re-enable store saves (used in tests to reset after restore flow).""" + global _saves_frozen + _saves_frozen = False + + class EntityNotFoundError(ValueError): """Raised when an entity is not found in the store.""" pass diff --git a/server/src/wled_controller/templates/modals/css-editor.html b/server/src/wled_controller/templates/modals/css-editor.html index 2a34ba5..9378ca8 100644 --- a/server/src/wled_controller/templates/modals/css-editor.html +++ b/server/src/wled_controller/templates/modals/css-editor.html @@ -381,9 +381,9 @@ -