Skip to content

Commit 6c0229b

Browse files
Correct test
1 parent 5f7f079 commit 6c0229b

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

tests/integration/support/paste-to-monaco.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Cypress.Commands.add(
55
return cy
66
.get('div.monaco-editor')
77
.find('textarea[aria-roledescription="editor"]')
8-
.filter(':visible')
98
.eq(monacoCount)
109
.focus();
1110
},
@@ -17,16 +16,21 @@ Cypress.Commands.add(
1716
(content, monacoCount) => {
1817
// Ignore Cypress issue with Monaco on CI
1918
cy.handleExceptions();
20-
21-
cy.findMonaco(monacoCount).should('be.visible');
22-
2319
cy.wait(1000);
2420

25-
cy.findMonaco(monacoCount).click({ force: true });
21+
cy.findMonaco(monacoCount).then(monaco => {
22+
if (monaco.is(':visible')) {
23+
monaco.click({ force: true });
24+
}
25+
});
2626

27-
cy.findMonaco(monacoCount)
28-
.should('have.focus')
29-
.clearInput()
30-
.paste({ pastePayload: content });
27+
cy.findMonaco(monacoCount).then(monaco => {
28+
if (monaco.is(':visible')) {
29+
monaco
30+
.should('have.focus')
31+
.clearInput()
32+
.paste({ pastePayload: content });
33+
}
34+
});
3135
},
3236
);

0 commit comments

Comments
 (0)