Skip to content

Commit 41e1f73

Browse files
authored
fix: editor test on iox. (#6563)
1 parent a1b4a79 commit 41e1f73

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

cypress/e2e/shared/editor.test.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const DEFAULT_FLUX_EDITOR_TEXT =
66
// to see list of monaco-editor widgets to check:
77
// document.querySelectorAll('[widgetid]')
88

9-
describe.skip('Editor+LSP communication', () => {
9+
describe('Editor+LSP communication', () => {
1010
const runTest = editorSelector => {
1111
it('receives LSP-triggered server events', () => {
1212
cy.getByTestID(editorSelector).then(() => {
@@ -82,6 +82,7 @@ describe.skip('Editor+LSP communication', () => {
8282
cy.signin()
8383
cy.setFeatureFlags({
8484
schemaComposition: true,
85+
showOldDataExplorerInNewIOx: true,
8586
})
8687
cy.get('@org').then(({id}: Organization) => {
8788
cy.createMapVariable(id)
@@ -132,17 +133,23 @@ describe.skip('Editor+LSP communication', () => {
132133
cy.get('@org').then(({id}: Organization) => {
133134
cy.visit(`/orgs/${id}/data-explorer`)
134135
cy.getByTestID('tree-nav').should('be.visible')
135-
cy.getByTestID('script-query-builder-toggle').then($toggle => {
136-
cy.wrap($toggle).should('be.visible')
137-
// Switch to Script Editor if not yet
138-
if ($toggle.hasClass('active')) {
139-
// active means showing the old Data Explorer
140-
// hasClass is a jQuery function
141-
$toggle.click()
142-
cy.getByTestID('script-query-builder--menu').contains('New Script')
136+
cy.isIoxOrg().then(isIox => {
137+
if (!isIox) {
138+
cy.getByTestID('script-query-builder-toggle').then($toggle => {
139+
cy.wrap($toggle).should('be.visible')
140+
// Switch to Script Editor if not yet
141+
if ($toggle.hasClass('active')) {
142+
// active means showing the old Data Explorer
143+
// hasClass is a jQuery function
144+
$toggle.click()
145+
cy.getByTestID('script-query-builder--menu').contains(
146+
'New Script'
147+
)
148+
}
149+
})
143150
}
144-
return setScriptToFlux()
145151
})
152+
return setScriptToFlux()
146153
})
147154
})
148155

0 commit comments

Comments
 (0)