diff options
Diffstat (limited to 'spec/frontend_integration/ide')
5 files changed, 21 insertions, 7 deletions
diff --git a/spec/frontend_integration/ide/helpers/ide_helper.js b/spec/frontend_integration/ide/helpers/ide_helper.js index 00ce39a5598..8c5ff816c74 100644 --- a/spec/frontend_integration/ide/helpers/ide_helper.js +++ b/spec/frontend_integration/ide/helpers/ide_helper.js @@ -24,13 +24,19 @@ export const switchLeftSidebarTab = (name) => { export const getStatusBar = () => document.querySelector('.ide-status-bar'); export const waitForMonacoEditor = () => - new Promise((resolve) => monacoEditor.onDidCreateEditor(resolve)); + new Promise((resolve) => { + monacoEditor.onDidCreateEditor(resolve); + }); export const waitForEditorDispose = (instance) => - new Promise((resolve) => instance.onDidDispose(resolve)); + new Promise((resolve) => { + instance.onDidDispose(resolve); + }); export const waitForEditorModelChange = (instance) => - new Promise((resolve) => instance.onDidChangeModel(resolve)); + new Promise((resolve) => { + instance.onDidChangeModel(resolve); + }); export const findMonacoEditor = () => screen.findAllByLabelText(/Editor content;/).then(([x]) => x.closest('.monaco-editor')); diff --git a/spec/frontend_integration/ide/ide_integration_spec.js b/spec/frontend_integration/ide/ide_integration_spec.js index aad9b9e526c..a002ce91deb 100644 --- a/spec/frontend_integration/ide/ide_integration_spec.js +++ b/spec/frontend_integration/ide/ide_integration_spec.js @@ -1,4 +1,5 @@ import { nextTick } from 'vue'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { setTestTimeout } from 'helpers/timeout'; import waitForPromises from 'helpers/wait_for_promises'; import { waitForText } from 'helpers/wait_for_text'; @@ -17,13 +18,14 @@ describe('WebIDE', () => { // For some reason these tests were timing out in CI. // We will investigate in https://gitlab.com/gitlab-org/gitlab/-/issues/298714 setTestTimeout(20000); - setFixtures('<div class="webide-container"></div>'); + setHTMLFixture('<div class="webide-container"></div>'); container = document.querySelector('.webide-container'); }); afterEach(() => { vm.$destroy(); vm = null; + resetHTMLFixture(); }); it('user commits changes', async () => { diff --git a/spec/frontend_integration/ide/user_opens_file_spec.js b/spec/frontend_integration/ide/user_opens_file_spec.js index 2cb3363ef85..c3131f6ad45 100644 --- a/spec/frontend_integration/ide/user_opens_file_spec.js +++ b/spec/frontend_integration/ide/user_opens_file_spec.js @@ -1,4 +1,5 @@ import { screen } from '@testing-library/dom'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { useOverclockTimers } from 'test_helpers/utils/overclock_timers'; import * as ideHelper from './helpers/ide_helper'; import startWebIDE from './helpers/start'; @@ -10,7 +11,7 @@ describe('IDE: User opens a file in the Web IDE', () => { let container; beforeEach(async () => { - setFixtures('<div class="webide-container"></div>'); + setHTMLFixture('<div class="webide-container"></div>'); container = document.querySelector('.webide-container'); vm = startWebIDE(container); @@ -21,6 +22,7 @@ describe('IDE: User opens a file in the Web IDE', () => { afterEach(() => { vm.$destroy(); vm = null; + resetHTMLFixture(); }); describe('user opens a directory', () => { diff --git a/spec/frontend_integration/ide/user_opens_ide_spec.js b/spec/frontend_integration/ide/user_opens_ide_spec.js index c9d78d1de8f..b2b85452451 100644 --- a/spec/frontend_integration/ide/user_opens_ide_spec.js +++ b/spec/frontend_integration/ide/user_opens_ide_spec.js @@ -1,4 +1,5 @@ import { screen } from '@testing-library/dom'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { useOverclockTimers } from 'test_helpers/utils/overclock_timers'; import * as ideHelper from './helpers/ide_helper'; import startWebIDE from './helpers/start'; @@ -10,13 +11,14 @@ describe('IDE: User opens IDE', () => { let container; beforeEach(() => { - setFixtures('<div class="webide-container"></div>'); + setHTMLFixture('<div class="webide-container"></div>'); container = document.querySelector('.webide-container'); }); afterEach(() => { vm.$destroy(); vm = null; + resetHTMLFixture(); }); it('shows loading indicator while the IDE is loading', async () => { diff --git a/spec/frontend_integration/ide/user_opens_mr_spec.js b/spec/frontend_integration/ide/user_opens_mr_spec.js index 3ffc5169351..084aae9f297 100644 --- a/spec/frontend_integration/ide/user_opens_mr_spec.js +++ b/spec/frontend_integration/ide/user_opens_mr_spec.js @@ -1,4 +1,5 @@ import { basename } from 'path'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { getMergeRequests, getMergeRequestWithChanges } from 'test_helpers/fixtures'; import { useOverclockTimers } from 'test_helpers/utils/overclock_timers'; import * as ideHelper from './helpers/ide_helper'; @@ -19,7 +20,7 @@ describe('IDE: User opens Merge Request', () => { changes = getRelevantChanges(); - setFixtures('<div class="webide-container"></div>'); + setHTMLFixture('<div class="webide-container"></div>'); container = document.querySelector('.webide-container'); vm = startWebIDE(container, { mrId }); @@ -31,6 +32,7 @@ describe('IDE: User opens Merge Request', () => { afterEach(() => { vm.$destroy(); vm = null; + resetHTMLFixture(); }); const findAllTabs = () => Array.from(document.querySelectorAll('.multi-file-tab')); |