Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/image_diff/helpers/utils_helper_spec.js')
-rw-r--r--spec/javascripts/image_diff/helpers/utils_helper_spec.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/spec/javascripts/image_diff/helpers/utils_helper_spec.js b/spec/javascripts/image_diff/helpers/utils_helper_spec.js
index 6f62ee3f93b..3b6378be883 100644
--- a/spec/javascripts/image_diff/helpers/utils_helper_spec.js
+++ b/spec/javascripts/image_diff/helpers/utils_helper_spec.js
@@ -1,6 +1,4 @@
import * as utilsHelper from '~/image_diff/helpers/utils_helper';
-import ImageDiff from '~/image_diff/image_diff';
-import ReplacedImageDiff from '~/image_diff/replaced_image_diff';
import ImageBadge from '~/image_diff/image_badge';
import * as mockData from '../mock_data';
@@ -151,53 +149,4 @@ describe('utilsHelper', () => {
});
});
});
-
- describe('initImageDiff', () => {
- let glCache;
- let fileEl;
-
- beforeEach(() => {
- window.gl = window.gl || (window.gl = {});
- glCache = window.gl;
- fileEl = document.createElement('div');
- fileEl.innerHTML = `
- <div class="diff-file"></div>
- `;
-
- spyOn(ReplacedImageDiff.prototype, 'init').and.callFake(() => {});
- spyOn(ImageDiff.prototype, 'init').and.callFake(() => {});
- });
-
- afterEach(() => {
- window.gl = glCache;
- });
-
- it('should initialize ImageDiff if js-single-image', () => {
- const diffFileEl = fileEl.querySelector('.diff-file');
- diffFileEl.innerHTML = `
- <div class="js-single-image">
- </div>
- `;
-
- const imageDiff = utilsHelper.initImageDiff(fileEl, true, false);
-
- expect(ImageDiff.prototype.init).toHaveBeenCalled();
- expect(imageDiff.canCreateNote).toEqual(true);
- expect(imageDiff.renderCommentBadge).toEqual(false);
- });
-
- it('should initialize ReplacedImageDiff if js-replaced-image', () => {
- const diffFileEl = fileEl.querySelector('.diff-file');
- diffFileEl.innerHTML = `
- <div class="js-replaced-image">
- </div>
- `;
-
- const replacedImageDiff = utilsHelper.initImageDiff(fileEl, false, true);
-
- expect(ReplacedImageDiff.prototype.init).toHaveBeenCalled();
- expect(replacedImageDiff.canCreateNote).toEqual(false);
- expect(replacedImageDiff.renderCommentBadge).toEqual(true);
- });
- });
});