Convert epub viewer bar unit tests to Vue Testing Library
🙂 Looking for an issue? Welcome! This issue is open for contribution. If this is the first time you’re requesting an issue, please:
- Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that don’t follow the guidelines won’t be answered.
- Confirm that you’ve read the guidelines in your comment.
Overview
Complexity: Low
Context
The test suites for the epub viewer's top and bottom bar components (BottomBar.spec.js, TopBar.spec.js) currently use @vue/test-utils, which couples tests to component internals. This makes them brittle — they break when implementation changes even if user-facing behavior remains correct.
Related page:
The Change
Refactor these test files to use Vue Testing Library (VTL) and write tests that reflect how a user interacts with the epub reader bars:
kolibri/plugins/epub_viewer/frontend/views/__tests__/BottomBar.spec.jskolibri/plugins/epub_viewer/frontend/views/__tests__/TopBar.spec.js
Do not refactor any other test files or areas of the codebase.
How to Get There
- Sign in to Kolibri
- Go to Learn > Library
- Open any epub/document content (e.g., from the QA Channel)
- The TopBar appears at the top of the reader (TOC, settings, search, fullscreen buttons) and the BottomBar at the bottom (progress slider)
Acceptance Criteria
- [ ]
BottomBar.spec.jsandTopBar.spec.jsmigrated to use@testing-library/vue - [ ] No residual
@vue/test-utilsimports in migrated files - [ ] Cover all major workflows while avoiding excessive testing of details
- [ ] Concise but explicit test descriptions that describe what's tested from a user point of view
- [ ] Follow Testing Library principles and Testing Library query priority recommendation
- [ ] Use patterns consistent with existing VTL test suites (search for
from '@testing-library/vue') - [ ] All migrated tests pass:
pnpm run test-jest -- --testPathPattern epub_viewer
References
- Reference VTL test:
packages/kolibri-common/components/userAccounts/__tests__/GenderSelect.spec.js - Testing Library query priority
🤖 This issue was written with AI assistance, under supervision, review and final edits by @rtibbles 🤖
Hi @rtibbles, if the other issue is being assigned to @AadarshM07, Id be happy to give this one a try.
Hi @rtibbles,
I would like to request the opportunity to work on this issue. I am currently going through the codebase and getting familiar with it. I feel confident that I can take this up, and this would be my first contribution to the organization.
Please consider assigning this to me. Thank you!
hi @rtibbles, can i work on this one?
Hi @rtibbles, I've been exploring the epub_viewer plugin in my local dev environment and would like to help with the migration to Vue Testing Library. Could you please assign this to me?
Thanks all. Will assign @sharma-anushka.
Hi @rtibbles, implementation is complete. You may have a look.