diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 13:45:58 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 13:45:58 +0300 |
commit | 8a6d236d45640cf521cbe416c5a4deb54f9e4111 (patch) | |
tree | 04b001045ef431ad20cb390720f50925b7daad76 | |
parent | d689f9a89ea816ccbe95d4334a608e8dcb0d41c4 (diff) |
Fix eslint
-rw-r--r-- | app/assets/javascripts/repo/services/repo_service.js | 1 | ||||
-rw-r--r-- | spec/javascripts/helpers/scroll_helper_spec.js | 59 |
2 files changed, 1 insertions, 59 deletions
diff --git a/app/assets/javascripts/repo/services/repo_service.js b/app/assets/javascripts/repo/services/repo_service.js index 234159ccd9b..3d901213da0 100644 --- a/app/assets/javascripts/repo/services/repo_service.js +++ b/app/assets/javascripts/repo/services/repo_service.js @@ -1,3 +1,4 @@ +/* global Flash */ import axios from 'axios'; import Store from '../stores/repo_store'; import Api from '../../api'; diff --git a/spec/javascripts/helpers/scroll_helper_spec.js b/spec/javascripts/helpers/scroll_helper_spec.js deleted file mode 100644 index 16daaad68a7..00000000000 --- a/spec/javascripts/helpers/scroll_helper_spec.js +++ /dev/null @@ -1,59 +0,0 @@ -import $ from 'jquery'; -import ScrollHelper from '~/helpers/scroll_helper'; - -describe('ScrollHelper', () => { - const width = 10; - - describe('getScrollWidth', () => { - const parent = jasmine.createSpyObj('parent', ['css', 'appendTo', 'remove']); - const child = jasmine.createSpyObj('child', ['css', 'appendTo', 'get']); - let scrollWidth; - - beforeEach(() => { - spyOn($.fn, 'init').and.returnValues(parent, child); - spyOn(jasmine.Fixtures.prototype, 'cleanUp'); // disable jasmine-jquery cleanup, we dont want it but its imported in test_bundle :( - - parent.css.and.returnValue(parent); - child.css.and.returnValue(child); - child.get.and.returnValue({ - offsetWidth: width, - }); - - scrollWidth = ScrollHelper.getScrollWidth(); - }); - - it('inserts 2 nested hidden scrollable divs, calls parents outerWidth, removes parent and returns the width', () => { - const initArgs = $.fn.init.calls.allArgs(); - - expect(initArgs[0][0]).toEqual('<div>'); - expect(initArgs[1][0]).toEqual('<div>'); - expect(parent.css).toHaveBeenCalledWith({ - visibility: 'hidden', - width: 100, - overflow: 'scroll', - }); - expect(child.css).toHaveBeenCalledWith({ - width: 100, - }); - expect(child.appendTo).toHaveBeenCalledWith(parent); - expect(parent.appendTo).toHaveBeenCalledWith('body'); - expect(child.get).toHaveBeenCalledWith(0); - expect(parent.remove).toHaveBeenCalled(); - expect(scrollWidth).toEqual(100 - width); - }); - }); - - describe('setScrollWidth', () => { - it('calls getScrollWidth and sets data-scroll-width', () => { - spyOn($.fn, 'find').and.callThrough(); - spyOn($.fn, 'attr'); - spyOn(ScrollHelper, 'getScrollWidth').and.returnValue(width); - - ScrollHelper.setScrollWidth(); - - expect($.fn.find).toHaveBeenCalledWith('body'); - expect($.fn.attr).toHaveBeenCalledWith('data-scroll-width', width); - expect(ScrollHelper.getScrollWidth).toHaveBeenCalled(); - }); - }); -}); |