Skip to content
Open
Changes from all commits
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
28 changes: 28 additions & 0 deletions cypress/e2e/directediting.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ describe('direct editing', function() {
initUserAndFiles(user, 'test.md', 'empty.md', 'empty.txt')
})

beforeEach(function() {
// ensure user is enabled if it was disabled before
cy.clearCookies()
cy.enableUser(user, true)
})

it('Open an existing file, edit it', () => {
cy.login(user)
cy.createDirectEditingLink('empty.md').then((token) => {
Expand Down Expand Up @@ -69,4 +75,26 @@ describe('direct editing', function() {
'# This is a headline\nSome text\n',
)
})

it('Cannot open as disabled user', () => {
cy.login(user)
cy.createDirectEditingLink('empty.md').as('token')
cy.clearCookies()
cy.enableUser(user, false)
cy.get('@token')
.then((token) => { cy.request({ url: token, failOnStatusCode: false }) })
.its('status')
.should('equal', 404)
})

it('Cannot open as deleted user', () => {
cy.login(user)
cy.createDirectEditingLink('empty.md').as('token')
cy.clearCookies()
cy.deleteUser(user)
cy.get('@token')
.then((token) => { cy.request({ url: token, failOnStatusCode: false }) })
.its('status')
.should('equal', 404)
})
})
Loading