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
2200835d
Commit
2200835d
authored
Oct 02, 2015
by
Sean Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for route reload on group change
parent
89f2b668
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
app-controller-test.coffee
h/static/scripts/test/app-controller-test.coffee
+10
-1
No files found.
h/static/scripts/test/app-controller-test.coffee
View file @
2200835d
...
@@ -12,6 +12,7 @@ describe 'AppController', ->
...
@@ -12,6 +12,7 @@ describe 'AppController', ->
fakeParams
=
null
fakeParams
=
null
fakeSession
=
null
fakeSession
=
null
fakeGroups
=
null
fakeGroups
=
null
fakeRoute
=
null
sandbox
=
null
sandbox
=
null
...
@@ -20,7 +21,7 @@ describe 'AppController', ->
...
@@ -20,7 +21,7 @@ describe 'AppController', ->
$controller
(
'AppController'
,
locals
)
$controller
(
'AppController'
,
locals
)
before
->
before
->
angular
.
module
(
'h'
,
[
'ngRoute'
]
)
angular
.
module
(
'h'
)
.
controller
(
'AppController'
,
require
(
'../app-controller'
))
.
controller
(
'AppController'
,
require
(
'../app-controller'
))
.
controller
(
'AnnotationUIController'
,
angular
.
noop
)
.
controller
(
'AnnotationUIController'
,
angular
.
noop
)
...
@@ -65,6 +66,8 @@ describe 'AppController', ->
...
@@ -65,6 +66,8 @@ describe 'AppController', ->
fakeGroups
=
{
focus
:
->
}
fakeGroups
=
{
focus
:
->
}
fakeRoute
=
{
reload
:
sandbox
.
spy
()}
$provide
.
value
'annotationUI'
,
fakeAnnotationUI
$provide
.
value
'annotationUI'
,
fakeAnnotationUI
$provide
.
value
'auth'
,
fakeAuth
$provide
.
value
'auth'
,
fakeAuth
$provide
.
value
'drafts'
,
fakeDrafts
$provide
.
value
'drafts'
,
fakeDrafts
...
@@ -72,6 +75,7 @@ describe 'AppController', ->
...
@@ -72,6 +75,7 @@ describe 'AppController', ->
$provide
.
value
'identity'
,
fakeIdentity
$provide
.
value
'identity'
,
fakeIdentity
$provide
.
value
'session'
,
fakeSession
$provide
.
value
'session'
,
fakeSession
$provide
.
value
'groups'
,
fakeGroups
$provide
.
value
'groups'
,
fakeGroups
$provide
.
value
'$route'
,
fakeRoute
$provide
.
value
'$location'
,
fakeLocation
$provide
.
value
'$location'
,
fakeLocation
$provide
.
value
'$routeParams'
,
fakeParams
$provide
.
value
'$routeParams'
,
fakeParams
return
return
...
@@ -126,3 +130,8 @@ describe 'AppController', ->
...
@@ -126,3 +130,8 @@ describe 'AppController', ->
it
'does not show the share dialog at start'
,
->
it
'does not show the share dialog at start'
,
->
createController
()
createController
()
assert
.
isFalse
(
$scope
.
shareDialog
.
visible
)
assert
.
isFalse
(
$scope
.
shareDialog
.
visible
)
it
'Calls $route.reload() when the focused group changes'
,
->
createController
()
$scope
.
$broadcast
(
'groupFocused'
)
assert
.
calledOnce
(
fakeRoute
.
reload
)
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