Convert user auth page 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 user authentication page components (sign-in-page.spec.js, sign-up-page.spec.js, NewPasswordPage.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 auth pages:
kolibri/plugins/user_auth/frontend/views/__tests__/sign-in-page.spec.jskolibri/plugins/user_auth/frontend/views/__tests__/sign-up-page.spec.jskolibri/plugins/user_auth/frontend/views/SignInPage/__tests__/NewPasswordPage.spec.js
Do not refactor any other test files or areas of the codebase.
How to Get There
- Navigate to the Kolibri sign-in page (e.g.,
/en/user/#/signin) - SignInPage is the main login form with username/password fields
- The sign-up page appears when user creation is enabled on the facility
- NewPasswordPage appears when a user is required to set a new password
Acceptance Criteria
- [ ]
sign-in-page.spec.js,sign-up-page.spec.js, andNewPasswordPage.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 user_auth
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 , can i work on this as well?
You currently have two issues assigned, so I will hold off here for now until one of your active ones is closed.
You currently have two issues assigned, so I will hold off here for now until one of your active ones is closed.
Hey @rtibbles , is it the one in Studio? I already made a PR for it a while back, but sure if you say so, no issues (:
HI @rtibbles I would like to take this one up if its available ?
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!
Hey @rtibbles , may I work on this?
Hi @rtibbles, I have the dev server running locally and have reviewed the existing tests for the auth page. I'm ready to start converting them to Vue Testing Library. Could you please assign this to me?
Thanks all. We assigned you @AadarshM07.
Thank you! I will work on this and will be updating with a PR soon.