Skip to content

Commit 22140d4

Browse files
committed
fix: make cypress create user more informative
Without this commit cypress may sat it has created a user when that is not the case. Nextcloud returns a 200 HTTP code with a status set to "failure" Signed-off-by: Robbert Gurdeep Singh <git@beardhatcode.be> Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
1 parent 85f6806 commit 22140d4

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

cypress/support/commands.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ Cypress.Commands.add('nextcloudCreateUser', (user, password) => {
6565
Authorization: `Basic ${btoa('admin:admin')}`,
6666
},
6767
}).then(response => {
68-
cy.log(`Created user ${user}`, response.status)
68+
if(response.body.ocs.meta.status.toLowerCase() == "ok"){
69+
cy.log(`Created user ${user}`, response.status)
70+
} else {
71+
throw new Error(`Unable to create user`)
72+
}
6973
})
7074
})
7175

js/viewer-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)