studio icon indicating copy to clipboard operation
studio copied to clipboard

[Remove Vuetify from Studio] Convert Sign In page unit tests to Vue Testing Library

Open vtushar06 opened this issue 3 weeks ago • 1 comments

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

  • Issue: #5534 (Convert AccountsMain tests to VTL)
  • Related: #5536 (CatalogList conversion)

Reviewer guidance

Testing:

vtushar06 avatar Dec 01 '25 05:12 vtushar06

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.

vtushar06 avatar Dec 01 '25 05:12 vtushar06

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!

MisRob avatar Dec 02 '25 11:12 MisRob

Hii @LianaHarris360, Thanks for approving and merging this, can you please look into similar PR #5536.

vtushar06 avatar Dec 08 '25 15:12 vtushar06

No problem! And a reviewer has already been assigned to that pull request, they will review it when they have the opportunity :)

LianaHarris360 avatar Dec 08 '25 22:12 LianaHarris360