Commit dfc617a4 authored by Jake Hartnell's avatar Jake Hartnell Committed by Randall Leeds

Remove old tests around setTool which no longer apply.

parent 03427df3
......@@ -42,7 +42,6 @@ describe 'AnnotationUISync', ->
focusAnnotations: sandbox.stub()
selectAnnotations: sandbox.stub()
xorSelectedAnnotations: sandbox.stub()
tool: 'comment'
visibleHighlights: false
createAnnotationUISync = ->
......@@ -53,17 +52,12 @@ describe 'AnnotationUISync', ->
describe 'on bridge connection', ->
describe 'when the source is not the parent window', ->
it 'broadcasts the tool/visibility settings to the channel', ->
it 'broadcasts the visibility settings to the channel', ->
channel = createChannel()
fakeBridge.onConnect.callsArgWith(0, channel, {})
createAnnotationUISync()
assert.calledWith(channel.notify, {
method: 'setTool'
params: 'comment'
})
assert.calledWith(channel.notify, {
method: 'setVisibleHighlights'
params: false
......@@ -186,34 +180,6 @@ describe 'AnnotationUISync', ->
})
assert.called($digest)
describe 'on "setTool" event', ->
it 'updates the annotationUI with the new tool', ->
createAnnotationUISync()
publish({
method: 'setTool',
params: 'highlighter'
})
assert.equal(fakeAnnotationUI.tool, 'highlighter')
it 'notifies the other frames of the change', ->
createAnnotationUISync()
publish({
method: 'setTool',
params: 'highlighter'
})
assert.calledWith(fakeBridge.notify, {
method: 'setTool'
params: 'highlighter'
})
it 'triggers a digest of the application state', ->
createAnnotationUISync()
publish({
method: 'setTool',
params: 'highlighter'
})
assert.called($digest)
describe 'on "setVisibleHighlights" event', ->
it 'updates the annotationUI with the new value', ->
createAnnotationUISync()
......
......@@ -267,29 +267,6 @@ describe 'Annotator.Guest', ->
emitGuestEvent('getDocumentInfo', ctx)
assert.calledWith(ctx.delayReturn, true)
describe 'on "setTool" event', ->
it 'updates the .tool property', ->
guest = createGuest()
emitGuestEvent('setTool', 'ctx', 'highlighter')
assert.equal(guest.tool, 'highlighter')
it 'publishes the "setTool" event', ->
handler = sandbox.stub()
guest = createGuest()
guest.subscribe('setTool', handler)
emitGuestEvent('setTool', 'ctx', 'highlighter')
assert.called(handler)
assert.calledWith(handler, 'highlighter')
describe 'on "setVisibleHighlights" event', ->
it 'publishes the "setVisibleHighlights" event', ->
handler = sandbox.stub()
guest = createGuest()
guest.subscribe('setTool', handler)
emitGuestEvent('setTool', 'ctx', 'highlighter')
assert.called(handler)
assert.calledWith(handler, 'highlighter')
describe 'onAdderMouseUp', ->
it 'it prevents the default browser action when triggered', () ->
event = jQuery.Event('mouseup')
......
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