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
a9eabbff
Commit
a9eabbff
authored
Jan 23, 2015
by
Aron Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for setting ThreadController.isRoot
parent
848d0694
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
thread-test.coffee
tests/js/directives/thread-test.coffee
+13
-1
No files found.
tests/js/directives/thread-test.coffee
View file @
a9eabbff
...
@@ -99,7 +99,9 @@ describe 'h.directives.thread.ThreadController', ->
...
@@ -99,7 +99,9 @@ describe 'h.directives.thread.ThreadController', ->
describe
'h.directives.thread.thread'
,
->
describe
'h.directives.thread.thread'
,
->
createElement
=
null
$element
=
null
$element
=
null
$isolateScope
=
null
fakePulse
=
null
fakePulse
=
null
sandbox
=
null
sandbox
=
null
...
@@ -112,12 +114,22 @@ describe 'h.directives.thread.thread', ->
...
@@ -112,12 +114,22 @@ describe 'h.directives.thread.thread', ->
return
return
beforeEach
inject
(
$compile
,
$rootScope
)
->
beforeEach
inject
(
$compile
,
$rootScope
)
->
$element
=
$compile
(
'<div thread></div>'
)(
$rootScope
.
$new
())
createElement
=
(
html
)
->
$compile
(
html
or
'<div thread></div>'
)(
$rootScope
.
$new
())
$element
=
createElement
()
$isolateScope
=
$element
.
scope
()
$isolateScope
=
$element
.
scope
()
afterEach
->
afterEach
->
sandbox
.
restore
()
sandbox
.
restore
()
it
'sets the threadRoot on the controller to false'
,
->
controller
=
$element
.
controller
(
'thread'
)
assert
.
isFalse
(
controller
.
isRoot
)
it
'sets the threadRoot on the controller to true when the thread-root attr is set'
,
->
$element
=
createElement
(
'<div thread thread-root="true"></div>'
)
controller
=
$element
.
controller
(
'thread'
)
assert
.
isTrue
(
controller
.
isRoot
)
it
'pulses the current thread on an annotationUpdated event'
,
->
it
'pulses the current thread on an annotationUpdated event'
,
->
$element
.
scope
().
$emit
(
'annotationUpdate'
)
$element
.
scope
().
$emit
(
'annotationUpdate'
)
assert
.
called
(
fakePulse
)
assert
.
called
(
fakePulse
)
...
...
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