Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test(api): split test and use .its and .should
Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud authored and backportbot[bot] committed May 28, 2024
commit 2a4d9845200c7a4d815adaed04c3ed50beb88598
30 changes: 11 additions & 19 deletions cypress/e2e/api/UsersApi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,22 @@ describe('The user mention API', function() {
})

it('fetches users with valid session', function() {
cy.sessionUsers(this.connection)
.its('status').should('eq', 200)
})

cy.sessionUsers(this.connection).then(({ status }) => {
expect(status).to.eq(200)
})

it('rejects invalid sessions', function() {
cy.sessionUsers(this.connection, { sessionToken: 'invalid' })
.then(({ status }) => {
expect(status).to.eq(403)
})

.its('status').should('eq', 403)
cy.sessionUsers(this.connection, { sessionId: 0 })
.then(({ status }) => {
expect(status).to.eq(403)
})

.its('status').should('eq', 403)
cy.sessionUsers(this.connection, { documentId: 0 })
.then(({ status }) => {
expect(status).to.eq(403)
})
.its('status').should('eq', 403)
})

it('rejects closed sessions', function() {
cy.then(() => this.connection.close())

cy.sessionUsers(this.connection).then(({ status }) => {
expect(status).to.eq(403)
})
cy.sessionUsers(this.connection)
.its('status').should('eq', 403)
})
})