Skip to content

Add component tests for MarkdownRenderer and BooksView#30

Merged
catherineluse merged 1 commit into
mainfrom
test-components
Jul 16, 2026
Merged

Add component tests for MarkdownRenderer and BooksView#30
catherineluse merged 1 commit into
mainfrom
test-components

Conversation

@gennitdev

Copy link
Copy Markdown
Owner

Summary

Starts growing .vue component coverage using the jsdom + @vue/test-utils harness.

Stacked on #26 (flaky-test fix); its two test-file changes show here until #26 merges.

Component Before After
components/MarkdownRenderer.vue 0% ~90%
views/BooksView.vue 0% ~84%

MarkdownRenderer.spec.ts

Pure presentational component — markdown → HTML, fontSize class mapping, heading anchor ids/links, image max-height injection, code highlighting, readingLayout class, and wiki-link conversion (enabled vs disabled).

BooksView.spec.ts

Mocks useBooks/useImageLibrary/vue-router: load-on-mount, empty state, list rendering, click-to-navigate (router.push), cover-load error handling, and the create-book modal form (title → auto-generated id → createBook).

Testing

npm run lint, type-check, and vitest run pass (Node 22). Full suite: 291 tests across 32 files.

🤖 Generated with Claude Code

- MarkdownRenderer: markdown rendering, fontSize class mapping, heading
  anchors, image max-height injection, code highlighting, reading-layout
  class, and wiki-link conversion (enabled/disabled). ~90% coverage.
- BooksView: load-on-mount, empty state, book-list rendering, click-to-
  navigate, cover-load error handling, and the create-book modal flow
  (auto-generated id). ~84% coverage.

Both use the jsdom + @vue/test-utils harness with mocked composables/
router.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-beta-reader-frontend Ready Ready Preview, Comment Jul 16, 2026 6:39am

Request Review

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@catherineluse
catherineluse merged commit e967369 into main Jul 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants