Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
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
edx
edx-platform
Commits
5bd6e829
Commit
5bd6e829
authored
Nov 04, 2015
by
Peter Fogg
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10465 from edx/peter-fogg/fix-spec-helpers-closure
Fix `withData` and `withConfiguration` helpers.
parents
b48b2b64
759a3c4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
common/static/common/js/spec_helpers/spec_helpers.js
+12
-8
lms/djangoapps/teams/static/teams/js/spec/views/teams_tab_spec.js
+4
-3
No files found.
common/static/common/js/spec_helpers/spec_helpers.js
View file @
5bd6e829
...
...
@@ -13,9 +13,11 @@ define([], function () {
var
withData
=
function
(
data
,
func
)
{
for
(
var
name
in
data
)
{
if
(
data
.
hasOwnProperty
(
name
))
{
it
(
name
,
function
()
{
func
.
apply
(
this
,
data
[
name
]);
});
(
function
(
name
)
{
it
(
name
,
function
()
{
func
.
apply
(
this
,
data
[
name
]);
});
})(
name
);
}
}
};
...
...
@@ -31,12 +33,14 @@ define([], function () {
var
withConfiguration
=
function
(
config
,
setup
,
test
)
{
for
(
var
name
in
config
)
{
if
(
config
.
hasOwnProperty
(
name
))
{
describe
(
name
,
function
()
{
beforeEach
(
function
()
{
setup
.
apply
(
this
,
config
[
name
]);
(
function
(
name
)
{
describe
(
name
,
function
()
{
beforeEach
(
function
()
{
setup
.
apply
(
this
,
config
[
name
]);
});
test
();
});
test
();
});
})(
name
);
}
}
};
...
...
lms/djangoapps/teams/static/teams/js/spec/views/teams_tab_spec.js
View file @
5bd6e829
...
...
@@ -171,10 +171,11 @@ define([
]
},
function
(
url
,
expectedEvent
)
{
var
teamsTabView
=
createTeamsTabView
(
this
,
{
userInfo
:
TeamSpecHelpers
.
createMockUserInfo
({
staff
:
true
})
});
userInfo
:
TeamSpecHelpers
.
createMockUserInfo
({
staff
:
true
})
});
teamsTabView
.
teamsCollection
=
TeamSpecHelpers
.
createMockTeams
();
teamsTabView
.
router
.
navigate
(
url
,
{
trigger
:
true
});
if
(
AjaxHelpers
.
currentRequest
(
requests
)
)
{
if
(
requests
.
length
>
requests
.
currentIndex
)
{
AjaxHelpers
.
respondWithJson
(
requests
,
{});
}
expect
(
Logger
.
log
).
toHaveBeenCalledWith
(
'edx.team.page_viewed'
,
expectedEvent
);
...
...
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