-
Notifications
You must be signed in to change notification settings - Fork 7
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 #2369 from govuk-one-login/BAU/remove-chai-as-prom…
…ised BAU: Remove Chai As Promised Dependency
- Loading branch information
Showing
14 changed files
with
180 additions
and
136 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 |
---|---|---|
|
@@ -11,6 +11,7 @@ import { CreatePasswordServiceInterface } from "../types"; | |
import { PATH_NAMES } from "../../../app.constants"; | ||
import { mockResponse, RequestOutput, ResponseOutput } from "mock-req-res"; | ||
import { createMockRequest } from "../../../../test/helpers/mock-request-helper"; | ||
import { strict as assert } from "assert"; | ||
|
||
describe("create-password controller", () => { | ||
let req: RequestOutput; | ||
|
@@ -58,9 +59,9 @@ describe("create-password controller", () => { | |
req.body.password = "password1"; | ||
req.session.user = undefined; | ||
|
||
await expect( | ||
createPasswordPost(fakeService)(req as Request, res as Response) | ||
).to.be.rejectedWith( | ||
await assert.rejects( | ||
async () => | ||
createPasswordPost(fakeService)(req as Request, res as Response), | ||
TypeError, | ||
"Cannot read properties of undefined (reading 'email')" | ||
); | ||
|
@@ -75,9 +76,9 @@ describe("create-password controller", () => { | |
req.body = undefined; | ||
req.session.user.email = "[email protected]"; | ||
|
||
await expect( | ||
createPasswordPost(fakeService)(req as Request, res as Response) | ||
).to.be.rejectedWith( | ||
await assert.rejects( | ||
async () => | ||
createPasswordPost(fakeService)(req as Request, res as Response), | ||
TypeError, | ||
"Cannot read properties of undefined (reading 'password')" | ||
); | ||
|
@@ -93,9 +94,12 @@ describe("create-password controller", () => { | |
req.body.password = "password1"; | ||
req.session.user.email = "[email protected]"; | ||
|
||
await expect( | ||
createPasswordPost(fakeService)(req as Request, res as Response) | ||
).to.be.rejectedWith(Error, "Internal server error"); | ||
await assert.rejects( | ||
async () => | ||
createPasswordPost(fakeService)(req as Request, res as Response), | ||
Error, | ||
"Internal server error" | ||
); | ||
expect(fakeService.signUpUser).to.have.been.called; | ||
}); | ||
}); | ||
|
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
Oops, something went wrong.