Skip to content

Investigate account-guard test failure for nonexistent accounts #32

Open

Description

@GPlay97

The full test suite fails in src/account/account.guard.spec.ts:130, in “should not be able to proceed with non-existing user.”

  • Expected error message: Account does not exists
  • Actual error message: Unauthorized
  • Authentication is rejected; no authorization bypass was observed.
  • The guard and test are unchanged by PR Fix TripNotify sharing, trip lists, and live updates #31. The underlying cause has not yet been diagnosed.

Reproduction

With dependencies installed and an isolated MongoDB database available:

DATABASE_URI=<test-database-uri> npm test -- --runInBand

Observed at commit a255fc7935c3017dcde3a2ea3a7fc04e69fb7fce using Node.js v22.23.2: 13 suites pass; the account-guard suite fails.

FAIL src/account/account.guard.spec.ts

  ● Test suite failed to run

    expect(received).rejects.toThrowError(expected)

    Expected substring: "Account does not exists"
    Received message:   "Unauthorized"

Acceptance criteria

  • Diagnose the message mismatch and establish the expected error contract.
  • Correct the implementation or test accordingly.
  • Await asynchronous rejection assertions so failures are attributed correctly.
  • Verify nonexistent accounts and invalid tokens remain rejected.

References

Activity

  1. added
    bugSomething isn't working
    testadd or fix tests
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestadd or fix tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions