Skip to content

Conversation

@vtushar06
Copy link
Contributor

@vtushar06 vtushar06 commented Dec 1, 2025

Summary

Converted AccountsMain (Sign In page) unit tests from Vue Test Utils to Vue Testing Library, focusing on user-observable behavior instead of implementation details.

Changes:

  • Replaced mount() with render() and Vue Testing Library queries
  • Simplified Vuex mocking: Using mocks: { $store } instead of createLocalVue (component only uses dispatch/state)
  • Minimal stubs: Only PolicyModals stub kept
  • 8 comprehensive tests covering all major user workflows

Test Coverage:

  • Form rendering and display
  • Form validation (empty submission)
  • Login failures with error messaging
  • Successful login and redirect flow
  • Protected page access with ?next= parameter
  • Inactive account detection
  • Offline state handling

All tests use semantic queries (getByRole, getByLabelText, getByText) and test only user-visible behavior.

References

Reviewer guidance

Testing:

@vtushar06
Copy link
Contributor Author

Hii @MisRob, can you please have a look and provide a reviewer for this PR, implementation is complete and If any changes require please let me know.

@MisRob
Copy link
Member

MisRob commented Dec 2, 2025

Thank you @vtushar06, we will assign a reviewer soon.

I gave it a very quick skim, and I appreciate that you applied all the recent learnings. A reviewer will check on it in more detail, but high-level it looks nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants