Commit abfc4fdc authored by Aron Carroll's avatar Aron Carroll

Fix initialization of Host tests

parent cf4c8914
......@@ -2,13 +2,23 @@ assert = chai.assert
sinon.assert.expose(assert, prefix: '')
describe 'Annotator.Host', ->
sandbox = sinon.sandbox.create()
createHost = (options) ->
element = document.createElement('div')
return new Annotator.Host(element, options)
beforeEach ->
# Disable Annotator's ridiculous logging.
before -> sinon.stub(console, 'log')
after -> console.log.restore()
sandbox.stub(console, 'log')
fakeBridge =
onConnect: sandbox.stub()
on: sandbox.stub()
sandbox.stub(Annotator.Plugin, 'Bridge').returns(fakeBridge)
afterEach -> sandbox.restore()
describe 'options', ->
it 'enables highlighting when showHighlights option is provided', (done) ->
......
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