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
3485febd
Commit
3485febd
authored
Dec 02, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for annotation share function
parent
d19c613f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
annotation-test.coffee
tests/js/directives/annotation-test.coffee
+26
-1
No files found.
tests/js/directives/annotation-test.coffee
View file @
3485febd
...
...
@@ -2,6 +2,8 @@ assert = chai.assert
sandbox
=
sinon
.
sandbox
.
create
()
describe
'h.directives.annotation'
,
->
$compile
=
null
$document
=
null
$scope
=
null
$timeout
=
null
annotator
=
null
...
...
@@ -10,8 +12,11 @@ describe 'h.directives.annotation', ->
flash
=
null
beforeEach
module
(
'h'
)
beforeEach
module
(
'h.templates'
)
beforeEach
inject
(
$controller
,
$rootScope
,
_$timeout_
)
->
beforeEach
inject
(
_$compile_
,
$controller
,
_$document_
,
$rootScope
,
_$timeout_
)
->
$compile
=
_$compile_
$document
=
_$document_
$timeout
=
_$timeout_
$scope
=
$rootScope
.
$new
()
$scope
.
annotationGet
=
(
locals
)
->
annotation
...
...
@@ -262,3 +267,23 @@ describe 'h.directives.annotation', ->
$scope
.
$destroy
()
$timeout
.
flush
()
$timeout
.
verifyNoPendingTasks
()
describe
'share'
,
->
$element
=
null
$isolateScope
=
null
dialog
=
null
beforeEach
->
template
=
'<div annotation="annotation">'
$scope
.
annotation
=
annotation
$element
=
$compile
(
template
)(
$scope
)
$scope
.
$digest
()
$isolateScope
=
$element
.
isolateScope
()
dialog
=
$element
.
find
(
'.share-dialog-wrapper'
)
it
'sets and unsets the open class on the share wrapper'
,
->
$element
.
find
(
'a'
).
filter
(
->
this
.
title
==
'Share'
).
click
()
$isolateScope
.
$digest
()
assert
.
ok
(
dialog
.
hasClass
(
'open'
))
$document
.
click
()
assert
.
notOk
(
dialog
.
hasClass
(
'open'
))
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