Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
dfc617a4
Commit
dfc617a4
authored
Mar 13, 2015
by
Jake Hartnell
Committed by
Randall Leeds
Mar 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old tests around setTool which no longer apply.
parent
03427df3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
58 deletions
+1
-58
annotation-ui-sync-test.coffee
h/static/scripts/test/annotation-ui-sync-test.coffee
+1
-35
guest-test.coffee
h/static/scripts/test/guest-test.coffee
+0
-23
No files found.
h/static/scripts/test/annotation-ui-sync-test.coffee
View file @
dfc617a4
...
@@ -42,7 +42,6 @@ describe 'AnnotationUISync', ->
...
@@ -42,7 +42,6 @@ describe 'AnnotationUISync', ->
focusAnnotations
:
sandbox
.
stub
()
focusAnnotations
:
sandbox
.
stub
()
selectAnnotations
:
sandbox
.
stub
()
selectAnnotations
:
sandbox
.
stub
()
xorSelectedAnnotations
:
sandbox
.
stub
()
xorSelectedAnnotations
:
sandbox
.
stub
()
tool
:
'comment'
visibleHighlights
:
false
visibleHighlights
:
false
createAnnotationUISync
=
->
createAnnotationUISync
=
->
...
@@ -53,17 +52,12 @@ describe 'AnnotationUISync', ->
...
@@ -53,17 +52,12 @@ describe 'AnnotationUISync', ->
describe
'on bridge connection'
,
->
describe
'on bridge connection'
,
->
describe
'when the source is not the parent window'
,
->
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
()
channel
=
createChannel
()
fakeBridge
.
onConnect
.
callsArgWith
(
0
,
channel
,
{})
fakeBridge
.
onConnect
.
callsArgWith
(
0
,
channel
,
{})
createAnnotationUISync
()
createAnnotationUISync
()
assert
.
calledWith
(
channel
.
notify
,
{
method
:
'setTool'
params
:
'comment'
})
assert
.
calledWith
(
channel
.
notify
,
{
assert
.
calledWith
(
channel
.
notify
,
{
method
:
'setVisibleHighlights'
method
:
'setVisibleHighlights'
params
:
false
params
:
false
...
@@ -186,34 +180,6 @@ describe 'AnnotationUISync', ->
...
@@ -186,34 +180,6 @@ describe 'AnnotationUISync', ->
})
})
assert
.
called
(
$digest
)
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'
,
->
describe
'on "setVisibleHighlights" event'
,
->
it
'updates the annotationUI with the new value'
,
->
it
'updates the annotationUI with the new value'
,
->
createAnnotationUISync
()
createAnnotationUISync
()
...
...
h/static/scripts/test/guest-test.coffee
View file @
dfc617a4
...
@@ -267,29 +267,6 @@ describe 'Annotator.Guest', ->
...
@@ -267,29 +267,6 @@ describe 'Annotator.Guest', ->
emitGuestEvent
(
'getDocumentInfo'
,
ctx
)
emitGuestEvent
(
'getDocumentInfo'
,
ctx
)
assert
.
calledWith
(
ctx
.
delayReturn
,
true
)
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'
,
->
describe
'onAdderMouseUp'
,
->
it
'it prevents the default browser action when triggered'
,
()
->
it
'it prevents the default browser action when triggered'
,
()
->
event
=
jQuery
.
Event
(
'mouseup'
)
event
=
jQuery
.
Event
(
'mouseup'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment