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
ecf40206
Commit
ecf40206
authored
Mar 23, 2015
by
Gergely Ujvari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for annotation sync
parent
79cbef74
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
guest-test.coffee
h/static/scripts/test/guest-test.coffee
+14
-2
No files found.
h/static/scripts/test/guest-test.coffee
View file @
ecf40206
...
@@ -19,6 +19,7 @@ describe 'Annotator.Guest', ->
...
@@ -19,6 +19,7 @@ describe 'Annotator.Guest', ->
fakeCrossFrame
=
fakeCrossFrame
=
onConnect
:
sandbox
.
stub
()
onConnect
:
sandbox
.
stub
()
on
:
sandbox
.
stub
()
on
:
sandbox
.
stub
()
sync
:
sandbox
.
stub
()
# Mock out the anchoring plugin. Oh how I wish I didn't have to do crazy
# Mock out the anchoring plugin. Oh how I wish I didn't have to do crazy
# shit like this.
# shit like this.
...
@@ -87,7 +88,7 @@ describe 'Annotator.Guest', ->
...
@@ -87,7 +88,7 @@ describe 'Annotator.Guest', ->
guest
=
createGuest
()
guest
=
createGuest
()
options
=
Annotator
.
Plugin
.
CrossFrame
.
lastCall
.
args
[
1
]
options
=
Annotator
.
Plugin
.
CrossFrame
.
lastCall
.
args
[
1
]
it
'calls deleteAnnotation when an annotationDeleted event is rec
ie
ved'
,
->
it
'calls deleteAnnotation when an annotationDeleted event is rec
ei
ved'
,
->
ann
=
{
id
:
1
,
$
$tag
:
'tag1'
}
ann
=
{
id
:
1
,
$
$tag
:
'tag1'
}
sandbox
.
stub
(
guest
,
'deleteAnnotation'
)
sandbox
.
stub
(
guest
,
'deleteAnnotation'
)
...
@@ -103,7 +104,7 @@ describe 'Annotator.Guest', ->
...
@@ -103,7 +104,7 @@ describe 'Annotator.Guest', ->
# Called only once by the deleteAnnotation() method.
# Called only once by the deleteAnnotation() method.
assert
.
calledOnce
(
handler
)
assert
.
calledOnce
(
handler
)
it
'calls loadAnnotations when an loadAnnotations event is rec
ie
ved'
,
->
it
'calls loadAnnotations when an loadAnnotations event is rec
ei
ved'
,
->
ann
=
{
id
:
1
,
$
$tag
:
'tag1'
}
ann
=
{
id
:
1
,
$
$tag
:
'tag1'
}
target
=
sandbox
.
stub
(
guest
,
'loadAnnotations'
)
target
=
sandbox
.
stub
(
guest
,
'loadAnnotations'
)
...
@@ -279,3 +280,14 @@ describe 'Annotator.Guest', ->
...
@@ -279,3 +280,14 @@ describe 'Annotator.Guest', ->
guest
=
createGuest
()
guest
=
createGuest
()
guest
.
onAdderMouseup
(
event
)
guest
.
onAdderMouseup
(
event
)
assert
.
isTrue
(
event
.
isPropagationStopped
())
assert
.
isTrue
(
event
.
isPropagationStopped
())
describe
'annotation sync'
,
->
it
'calls sync for createAnnotation'
,
->
guest
=
createGuest
()
guest
.
createAnnotation
({})
assert
.
called
(
fakeCrossFrame
.
sync
)
it
'calls sync for setupAnnotation'
,
->
guest
=
createGuest
()
guest
.
setupAnnotation
({
ranges
:
[]})
assert
.
called
(
fakeCrossFrame
.
sync
)
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