diff options
Diffstat (limited to 'spec/frontend/image_diff')
-rw-r--r-- | spec/frontend/image_diff/image_diff_spec.js | 7 | ||||
-rw-r--r-- | spec/frontend/image_diff/init_discussion_tab_spec.js | 7 | ||||
-rw-r--r-- | spec/frontend/image_diff/replaced_image_diff_spec.js | 7 |
3 files changed, 18 insertions, 3 deletions
diff --git a/spec/frontend/image_diff/image_diff_spec.js b/spec/frontend/image_diff/image_diff_spec.js index 710aa7108a8..f8faa8d78c2 100644 --- a/spec/frontend/image_diff/image_diff_spec.js +++ b/spec/frontend/image_diff/image_diff_spec.js @@ -1,3 +1,4 @@ +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { TEST_HOST } from 'helpers/test_constants'; import imageDiffHelper from '~/image_diff/helpers/index'; import ImageDiff from '~/image_diff/image_diff'; @@ -9,7 +10,7 @@ describe('ImageDiff', () => { let imageDiff; beforeEach(() => { - setFixtures(` + setHTMLFixture(` <div id="element"> <div class="diff-file"> <div class="js-image-frame"> @@ -35,6 +36,10 @@ describe('ImageDiff', () => { element = document.getElementById('element'); }); + afterEach(() => { + resetHTMLFixture(); + }); + describe('constructor', () => { beforeEach(() => { imageDiff = new ImageDiff(element, { diff --git a/spec/frontend/image_diff/init_discussion_tab_spec.js b/spec/frontend/image_diff/init_discussion_tab_spec.js index f6f05037c95..3b427f0d54d 100644 --- a/spec/frontend/image_diff/init_discussion_tab_spec.js +++ b/spec/frontend/image_diff/init_discussion_tab_spec.js @@ -1,9 +1,10 @@ +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import initImageDiffHelper from '~/image_diff/helpers/init_image_diff'; import initDiscussionTab from '~/image_diff/init_discussion_tab'; describe('initDiscussionTab', () => { beforeEach(() => { - setFixtures(` + setHTMLFixture(` <div class="timeline-content"> <div class="diff-file js-image-file"></div> <div class="diff-file js-image-file"></div> @@ -11,6 +12,10 @@ describe('initDiscussionTab', () => { `); }); + afterEach(() => { + resetHTMLFixture(); + }); + it('should pass canCreateNote as false to initImageDiff', () => { jest .spyOn(initImageDiffHelper, 'initImageDiff') diff --git a/spec/frontend/image_diff/replaced_image_diff_spec.js b/spec/frontend/image_diff/replaced_image_diff_spec.js index 2b401fc46bf..d789e964e4c 100644 --- a/spec/frontend/image_diff/replaced_image_diff_spec.js +++ b/spec/frontend/image_diff/replaced_image_diff_spec.js @@ -1,3 +1,4 @@ +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { TEST_HOST } from 'helpers/test_constants'; import imageDiffHelper from '~/image_diff/helpers/index'; import ImageDiff from '~/image_diff/image_diff'; @@ -9,7 +10,7 @@ describe('ReplacedImageDiff', () => { let replacedImageDiff; beforeEach(() => { - setFixtures(` + setHTMLFixture(` <div id="element"> <div class="two-up"> <div class="js-image-frame"> @@ -36,6 +37,10 @@ describe('ReplacedImageDiff', () => { element = document.getElementById('element'); }); + afterEach(() => { + resetHTMLFixture(); + }); + function setupImageFrameEls() { replacedImageDiff.imageFrameEls = []; replacedImageDiff.imageFrameEls[viewTypes.TWO_UP] = element.querySelector( |