-
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 #1435 from govuk-one-login/bugfix/fix-suspended-wi…
…th-password-reset Bugfix: Do not direct to suspensions screen when password reset intervention also applies
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,23 @@ describe("accountInterventionsMiddleware", () => { | |
); | ||
}); | ||
|
||
it("should not redirect to getNextPathAndUpdateJourney with the journey being UNAVAILABLE_TEMPORARY when passwordResetRequired === true and both password reset and suspension interventions are on", async () => { | ||
const fakeAccountInterventionService: AccountInterventionsInterface = { | ||
accountInterventionStatus: sinon.fake.returns({ | ||
data: { | ||
email: "[email protected]", | ||
passwordResetRequired: true, | ||
blocked: false, | ||
temporarilySuspended: true, | ||
}, | ||
}), | ||
} as unknown as AccountInterventionsInterface; | ||
await callMiddleware(true, false, fakeAccountInterventionService); | ||
expect(res.redirect).to.not.have.been.calledWith( | ||
PATH_NAMES.UNAVAILABLE_TEMPORARY | ||
); | ||
}); | ||
|
||
it("should not redirect to UNAVAILABLE_TEMPORARY when temporarilySuspended === true in the response and supportAccountInterventions() returns true", async () => { | ||
const fakeAccountInterventionService = fakeAccountInterventionsService({ | ||
passwordResetRequired: false, | ||
|