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
2cdff946
Commit
2cdff946
authored
Nov 03, 2014
by
Aron Carroll
Committed by
Nick Stenning
Nov 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit tests to verify showHighlights option
parent
ba5f3375
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
karma.config.js
karma.config.js
+1
-0
host-test.coffee
tests/js/host-test.coffee
+26
-0
No files found.
karma.config.js
View file @
2cdff946
...
...
@@ -50,6 +50,7 @@ module.exports = function(config) {
'h/static/scripts/plugin/heatmap.js'
,
'h/static/scripts/vendor/sinon.js'
,
'h/static/scripts/vendor/chai.js'
,
'h/static/scripts/hypothesis.js'
,
'h/templates/*.html'
,
'tests/js/**/*-test.coffee'
],
...
...
tests/js/host-test.coffee
0 → 100644
View file @
2cdff946
assert
=
chai
.
assert
sinon
.
assert
.
expose
(
assert
,
prefix
:
''
)
describe
'Annotator.Host'
,
->
createHost
=
(
options
)
->
element
=
document
.
createElement
(
'div'
)
return
new
Annotator
.
Host
(
element
,
options
)
# Disable Annotator's ridiculous logging.
before
->
sinon
.
stub
(
console
,
'log'
)
after
->
console
.
log
.
restore
()
describe
'options'
,
->
it
'enables highlighting when showHighlights option is provided'
,
(
done
)
->
host
=
createHost
(
showHighlights
:
true
)
host
.
on
'panelReady'
,
->
assert
.
isTrue
(
host
.
visibleHighlights
)
done
()
host
.
publish
(
'panelReady'
)
it
'does not enable highlighting when no showHighlights option is provided'
,
(
done
)
->
host
=
createHost
({})
host
.
on
'panelReady'
,
->
assert
.
isFalse
(
host
.
visibleHighlights
)
done
()
host
.
publish
(
'panelReady'
)
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