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
30704ff9
Commit
30704ff9
authored
Nov 10, 2014
by
Aron Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for onAdderMouseup handler
parent
e0ddcd32
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
karma.config.js
karma.config.js
+1
-0
guest-test.coffee
tests/js/guest-test.coffee
+24
-0
No files found.
karma.config.js
View file @
30704ff9
...
@@ -46,6 +46,7 @@ module.exports = function(config) {
...
@@ -46,6 +46,7 @@ module.exports = function(config) {
'h/static/scripts/auth.js'
,
'h/static/scripts/auth.js'
,
'h/static/scripts/helpers.js'
,
'h/static/scripts/helpers.js'
,
'h/static/scripts/session.js'
,
'h/static/scripts/session.js'
,
'h/static/scripts/hypothesis.js'
,
'h/static/scripts/vendor/sinon.js'
,
'h/static/scripts/vendor/sinon.js'
,
'h/static/scripts/vendor/chai.js'
,
'h/static/scripts/vendor/chai.js'
,
'h/templates/*.html'
,
'h/templates/*.html'
,
...
...
tests/js/guest-test.coffee
0 → 100644
View file @
30704ff9
assert
=
chai
.
assert
sinon
.
assert
.
expose
(
assert
,
prefix
:
''
)
describe
'Annotator.Guest'
,
->
createGuest
=
(
options
)
->
element
=
document
.
createElement
(
'div'
)
return
new
Annotator
.
Guest
(
element
,
options
||
{})
# Silence Annotator's sassy backchat
before
->
sinon
.
stub
(
console
,
'log'
)
after
->
console
.
log
.
restore
()
describe
'onAdderMouseUp'
,
->
it
'it prevents the default browser action when triggered'
,
()
->
event
=
jQuery
.
Event
(
'mouseup'
)
guest
=
createGuest
()
guest
.
onAdderMouseup
(
event
)
assert
.
isTrue
(
event
.
isDefaultPrevented
())
it
'it stops any further event bubbling'
,
()
->
event
=
jQuery
.
Event
(
'mouseup'
)
guest
=
createGuest
()
guest
.
onAdderMouseup
(
event
)
assert
.
isTrue
(
event
.
isPropagationStopped
())
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