diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/frontend/editor/utils_spec.js | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/frontend/editor/utils_spec.js')
-rw-r--r-- | spec/frontend/editor/utils_spec.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/frontend/editor/utils_spec.js b/spec/frontend/editor/utils_spec.js index 97d3e9e081d..e561cad1086 100644 --- a/spec/frontend/editor/utils_spec.js +++ b/spec/frontend/editor/utils_spec.js @@ -1,4 +1,5 @@ import { editor as monacoEditor } from 'monaco-editor'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import * as utils from '~/editor/utils'; import { DEFAULT_THEME } from '~/ide/lib/themes'; @@ -14,10 +15,14 @@ describe('Source Editor utils', () => { describe('clearDomElement', () => { beforeEach(() => { - setFixtures('<div id="foo"><div id="bar">Foo</div></div>'); + setHTMLFixture('<div id="foo"><div id="bar">Foo</div></div>'); el = document.getElementById('foo'); }); + afterEach(() => { + resetHTMLFixture(); + }); + it('removes all child nodes from an element', () => { expect(el.children.length).toBe(1); utils.clearDomElement(el); @@ -68,10 +73,14 @@ describe('Source Editor utils', () => { beforeEach(() => { jest.spyOn(monacoEditor, 'colorizeElement').mockImplementation(); jest.spyOn(monacoEditor, 'setTheme').mockImplementation(); - setFixtures('<pre id="foo"></pre>'); + setHTMLFixture('<pre id="foo"></pre>'); el = document.getElementById('foo'); }); + afterEach(() => { + resetHTMLFixture(); + }); + it('colorizes the element and applies the preference theme', () => { expect(monacoEditor.colorizeElement).not.toHaveBeenCalled(); expect(monacoEditor.setTheme).not.toHaveBeenCalled(); |