🧪 Add comprehensive testing for settings.ts - #121
Conversation
- Adds loadSettingsModule to load-plugin-modules.mjs - Stubs PluginSettingTab and Setting for Obsidian plugin load context - Adds comprehensive unit tests for zoom formatting, theme preference resolution, and settings merging in settings.test.mjs
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Adds loadSettingsModule to load-plugin-modules.mjs - Stubs PluginSettingTab and Setting for Obsidian plugin load context - Adds comprehensive unit tests for zoom formatting, theme preference resolution, and settings merging in settings.test.mjs - Fixes check-docx-runtime provenance sync error where missing files on disk failed the sync step
🎯 What: The testing gap addressed
The issue identified a missing test file for
src/settings.ts. I addedtests/settings.test.mjsand extended the test build helper (tests/helpers/load-plugin-modules.mjs) to load it.📊 Coverage: What scenarios are now tested
Tests coverage includes:
normalizeDefaultZoomvalid bounds, min/max limits, invalid inputs.formatZoompercentage conversion.normalizeEditorThemePreferenceparsing and invalid fallbacks.resolveEditorThemePreferencemapping to light/dark themes dynamically based on system themes.mergeNativePowerPointDocEditorSettingsbehavior covering empty initial inputs, legacy migrations, and correctly signaling when persistence is needed.✨ Result: The improvement in test coverage
src/settings.tsis now covered effectively and regressions involving invalid types breaking settings load/save loops will be caught immediately.PR created automatically by Jules for task 3351562614975615799 started by @MarsLuay