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
e0de6bd3
Commit
e0de6bd3
authored
Aug 14, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move isEmbedded responsibility to AppController
parent
2cad4fc7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
annotation-viewer-controller-test.coffee
...tic/scripts/test/annotation-viewer-controller-test.coffee
+0
-4
app-controller-test.coffee
h/static/scripts/test/app-controller-test.coffee
+16
-2
No files found.
h/static/scripts/test/annotation-viewer-controller-test.coffee
View file @
e0de6bd3
...
@@ -40,10 +40,6 @@ describe "AnnotationViewerController", ->
...
@@ -40,10 +40,6 @@ describe "AnnotationViewerController", ->
"AnnotationViewerController"
,
locals
)
"AnnotationViewerController"
,
locals
)
return
locals
return
locals
it
"sets the isEmbedded property to false"
,
->
{
$scope
}
=
createAnnotationViewerController
({})
assert
.
isFalse
(
$scope
.
isEmbedded
)
it
"calls the annotation API to get the annotation"
,
->
it
"calls the annotation API to get the annotation"
,
->
{
store
}
=
createAnnotationViewerController
({})
{
store
}
=
createAnnotationViewerController
({})
assert
store
.
AnnotationResource
.
read
.
args
[
0
][
0
].
id
==
"test_annotation_id"
assert
store
.
AnnotationResource
.
read
.
args
[
0
][
0
].
id
==
"test_annotation_id"
h/static/scripts/test/app-controller-test.coffee
View file @
e0de6bd3
...
@@ -19,8 +19,9 @@ describe 'AppController', ->
...
@@ -19,8 +19,9 @@ describe 'AppController', ->
sandbox
=
null
sandbox
=
null
createController
=
->
createController
=
(
locals
=
{})
->
$controller
(
'AppController'
,
{
$scope
:
$scope
})
locals
.
$scope
=
$scope
$controller
(
'AppController'
,
locals
)
before
->
before
->
angular
.
module
(
'h'
,
[
'ngRoute'
])
angular
.
module
(
'h'
,
[
'ngRoute'
])
...
@@ -116,6 +117,19 @@ describe 'AppController', ->
...
@@ -116,6 +117,19 @@ describe 'AppController', ->
afterEach
->
afterEach
->
sandbox
.
restore
()
sandbox
.
restore
()
describe
'isEmbedded property'
,
->
it
'is false if the window is the top window'
,
->
$window
=
{}
$window
.
top
=
$window
createController
({
$window
})
assert
.
isFalse
(
$scope
.
isEmbedded
)
it
'is true if the window is not the top window'
,
->
$window
=
{
top
:
{}}
createController
({
$window
})
assert
.
isTrue
(
$scope
.
isEmbedded
)
it
'watches the identity service for identity change events'
,
->
it
'watches the identity service for identity change events'
,
->
createController
()
createController
()
assert
.
calledOnce
(
fakeIdentity
.
watch
)
assert
.
calledOnce
(
fakeIdentity
.
watch
)
...
...
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