kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Migrate user profile and account tests to Vue Testing Library

Open rtibbles opened this issue 9 months ago • 1 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Complexity: Low

Context

The test suites for the user profile plugin's account components use @vue/test-utils, which couples tests to component internals.

ProfilePage.spec.js is the profile page itself rather than part of the change-facility flow, and was missed when the sub-issues were first scoped. It is partially migrated already — it imports both mount/createLocalVue and render/screen.

The Change

Refactor these test files to use Vue Testing Library (VTL) and write tests that reflect how a user interacts with account forms:

  • kolibri/plugins/user_profile/frontend/views/ChangeFacility/CreateAccount/__tests__/index.spec.js
  • kolibri/plugins/user_profile/frontend/views/ChangeFacility/ConfirmAccountUsername/__tests__/index.spec.js
  • kolibri/plugins/user_profile/frontend/views/ProfilePage/__tests__/ProfilePage.spec.js

Do not refactor any other test files or areas of the codebase.

Acceptance Criteria

  • [ ] All three files migrated to use @testing-library/vue
  • [ ] RouterLinkStub and createLocalVue are gone from ProfilePage.spec.js — routing assertions go through rendered link hrefs
  • [ ] 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_profile

References

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

rtibbles avatar Feb 26 '26 17:02 rtibbles

Hi! 👋

Thanks so much for your interest! This issue is not open for contribution. 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.

learning-equality-bot avatar Nov 10 '26 15:11 learning-equality-bot