test(app): broaden frontend coverage (batch 1) — api, sanitize, shortcuts, editor #44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test/app-coverage-batch-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First batch of broader app-side test coverage. The recent tiptap v3 migration landed against a frontend with essentially one test (
App.test.tsx), so a breaking change in core UI logic could only be caught bytsc, not behaviour. This starts closing that gap, prioritising the security-relevant and logic-heavy units that had zero coverage.1 test → 28 tests across 5 files.
What's covered
lib/api.tscredentialswiring, JSON body serialization,ApiError(status + body-error message,statusTextfallback), and the204 → undefinedpath.lib/sanitize.tsdangerouslySetInnerHTMLban — asserts it strips all tags/attrs/scripts and neutralizesjavascript:links while keeping text.lib/shortcuts.tsdestroy()teardown.MarkdownEditor.tsx**bold**→<strong>, safe-URL link →<a href>), and verifies external value changes sync viasetContentwithout emittingonChange(the{ emitUpdate: false }fix).Notes
App.test.tsx(vitest globals, jsdom,@testing-library). No new deps, no production-code changes.MarkdownEditortest is the permanent version of the throwaway smoke test from the tiptap PR (#43) — future tiptap bumps now have a real safety net.This is intended as the first of a few batches — natural follow-ups are the
useAuth/useOfflineQueue/useThemehooks and a couple of the higher-traffic pages.🤖 Generated with Claude Code