mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
Lock editor until yCollab extension is loaded (#2136)
* Lock editor until yCollab extension is loaded Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
70dc2ac09b
commit
cf892a11a0
8 changed files with 141 additions and 52 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -13,8 +13,17 @@ declare namespace Cypress {
|
|||
|
||||
Cypress.Commands.add('setCodemirrorContent', (content: string) => {
|
||||
const line = content.split('\n').find((value) => value !== '')
|
||||
cy.get('.cm-editor').click().get('.cm-content').fill(content)
|
||||
cy.getByCypressId('editor-pane')
|
||||
.should('have.attr', 'data-cypress-editor-ready', 'true')
|
||||
.get('.cm-editor')
|
||||
.click()
|
||||
.get('.cm-content')
|
||||
.fill(content)
|
||||
if (line) {
|
||||
cy.get('.cm-editor').find('.cm-line').should('contain.text', line)
|
||||
cy.getByCypressId('editor-pane')
|
||||
.should('have.attr', 'data-cypress-editor-ready', 'true')
|
||||
.get('.cm-editor')
|
||||
.find('.cm-line')
|
||||
.should('contain.text', line)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue