-
Notifications
You must be signed in to change notification settings - Fork 252
[Remove Vuetify from Studio] Convert Sign In page unit tests to Vue Testing Library #5553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unstable
Are you sure you want to change the base?
[Remove Vuetify from Studio] Convert Sign In page unit tests to Vue Testing Library #5553
Conversation
…d next-redirect & payload checks
|
Hi @Gopisokk, thanks. We will assign a reviewer. The tests are failing - can you check on it? |
| [wrapper, login] = await makeWrapper(); | ||
| await wrapper.vm.$nextTick(); | ||
| loginToProceed = wrapper.findAllComponents('[data-test="loginToProceed"]').at(0); | ||
| describe('AccountsMain (VTL)', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| describe('AccountsMain (VTL)', () => { | |
| describe('AccountsMain', () => { |
No need to mention what library is used in test descriptions.
| await wrapper.vm.$nextTick(); | ||
| loginToProceed = wrapper.findAllComponents('[data-test="loginToProceed"]').at(0); | ||
| describe('AccountsMain (VTL)', () => { | ||
| test('renders sign-in form', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convention in this codebase is it rather than test.
|
Thanks for the review |
Closes #5534
Summary
Refactors
accounts/pages/__tests__/accountsMain.spec.jsto Vue Testing Library (sub-issue of #5060).What changed
render,screen,userEvent, and arenderComponenthelper.getByLabelText/getByRole) with a singledata-test="loginToProceed"hook.AccountNotActivated.loginmock action; no deprecatedmethodsstubbing.window.location(assign/replace) to avoid jsdom navigation errors.setImmediatedependency.?next=banner + redirect, generic failure (no navigation), 405 →AccountNotActivated, and exact payload (email/username + password).nextis asserted in the redirect test viawindow.location.assign, not as part of the action payload (matches current behavior).Why (Testing Library principles)
Asserts user-visible behavior and dispatched actions rather than component internals, reducing brittleness and easing refactors (e.g., removing Vuetify).
Acceptance & guide alignment
renderComponentwith overridable router/store.Risk / Impact
How to verify locally
pnpm install
pnpm run test -- accounts/pages/tests/accountsMain.spec.js
Expect: 7 passed
Security & privacy: N/A (tests only; no user data)
Internationalization: N/A (tests only; one non-user-facing test id)
LTR/RTL: N/A (no UI change)
Deployment/migrations: N/A
Linked issue: Sub-issue of #5060