Skip to content

Conversation

VetteIT
Copy link

@VetteIT VetteIT commented Sep 27, 2025

Description

Adds a comprehensive unit test suite for the LoginModal component using Vitest + React Testing Library.
Covers rendering, i18n labels, login button behavior, close interactions, and Modal wiring (open, aria-labelledby, onClose).

Closes #114


What change does this PR introduce?

  • Bug fix
  • New feature
  • Breaking change
  • CI/CD
  • Documentation update
  • Chore (tests)

What is the proposed approach?

  • Mocked MUI Modal to capture and assert open, aria-labelledby, and invoke onClose.
  • Mocked useGlobalModal to verify setPromptLogin(false) on both close icon click and Modal onClose.
  • Mocked handleLogin and asserted it fires when the GitHub login button is clicked.
  • i18n mock returns keys for deterministic assertions.

Checklist:

  • The commit message follows our adopted guidelines
  • Testing has been done for the change(s) added
  • Relevant comments/docs have been added/updated (N/A — tests only)

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.

[Task] Add unit test cases for LoginModal component
1 participant