diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-07-07 18:04:43 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-07-07 18:05:17 +0300 |
commit | f28cd19dde32ab62cc3543d3579fc416d5976aed (patch) | |
tree | 0e8e0323fbda001255e6aec578a60572e50523a3 /spec/javascripts/merge_request_spec.js | |
parent | c7f23e2564880a9742b3f428dcde567852e75212 (diff) |
Fix MR and issue specs
Diffstat (limited to 'spec/javascripts/merge_request_spec.js')
-rw-r--r-- | spec/javascripts/merge_request_spec.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/spec/javascripts/merge_request_spec.js b/spec/javascripts/merge_request_spec.js index 83575b6926c..6ff42e2378d 100644 --- a/spec/javascripts/merge_request_spec.js +++ b/spec/javascripts/merge_request_spec.js @@ -3,6 +3,7 @@ import '~/merge_request'; import CloseReopenReportToggle from '~/close_reopen_report_toggle'; +import IssuablesHelper from '~/helpers/issuables_helper'; (function() { describe('MergeRequest', function() { @@ -31,28 +32,24 @@ import CloseReopenReportToggle from '~/close_reopen_report_toggle'; describe('class constructor', () => { it('calls .initCloseReopenReport', () => { - spyOn(MergeRequest.prototype, 'initCloseReopenReport'); + spyOn(IssuablesHelper, 'initCloseReopenReport'); - const mergeRequest = new MergeRequest(); + new MergeRequest(); // eslint-disable-line no-new - expect(mergeRequest.initCloseReopenReport).toHaveBeenCalled(); + expect(IssuablesHelper.initCloseReopenReport).toHaveBeenCalled(); }); - }); - describe('initCloseReopenReport', () => { it('calls .initDroplab', () => { const container = jasmine.createSpyObj('container', ['querySelector']); const dropdownTrigger = {}; const dropdownList = {}; const button = {}; - const mergeRequest = new MergeRequest(); - spyOn(CloseReopenReportToggle.prototype, 'initDroplab'); spyOn(document, 'querySelector').and.returnValue(container); container.querySelector.and.returnValues(dropdownTrigger, dropdownList, button); - mergeRequest.initCloseReopenReport(); + new MergeRequest(); // eslint-disable-line no-new expect(document.querySelector).toHaveBeenCalledWith('.js-issuable-close-dropdown'); expect(container.querySelector).toHaveBeenCalledWith('.js-issuable-close-toggle'); |