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
4ce98b19
Commit
4ce98b19
authored
Oct 27, 2015
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing tests for GROUPS_CHANGED and USER_CHANGED events
parent
398f73a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
session-test.js
h/static/scripts/test/session-test.js
+23
-1
No files found.
h/static/scripts/test/session-test.js
View file @
4ce98b19
...
...
@@ -158,7 +158,7 @@ describe('h:session', function () {
});
describe
(
'#update()'
,
function
()
{
it
(
'broadcasts
an event when the session is updated
'
,
function
()
{
it
(
'broadcasts
SESION_CHANGED when the session changes
'
,
function
()
{
var
sessionChangeCallback
=
sinon
.
stub
();
// the initial load should trigger a SESSION_CHANGED event
...
...
@@ -184,5 +184,27 @@ describe('h:session', function () {
assert
.
calledWith
(
sessionChangeCallback
,
sinon
.
match
({}),
{
initialLoad
:
false
});
});
it
(
'broadcasts GROUPS_CHANGED when the groups change'
,
function
()
{
var
groupChangeCallback
=
sinon
.
stub
();
$rootScope
.
$on
(
events
.
GROUPS_CHANGED
,
groupChangeCallback
);
session
.
update
({
groups
:
[{
id
:
'groupid'
}],
csrf
:
'dummytoken'
});
assert
.
calledOnce
(
groupChangeCallback
);
});
it
(
'broadcasts USER_CHANGED when the user changes'
,
function
()
{
var
userChangeCallback
=
sinon
.
stub
();
$rootScope
.
$on
(
events
.
USER_CHANGED
,
userChangeCallback
);
session
.
update
({
userid
:
'fred'
,
csrf
:
'dummytoken'
});
assert
.
calledOnce
(
userChangeCallback
);
});
});
});
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