Просмотр исходного кода

Assert that the Rich Text document is ready before continuing with Cypress tests (#12612)

GitOrigin-RevId: fb0755200366e1129ee86ba9a439210ffe64e205
Alf Eaton 3 лет назад
Родитель
Сommit
e09a5f3adf

+ 3 - 0
services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-list.spec.tsx

@@ -20,6 +20,9 @@ const mountEditor = (content: string) => {
       </EditorProviders>
     </Container>
   )
+
+  // wait for the content to be parsed and revealed
+  cy.get('.cm-content').should('have.css', 'opacity', '1')
 }
 
 describe('<CodeMirrorEditor/> lists in Rich Text mode', function () {

+ 3 - 0
services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-toolbar.spec.tsx

@@ -32,6 +32,9 @@ const mountEditor = (content: string) => {
       </EditorProviders>
     </Container>
   )
+
+  // wait for the content to be parsed and revealed
+  cy.get('.cm-content').should('have.css', 'opacity', '1')
 }
 
 describe('<CodeMirrorEditor/> toolbar in Rich Text mode', function () {

+ 3 - 0
services/web/test/frontend/features/source-editor/components/codemirror-editor-visual.spec.tsx

@@ -34,6 +34,9 @@ describe('<CodeMirrorEditor/> in Rich Text mode', function () {
       </Container>
     )
 
+    // wait for the content to be parsed and revealed
+    cy.get('.cm-content').should('have.css', 'opacity', '1')
+
     cy.get('.cm-line').eq(0).click().as('first-line')
     cy.get('.cm-line').eq(1).as('second-line')
     cy.get('.cm-line').eq(2).as('third-line')