diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-10 15:43:31 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-10 15:43:31 +0300 |
commit | e0abb91fbc02e361071cec7443e2b70e49901df5 (patch) | |
tree | 40f7256db560240d9c5bde52b570a0f8ad0d54ad /spec | |
parent | 97bd77b44f6643ce69b5de8e3fde2f9ab3fc9f67 (diff) |
Moved endpoint to be passed to loadFile and simplified $.ready syntaxload-balsamiq-viewer-async
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/blob/balsamiq/balsamiq_viewer_spec.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/spec/javascripts/blob/balsamiq/balsamiq_viewer_spec.js b/spec/javascripts/blob/balsamiq/balsamiq_viewer_spec.js index 5b60719396b..cf7fb8cf4ca 100644 --- a/spec/javascripts/blob/balsamiq/balsamiq_viewer_spec.js +++ b/spec/javascripts/blob/balsamiq/balsamiq_viewer_spec.js @@ -4,39 +4,32 @@ import ClassSpecHelper from '../../helpers/class_spec_helper'; describe('BalsamiqViewer', () => { let balsamiqViewer; - let endpoint; let viewer; describe('class constructor', () => { beforeEach(() => { - endpoint = 'endpoint'; viewer = {}; - balsamiqViewer = new BalsamiqViewer(viewer, endpoint); + balsamiqViewer = new BalsamiqViewer(viewer); }); it('should set .viewer', () => { expect(balsamiqViewer.viewer).toBe(viewer); }); - - it('should set .endpoint', () => { - expect(balsamiqViewer.endpoint).toBe(endpoint); - }); }); describe('loadFile', () => { + const endpoint = 'endpoint'; let xhr; beforeEach(() => { - endpoint = 'endpoint'; xhr = jasmine.createSpyObj('xhr', ['open', 'send']); balsamiqViewer = jasmine.createSpyObj('balsamiqViewer', ['renderFile']); - balsamiqViewer.endpoint = endpoint; spyOn(window, 'XMLHttpRequest').and.returnValue(xhr); - BalsamiqViewer.prototype.loadFile.call(balsamiqViewer); + BalsamiqViewer.prototype.loadFile.call(balsamiqViewer, endpoint); }); it('should call .open', () => { |