Commit b6e018d7 authored by Robert Knight's avatar Robert Knight

Fix incorrect usage of Sinon APIs

 - Fix cases where `sinon.spy` was used where `sinon.stub` should have
   been used. In recent versions of Sinon only stubs have a `reset`
   method.
 - Fix use of `sinon.stub` as object instead of function
parent d6ca2913
......@@ -328,7 +328,7 @@ describe 'Sidebar', ->
sidebar = null
frame = null
beforeEach ->
layoutChangeHandlerSpy = sandbox.spy()
layoutChangeHandlerSpy = sandbox.stub()
sidebar = createSidebar { onLayoutChange: layoutChangeHandlerSpy, sidebarAppUrl: '/' }
# remove info about call that happens on creation of sidebar
......@@ -391,7 +391,7 @@ describe 'Sidebar', ->
}
document.body.appendChild externalFrame
layoutChangeHandlerSpy = sandbox.spy()
layoutChangeHandlerSpy = sandbox.stub()
layoutChangeExternalConfig = {
onLayoutChange: layoutChangeHandlerSpy,
sidebarAppUrl: '/',
......@@ -444,4 +444,4 @@ describe 'Sidebar', ->
it 'does not have the BucketBar or Toolbar plugin if an external container is provided', ->
sidebar = createSidebar({ externalContainerSelector: '.' + EXTERNAL_CONTAINER_SELECTOR })
assert.isUndefined(sidebar.plugins.BucketBar)
assert.isUndefined(sidebar.plugins.Toolbar)
\ No newline at end of file
assert.isUndefined(sidebar.plugins.Toolbar)
......@@ -82,8 +82,8 @@ describe('sidebar.components.sidebar-content', function () {
};
fakeAnnotationMapper = {
loadAnnotations: sandbox.spy(),
unloadAnnotations: sandbox.spy(),
loadAnnotations: sandbox.stub(),
unloadAnnotations: sandbox.stub(),
};
fakeFrameSync = {
......@@ -100,9 +100,9 @@ describe('sidebar.components.sidebar-content', function () {
};
fakeStreamer = {
setConfig: sandbox.spy(),
connect: sandbox.spy(),
reconnect: sandbox.spy(),
setConfig: sandbox.stub(),
connect: sandbox.stub(),
reconnect: sandbox.stub(),
};
fakeStreamFilter = {
......
......@@ -14,7 +14,7 @@ function windowWithLocalStoragePropertyThatThrows() {
}
function windowWithLocalStorageMethodsThatThrow() {
const throwErr = sinon.stub.throws(new Error('Denied'));
const throwErr = sinon.stub().throws(new Error('Denied'));
return {
localStorage: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment