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:
Tilman Vatteroth 2022-06-19 20:02:51 +02:00 committed by GitHub
parent 70dc2ac09b
commit cf892a11a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 141 additions and 52 deletions

View file

@ -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)
}
})