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
ef0214a6
Commit
ef0214a6
authored
Jul 09, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests for promise-returning anchoring contract
parent
91a81fdd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
guest-test.coffee
h/static/scripts/annotator/test/guest-test.coffee
+5
-5
No files found.
h/static/scripts/annotator/test/guest-test.coffee
View file @
ef0214a6
...
...
@@ -330,7 +330,7 @@ describe 'Guest', ->
it
"doesn't declare annotations with a working target as orphans"
,
(
done
)
->
guest
=
createGuest
()
annotation
=
target
:
[{
selector
:
"test"
}]
sandbox
.
stub
(
anchoring
,
'anchor'
).
returns
(
range
)
sandbox
.
stub
(
anchoring
,
'anchor'
).
returns
(
Promise
.
resolve
(
range
)
)
guest
.
setupAnnotation
(
annotation
)
waitForSync
(
annotation
).
then
->
assert
.
isFalse
(
annotation
.
$orphan
)
...
...
@@ -339,7 +339,7 @@ describe 'Guest', ->
it
"declares annotations with broken targets as orphans"
,
(
done
)
->
guest
=
createGuest
()
annotation
=
target
:
[{
selector
:
'broken selector'
}]
sandbox
.
stub
(
anchoring
,
'anchor'
).
throws
(
)
sandbox
.
stub
(
anchoring
,
'anchor'
).
returns
(
Promise
.
reject
()
)
guest
.
setupAnnotation
(
annotation
)
waitForSync
(
annotation
).
then
->
assert
.
isTrue
(
annotation
.
$orphan
)
...
...
@@ -360,7 +360,7 @@ describe 'Guest', ->
it
'saves the anchor positions on the annotation'
,
(
done
)
->
guest
=
createGuest
()
sandbox
.
stub
(
anchoring
,
'anchor'
).
returns
(
range
)
sandbox
.
stub
(
anchoring
,
'anchor'
).
returns
(
Promise
.
resolve
(
range
)
)
clientRect
=
{
top
:
100
,
left
:
200
}
window
.
scrollX
=
50
window
.
scrollY
=
25
...
...
@@ -376,7 +376,7 @@ describe 'Guest', ->
it
'adds the anchor to the "anchors" instance property"'
,
(
done
)
->
guest
=
createGuest
()
highlights
=
[
document
.
createElement
(
'span'
)]
sandbox
.
stub
(
anchoring
,
'anchor'
).
returns
(
range
)
sandbox
.
stub
(
anchoring
,
'anchor'
).
returns
(
Promise
.
resolve
(
range
)
)
sandbox
.
stub
(
highlighter
,
'highlightRange'
).
returns
(
highlights
)
target
=
[{
selector
:
[]}]
annotation
=
guest
.
setupAnnotation
({
target
:
[
target
]})
...
...
@@ -404,7 +404,7 @@ describe 'Guest', ->
it
'does not reanchor targets that are already anchored'
,
(
done
)
->
guest
=
createGuest
()
annotation
=
target
:
[{
selector
:
"test"
}]
stub
=
sandbox
.
stub
(
anchoring
,
'anchor'
).
returns
(
range
)
stub
=
sandbox
.
stub
(
anchoring
,
'anchor'
).
returns
(
Promise
.
resolve
(
range
)
)
guest
.
setupAnnotation
(
annotation
)
waitForSync
(
annotation
).
then
->
delete
annotation
.
$anchors
...
...
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