2020-12-22 20:45:11 +00:00
|
|
|
/*
|
2022-06-08 11:19:51 +00:00
|
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
2020-12-22 20:45:11 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-01-30 20:46:43 +00:00
|
|
|
import { PAGE_MODE } from '../support/visit'
|
|
|
|
|
2020-12-22 20:45:11 +00:00
|
|
|
describe('Editor mode from URL parameter is used', () => {
|
|
|
|
it('mode view', () => {
|
2022-01-30 20:46:43 +00:00
|
|
|
cy.visitTestNote(PAGE_MODE.EDITOR, 'view')
|
2022-04-03 14:45:30 +00:00
|
|
|
cy.getByCypressId('editor-pane').should('not.be.visible')
|
|
|
|
cy.getByCypressId('documentIframe').should('be.visible')
|
2020-12-22 20:45:11 +00:00
|
|
|
})
|
|
|
|
it('mode both', () => {
|
2022-01-30 20:46:43 +00:00
|
|
|
cy.visitTestNote(PAGE_MODE.EDITOR, 'both')
|
2022-04-03 14:45:30 +00:00
|
|
|
cy.getByCypressId('editor-pane').should('be.visible')
|
|
|
|
cy.getByCypressId('documentIframe').should('be.visible')
|
2020-12-22 20:45:11 +00:00
|
|
|
})
|
|
|
|
it('mode edit', () => {
|
2022-01-30 20:46:43 +00:00
|
|
|
cy.visitTestNote(PAGE_MODE.EDITOR, 'edit')
|
2022-04-03 14:45:30 +00:00
|
|
|
cy.getByCypressId('editor-pane').should('be.visible')
|
|
|
|
cy.getByCypressId('documentIframe').should('not.be.visible')
|
2020-12-22 20:45:11 +00:00
|
|
|
})
|
|
|
|
})
|