Skip to content

test : add unit tests for rooms.ts helper functions #2880

Description

@tmdeveloper007

Summary of What Needs to be Done:
Add unit tests for the pure helper functions in src/lib/rooms.ts: normalizeRoomGithubUsername and githubUsernamesEqual.

Changes that Need to be Made:

  • Create test/rooms-utils.test.ts
  • Write tests for normalizeRoomGithubUsername: verify it delegates to normalizeGitHubUsername correctly; handles null, undefined, and empty string inputs; preserves non-null values
  • Write tests for githubUsernamesEqual: verify case-insensitive comparison works; returns true for identical strings; returns false for different strings
  • Use vi.mock to mock @/lib/validate-github-username for isolation if needed

Impact that it would Provide:
These two small pure functions are used throughout the collaboration rooms feature. Testing them explicitly prevents regressions when the underlying normalizeGitHubUsername function changes.

Hello @Priyanshu-byte-coder, please assign this issue to me (@tmdeveloper007) so I can open a focused PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions