Skip to content

FIX: Invalid User Tests #944

Closed
Closed
@greaterweb

Description

@greaterweb

There appear to be a number of issues present with the User model tests.

  • invalidCredentials are actually valid (see validCredentialsEmailVerified)
  • test using invalidCredentials should actually fail but it doesn't (broader problem, see below)
  • use off .expect needs to be paired with logic in the .end callback (eg. if (err) return done(err);) when testing REST calls, this is not applied to all instances. to confirm these are failing, change one of the .expect values and note the test still passes
  • could also extend to create API test where there are only REST tests, for example there is only a REST test for invalidCredentials and nothing specific for API call

Regarding the point of .expect usage, it's probably worth looking into any other REST unit tests to make sure they are correct in implementation.

A question in general. There is both vanilla assert statements and chai expect statements, which is the preferred approach for testing?

Additional tests to add

  • check reset password fails without email address (API and REST)
  • reset password over REST

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions