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
a247bb7b
Commit
a247bb7b
authored
May 13, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix StaffDebug javascript tests
parent
6fcf65ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
lms/static/js/spec/staff_debug_actions_spec.js
+11
-10
No files found.
lms/static/js/spec/staff_debug_actions_spec.js
View file @
a247bb7b
describe
(
'StaffDebugActions'
,
function
()
{
describe
(
'StaffDebugActions'
,
function
()
{
var
loc
=
'test_loc'
;
var
location
=
'i4x://edX/Open_DemoX/edx_demo_course/problem/test_loc'
;
var
fixture_id
=
'sd_fu_'
+
loc
;
var
locationName
=
'test_loc'
var
fixture_id
=
'sd_fu_'
+
locationName
;
var
fixture
=
$
(
'<input>'
,
{
id
:
fixture_id
,
placeholder
:
"userman"
});
var
fixture
=
$
(
'<input>'
,
{
id
:
fixture_id
,
placeholder
:
"userman"
});
describe
(
'get_url '
,
function
()
{
describe
(
'get_url '
,
function
()
{
...
@@ -14,13 +15,13 @@ describe('StaffDebugActions', function() {
...
@@ -14,13 +15,13 @@ describe('StaffDebugActions', function() {
it
(
'gets the placeholder username if input field is empty'
,
function
()
{
it
(
'gets the placeholder username if input field is empty'
,
function
()
{
$
(
'body'
).
append
(
fixture
);
$
(
'body'
).
append
(
fixture
);
expect
(
StaffDebug
.
get_user
(
loc
)).
toBe
(
'userman'
);
expect
(
StaffDebug
.
get_user
(
loc
ationName
)).
toBe
(
'userman'
);
$
(
'#'
+
fixture_id
).
remove
();
$
(
'#'
+
fixture_id
).
remove
();
});
});
it
(
'gets a filled in name if there is one'
,
function
()
{
it
(
'gets a filled in name if there is one'
,
function
()
{
$
(
'body'
).
append
(
fixture
);
$
(
'body'
).
append
(
fixture
);
$
(
'#'
+
fixture_id
).
val
(
'notuserman'
);
$
(
'#'
+
fixture_id
).
val
(
'notuserman'
);
expect
(
StaffDebug
.
get_user
(
loc
)).
toBe
(
'notuserman'
);
expect
(
StaffDebug
.
get_user
(
loc
ationName
)).
toBe
(
'notuserman'
);
$
(
'#'
+
fixture_id
).
val
(
''
);
$
(
'#'
+
fixture_id
).
val
(
''
);
$
(
'#'
+
fixture_id
).
remove
();
$
(
'#'
+
fixture_id
).
remove
();
...
@@ -31,11 +32,11 @@ describe('StaffDebugActions', function() {
...
@@ -31,11 +32,11 @@ describe('StaffDebugActions', function() {
$
(
'body'
).
append
(
fixture
);
$
(
'body'
).
append
(
fixture
);
spyOn
(
$
,
'ajax'
);
spyOn
(
$
,
'ajax'
);
StaffDebug
.
reset
(
loc
);
StaffDebug
.
reset
(
loc
ationName
,
location
);
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'type'
]).
toEqual
(
'GET'
);
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'type'
]).
toEqual
(
'GET'
);
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'data'
]).
toEqual
({
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'data'
]).
toEqual
({
'problem_to_reset'
:
loc
,
'problem_to_reset'
:
loc
ation
,
'unique_student_identifier'
:
'userman'
,
'unique_student_identifier'
:
'userman'
,
'delete_module'
:
false
'delete_module'
:
false
});
});
...
@@ -50,11 +51,11 @@ describe('StaffDebugActions', function() {
...
@@ -50,11 +51,11 @@ describe('StaffDebugActions', function() {
$
(
'body'
).
append
(
fixture
);
$
(
'body'
).
append
(
fixture
);
spyOn
(
$
,
'ajax'
);
spyOn
(
$
,
'ajax'
);
StaffDebug
.
sdelete
(
loc
);
StaffDebug
.
sdelete
(
loc
ationName
,
location
);
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'type'
]).
toEqual
(
'GET'
);
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'type'
]).
toEqual
(
'GET'
);
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'data'
]).
toEqual
({
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'data'
]).
toEqual
({
'problem_to_reset'
:
loc
,
'problem_to_reset'
:
loc
ation
,
'unique_student_identifier'
:
'userman'
,
'unique_student_identifier'
:
'userman'
,
'delete_module'
:
true
'delete_module'
:
true
});
});
...
@@ -70,11 +71,11 @@ describe('StaffDebugActions', function() {
...
@@ -70,11 +71,11 @@ describe('StaffDebugActions', function() {
$
(
'body'
).
append
(
fixture
);
$
(
'body'
).
append
(
fixture
);
spyOn
(
$
,
'ajax'
);
spyOn
(
$
,
'ajax'
);
StaffDebug
.
rescore
(
loc
);
StaffDebug
.
rescore
(
loc
ationName
,
location
);
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'type'
]).
toEqual
(
'GET'
);
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'type'
]).
toEqual
(
'GET'
);
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'data'
]).
toEqual
({
expect
(
$
.
ajax
.
mostRecentCall
.
args
[
0
][
'data'
]).
toEqual
({
'problem_to_reset'
:
loc
,
'problem_to_reset'
:
loc
ation
,
'unique_student_identifier'
:
'userman'
,
'unique_student_identifier'
:
'userman'
,
'delete_module'
:
false
'delete_module'
:
false
});
});
...
...
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