Files
Aniworld/tests
Lukas 8174cf73c4 feat(tests): Add comprehensive user preferences unit tests
- Created tests/unit/test_user_preferences.js with 68 unit tests
- Updated instructions.md to mark i18n complete and track preferences

Coverage:
- Loading preferences: 5 tests (localStorage, empty object, invalid JSON, errors, application)
- Saving preferences: 5 tests (save, overwrite, errors, null/undefined handling)
- Getting preferences: 4 tests (retrieve, empty, parse errors, immutability)
- Applying preferences: 6 tests (theme, language, multiple, empty, partial)
- Updating preference: 5 tests (single, existing, new, apply, persist)
- Resetting preferences: 3 tests (remove, graceful, errors)
- Persistence: 3 tests (theme, language, multiple across sessions)
- Edge cases: 8 tests (large objects, special chars, types, nested, arrays, rapid)
- Default preferences: 2 tests (empty default, no application)
- Storage key: 2 tests (correct key, no interference)

Features validated:
- localStorage save/load/remove operations
- JSON parse/stringify with error handling
- Document attribute application (data-theme, lang)
- Individual preference updates
- Preference persistence across sessions
- Graceful error handling
- Support for various data types (string, number, boolean, object, array)

Note: Requires Node.js/npm installation to run (see FRONTEND_SETUP.md)
TIER 4 task 2/4 complete
2026-02-01 11:40:17 +01:00
..
2025-12-23 18:13:10 +01:00
2025-11-15 12:35:51 +01:00