Skip to content

Commit

Permalink
Proper clean-up to temporary organisation
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Aug 10, 2021
1 parent 9bfe90d commit 0085357
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,16 +475,21 @@ Cypress.Commands.add(
headers: {
Authorization: authToken
},
url: `${apiUrl}/orgs/${organisation}/`
url: `${apiUrl}/orgs/${organisation}/`,
failOnStatusCode: !isCleanup
}).then(response => {
if (getUser() === response.body.created_by) {
if (
response.status >= 200 &&
response.status < 400 &&
getUser() === response.body.created_by
) {
cy.request({
method: "DELETE",
headers: {
Authorization: authToken
},
url: `${apiUrl}/orgs/${organisation}/`,
failOnStatusCode: !!!isCleanup
failOnStatusCode: !isCleanup
});
}
});
Expand Down

0 comments on commit 0085357

Please sign in to comment.