Convert setup wizard step 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 individual setup wizard form components (CreateLearnerAccountForm.spec.js, PersonalDataConsentForm.spec.js, UserCredentialsForm.spec.js) currently use @vue/test-utils, which couples tests to component internals.
Related pages:
The Change
Refactor these test files to use Vue Testing Library (VTL) and write tests that reflect how a user interacts with each setup step:
kolibri/plugins/setup_wizard/frontend/views/__tests__/CreateLearnerAccountForm.spec.jskolibri/plugins/setup_wizard/frontend/views/__tests__/PersonalDataConsentForm.spec.jskolibri/plugins/setup_wizard/frontend/views/__tests__/UserCredentialsForm.spec.js
Do not refactor any other test files or areas of the codebase.
How to Get There
The setup wizard appears on first launch of an unprovisioned Kolibri device. To see it during development, start Kolibri with a fresh KOLIBRI_HOME:
export KOLIBRI_HOME=$(mktemp -d)
pnpm run devserver
Then navigate to http://localhost:8000/.
- CreateLearnerAccountForm appears at step 3 of the "Create a new learning facility" flow ("Allow learners to join this facility?")
- PersonalDataConsentForm appears at step 5 ("Responsibilities as an administrator")
- UserCredentialsForm is the "Create super admin" form with Full name, Username, and Password fields
Acceptance Criteria
- [ ]
CreateLearnerAccountForm.spec.js,PersonalDataConsentForm.spec.js, andUserCredentialsForm.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 setup_wizard
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 , would love to work on this. can you assign this to me?
I have assigned you.
Hi @AadarshM07 are you still working on this ??
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.
@rtibbles I have done with the setup of this project locally and understood the codebase can you please assign this issue to me.
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 @rtibbles , I noticed this issue was assigned a month ago and I didn’t see a PR linked yet. Is someone currently working on it? If not, I’d be happy to take a look and work on a fix.
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 @rtibbles , I have migrated the CreateLearnerAccountForm and UserCredentialsForm tests properly. But while migrating PersonalDataConsentForm, I ran into an issue like clicking Usage and privacy link does not produce any observable content in the testing DOM. It should be rendering the PrivacyInfoModal content. I tried Jest mocks, adding data-test attributes, and explicitly querying it in the DOM but even then the content from the modal is not being rendered.
I am not very sure why this is happening. Is there any previous instance of known fixes or references you can share? It would really help.
Hi @rtibbles , I have migrated the
CreateLearnerAccountFormandUserCredentialsFormtests properly. But while migratingPersonalDataConsentForm, I ran into an issue like clickingUsage and privacylink does not produce any observable content in the testing DOM. It should be rendering thePrivacyInfoModalcontent. I tried Jest mocks, adding data-test attributes, and explicitly querying it in the DOM but even then the content from the modal is not being rendered.I am not very sure why this is happening. Is there any previous instance of known fixes or references you can share? It would really help.
Hi, this issue is resolved from my side, found the fix. I will raise the PR shortly. Sorry for the delay.