diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-06-08 19:15:34 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-07-07 16:57:00 +0300 |
commit | 001c904f28566b2fb3575b5a79871cedf94ea289 (patch) | |
tree | 48d73ad38cddf7ff193118baf2a28cc99cda2f67 /spec/javascripts/close_reopen_report_toggle_spec.js | |
parent | 421e41c9ce3abdd843079c1eb022cad8974d36ff (diff) |
Remove inclusive JS imports
Diffstat (limited to 'spec/javascripts/close_reopen_report_toggle_spec.js')
-rw-r--r-- | spec/javascripts/close_reopen_report_toggle_spec.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/javascripts/close_reopen_report_toggle_spec.js b/spec/javascripts/close_reopen_report_toggle_spec.js index 9641a7e43d6..d94f6a8a345 100644 --- a/spec/javascripts/close_reopen_report_toggle_spec.js +++ b/spec/javascripts/close_reopen_report_toggle_spec.js @@ -1,5 +1,5 @@ import CloseReopenReportToggle from '~/close_reopen_report_toggle'; -import * as DropLab from '~/droplab/drop_lab'; +import DropLab from '~/droplab/drop_lab'; describe('CloseReopenReportToggle', () => { describe('class constructor', () => { @@ -32,7 +32,6 @@ describe('CloseReopenReportToggle', () => { describe('initDroplab', () => { let closeReopenReportToggle; const dropdownList = jasmine.createSpyObj('dropdownList', ['querySelector']); - const droplab = jasmine.createSpyObj('droplab', ['init']); const dropdownTrigger = {}; const button = {}; const reopenItem = {}; @@ -40,7 +39,7 @@ describe('CloseReopenReportToggle', () => { const config = {}; beforeEach(() => { - spyOn(DropLab, 'default').and.returnValue(droplab); + spyOn(DropLab.prototype, 'init'); dropdownList.querySelector.and.returnValues(reopenItem, closeItem); closeReopenReportToggle = new CloseReopenReportToggle({ @@ -61,17 +60,16 @@ describe('CloseReopenReportToggle', () => { expect(closeReopenReportToggle.closeItem).toBe(closeItem); }); - it('instantiates DropLab and set .droplab', () => { - expect(DropLab.default).toHaveBeenCalled(); - expect(closeReopenReportToggle.droplab).toBe(droplab); + it('sets .droplab', () => { + expect(closeReopenReportToggle.droplab).toEqual(jasmine.any(Object)); }); it('calls .setConfig', () => { expect(closeReopenReportToggle.setConfig).toHaveBeenCalled(); }); - it('calls .droplab.init', () => { - expect(droplab.init).toHaveBeenCalledWith( + it('calls droplab.init', () => { + expect(DropLab.prototype.init).toHaveBeenCalledWith( dropdownTrigger, dropdownList, jasmine.any(Array), |