diff --git a/cypress/e2e/api/UsersApi.spec.js b/cypress/e2e/api/UsersApi.spec.js index 141776f0e77..39d94957166 100644 --- a/cypress/e2e/api/UsersApi.spec.js +++ b/cypress/e2e/api/UsersApi.spec.js @@ -72,33 +72,29 @@ describe('The user mention API', function() { }) const invalidRequestData = { ...requestData } - cy.wrap(() => { - invalidRequestData.body = { - ...requestData.body, - sessionToken: 'invalid', - } - }) + invalidRequestData.body = { + ...requestData.body, + sessionToken: 'invalid', + } cy.request(invalidRequestData).then(({ status }) => { expect(status).to.eq(403) }) - cy.wrap(() => { - invalidRequestData.body = { - ...requestData.body, - sessionId: 0, - } - }) - cy.request(invalidRequestData).then(({ status }) => { + const invalidRequestDataId = { ...requestData } + invalidRequestDataId.body = { + ...requestData.body, + sessionId: 0, + } + cy.request(invalidRequestDataId).then(({ status }) => { expect(status).to.eq(403) }) - cy.wrap(() => { - invalidRequestData.body = { - ...requestData.body, - documentId: 0, - } - }) - cy.request(invalidRequestData).then(({ status }) => { + const invalidRequestDataDocumentId = { ...requestData } + invalidRequestDataDocumentId.body = { + ...requestData.body, + sessionId: 0, + } + cy.request(invalidRequestDataDocumentId).then(({ status }) => { expect(status).to.eq(403) })