-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PP-10451 Handle gateway timeout error during transactions download.
This change is for the single service transaction search and not the all services functionality. Converting test scenarios as Cypress Tests for 400, 500 and 504 responses and removing nock mocking logic. Download of transactions list by clicking the download link was de-scoped, so no tests were written for the download functionality.
- Loading branch information
Showing
6 changed files
with
33 additions
and
30 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 |
---|---|---|
|
@@ -23,4 +23,27 @@ describe('invite user controller', () => { | |
sinon.assert.calledWith(req.flash, 'genericError', 'Enter a valid email address') | ||
sinon.assert.calledWith(res.redirect, 303, `/service/${externalServiceId}/team-members/invite`) | ||
}) | ||
|
||
it('should error if a role is not recognised', async () => { | ||
const externalServiceId = 'some-external-service-id' | ||
const unknownRoleId = '999' | ||
const req = { | ||
user: { externalId: 'some-ext-id', serviceIds: ['1'] }, | ||
body: { | ||
'invitee-email': '[email protected]', | ||
'role-input': unknownRoleId | ||
}, | ||
service: { | ||
externalId: externalServiceId | ||
}, | ||
flash: sinon.stub() | ||
} | ||
const res = { | ||
redirect: sinon.stub() | ||
} | ||
|
||
await inviteUserController.invite(req, res) | ||
sinon.assert.calledWith(req.flash, 'genericError', 'Select the team member’s permission level') | ||
sinon.assert.calledWith(res.redirect, 303, `/service/${externalServiceId}/team-members/invite`) | ||
}) | ||
}) |
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 |
---|---|---|
|
@@ -85,27 +85,5 @@ describe('invite user controller', function () { | |
}) | ||
.end(done) | ||
}) | ||
|
||
it('should error on unknown role externalId', function (done) { | ||
const unknownRoleId = '999' | ||
|
||
const app = session.getAppWithLoggedInUser(getApp(), userInSession) | ||
|
||
supertest(app) | ||
.post(formatServicePathsFor(paths.service.teamMembers.invite, EXTERNAL_SERVICE_ID)) | ||
.set('Accept', 'application/json') | ||
.set('Content-Type', 'application/x-www-form-urlencoded') | ||
.set('x-request-id', 'bob') | ||
.send({ | ||
'invitee-email': '[email protected]', | ||
'role-input': unknownRoleId, | ||
csrfToken: csrf().create('123') | ||
}) | ||
.expect(500) | ||
.expect((res) => { | ||
expect(res.body.message).to.equal('There is a problem with the payments platform. Please contact the support team.') | ||
}) | ||
.end(done) | ||
}) | ||
}) | ||
}) |
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