Skip to content

Fix failing accountService test + add PR CI workflow#21

Merged
esoadamo merged 2 commits into
mainfrom
copilot/run-tests-and-verify-jwt
Apr 11, 2026
Merged

Fix failing accountService test + add PR CI workflow#21
esoadamo merged 2 commits into
mainfrom
copilot/run-tests-and-verify-jwt

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

findByLogin failed to resolve email@example.com because the example ACCOUNT_MAP only listed aliased emails (email.A@, email.B@), not the account's own email. There was also a logic bug where execution fell through to throw after resolve().

Changes

  • config/accounts.example.js — Added email@example.com to ACCOUNT_MAP["account1"] so the account's primary email is a valid login mapping
  • util/accountService.js — Added return before resolve() in findByLogin to stop loop fall-through to the throw
  • .github/workflows/test.yml — New workflow running npm test on every PR with permissions: contents: read

To enforce tests as a merge gate, enable "Require status checks to pass" in Settings → Branches → Branch protection rules for main and select the test job.

@esoadamo esoadamo marked this pull request as ready for review April 11, 2026 12:53
@esoadamo esoadamo merged commit 5af9a67 into main Apr 11, 2026
1 check passed
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.

2 participants