summaryrefslogtreecommitdiff
path: root/spec/frontend/version_check_image_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/version_check_image_spec.js')
-rw-r--r--spec/frontend/version_check_image_spec.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/spec/frontend/version_check_image_spec.js b/spec/frontend/version_check_image_spec.js
deleted file mode 100644
index 13bd104a91c..00000000000
--- a/spec/frontend/version_check_image_spec.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import $ from 'jquery';
-import ClassSpecHelper from 'helpers/class_spec_helper';
-import VersionCheckImage from '~/version_check_image';
-
-describe('VersionCheckImage', () => {
- let testContext;
-
- beforeEach(() => {
- testContext = {};
- });
-
- describe('bindErrorEvent', () => {
- ClassSpecHelper.itShouldBeAStaticMethod(VersionCheckImage, 'bindErrorEvent');
-
- beforeEach(() => {
- testContext.imageElement = $('<div></div>');
- });
-
- it('registers an error event', () => {
- jest.spyOn($.prototype, 'on').mockImplementation(() => {});
- // eslint-disable-next-line func-names
- jest.spyOn($.prototype, 'off').mockImplementation(function () {
- return this;
- });
-
- VersionCheckImage.bindErrorEvent(testContext.imageElement);
-
- expect($.prototype.off).toHaveBeenCalledWith('error');
- expect($.prototype.on).toHaveBeenCalledWith('error', expect.any(Function));
- });
-
- it('hides the imageElement on error', () => {
- jest.spyOn($.prototype, 'hide').mockImplementation(() => {});
-
- VersionCheckImage.bindErrorEvent(testContext.imageElement);
-
- testContext.imageElement.trigger('error');
-
- expect($.prototype.hide).toHaveBeenCalled();
- });
- });
-});