Convert epub viewer table of contents 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 table of contents functionality (TocButton.spec.js, TableOfContentsSection.spec.js, TableOfContentsSectionSideBar.spec.js) currently use @vue/test-utils, which couples tests to component internals.
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 table of contents:
kolibri/plugins/epub_viewer/frontend/views/__tests__/TocButton.spec.jskolibri/plugins/epub_viewer/frontend/views/__tests__/TableOfContentsSection.spec.jskolibri/plugins/epub_viewer/frontend/views/__tests__/TableOfContentsSectionSideBar.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 TOC button (list icon) appears at the left of the TopBar; clicking it opens the table of contents sidebar
Acceptance Criteria
- [ ]
TocButton.spec.js,TableOfContentsSection.spec.js, andTableOfContentsSectionSideBar.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,
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, assigning @Satish-2004
Thanks
@MisRob if there is no update yet , can i work on this issue? I already worked on the similar issue before , and completed the assigned two issues of the same parent issue
Hi @Satish-2004 , just checking in if are you still working on this or need any help? I recently completed the VTL migration for the epub viewer navigation tests and the user auth layout tests, so I 'm fairly familiar with the migration patterns for this codebase. Happy to pick this up or help out if needed!
Hi, I would like to take this one up, if noones active on it.
Hi! 👋
Thanks so much for your interest! This issue is already assigned. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. If there are no unassigned 'help wanted' issues available, please wait until new ones are added.
We really appreciate your willingness to help. 😊
Are you preparing for Google Summer of Code? See our GSoC guidelines.
Thanks @curiouscoder-cmd for your interest. I have tried but was not able to solve this issue. I am requesting the maintainers to transfer this issue to someone else, as I am currently leaving this task.
@MisRob @rtibbles I would love to take this one up, since @Satish-2004 has asked for re-assignment.
Hi! 👋
Thanks so much for your interest! This issue is already assigned. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. If there are no unassigned 'help wanted' issues available, please wait until new ones are added.
We really appreciate your willingness to help. 😊
Are you preparing for Google Summer of Code? See our GSoC guidelines.
Hi, Just wanted a follow-up if it's open for re-assignment, as Satish already told me he is not continuing. Thanks.
Sorry this has slipped my attention. I will re-assign. Thanks all.
Sorry this has slipped my attention. I will re-assign. Thanks all.
no problem , thanks for reassigning! I'll start working and share the updates soon.
wanted to share a quick update, The tests are almost done I will finalize the tests and raise a PR .