kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Convert user auth page unit tests to Vue Testing Library

Open rtibbles opened this issue 9 months ago • 9 comments

🙂 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:

User auth sign-in 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.js
  • kolibri/plugins/user_auth/frontend/views/__tests__/sign-up-page.spec.js
  • kolibri/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, and NewPasswordPage.spec.js migrated to use @testing-library/vue
  • [ ] No residual @vue/test-utils imports 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

🤖 This issue was written with AI assistance, under supervision, review and final edits by @rtibbles 🤖

rtibbles avatar Feb 17 '26 00:02 rtibbles

Hi @rtibbles , can i work on this as well?

AadarshM07 avatar Feb 17 '26 02:02 AadarshM07

You currently have two issues assigned, so I will hold off here for now until one of your active ones is closed.

rtibbles avatar Feb 17 '26 02:02 rtibbles

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 (:

AadarshM07 avatar Feb 17 '26 02:02 AadarshM07

HI @rtibbles I would like to take this one up if its available ?

sharma-anushka avatar Feb 17 '26 04:02 sharma-anushka

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!

Satish-2004 avatar Feb 17 '26 04:02 Satish-2004

Hey @rtibbles , may I work on this?

Abhishek-Punhani avatar Feb 17 '26 04:02 Abhishek-Punhani

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?

IslamHesham-Dev avatar Feb 17 '26 08:02 IslamHesham-Dev

Thanks all. We assigned you @AadarshM07.

MisRob avatar Feb 17 '26 09:02 MisRob

Thank you! I will work on this and will be updating with a PR soon.

AadarshM07 avatar Feb 17 '26 11:02 AadarshM07