-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1056 from bluewave-labs/fix/be/refactor-monitor-c…
…ontroller Fix/be/refactor monitor controller
- Loading branch information
Showing
8 changed files
with
87 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -467,7 +467,7 @@ describe("Auth Controller - editUser", async () => { | |
}); | ||
await editUser(req, res, next); | ||
expect(next.firstCall.args[0]).to.be.an("error"); | ||
expect(next.firstCall.args[0].status).to.equal(403); | ||
expect(next.firstCall.args[0].status).to.equal(401); | ||
expect(next.firstCall.args[0].message).to.equal( | ||
errorMessages.AUTH_INCORRECT_PASSWORD | ||
); | ||
|
@@ -812,9 +812,9 @@ describe("Auth Controller - deleteUser", () => { | |
afterEach(() => { | ||
sinon.restore(); | ||
}); | ||
it("should return 404 if user is not found", async () => { | ||
it("should throw an error if user is not found", async () => { | ||
jwt.decode.returns({ email: "[email protected]" }); | ||
req.db.getUserByEmail.resolves(null); | ||
req.db.getUserByEmail.throws(new Error(errorMessages.DB_USER_NOT_FOUND)); | ||
|
||
await deleteUser(req, res, next); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters