Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
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
OpenEdx
edx-proctoring
Commits
742758ee
Commit
742758ee
authored
Aug 13, 2015
by
Muhammad Shoaib
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proctored exam add allowance views jasmine tests
parent
b6e720b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
edx_proctoring/static/proctoring/spec/proctored_exam_add_allowance_spec.js
+21
-10
No files found.
edx_proctoring/static/proctoring/spec/proctored_exam_add_allowance_spec.js
View file @
742758ee
describe
(
'ProctoredExamAddAllowanceView'
,
function
()
{
describe
(
'ProctoredExamAddAllowanceView'
,
function
()
{
var
html
=
''
;
var
html
=
''
;
var
allowancesHtml
=
''
;
var
allowancesHtml
=
''
;
var
errorAddingAllowance
=
[
{
var
errorAddingAllowance
=
{
detail
:
"Cannot find user
against asd
"
detail
:
"Cannot find user"
}
]
;
};
var
expectedProctoredAllowanceJson
=
[
var
expectedProctoredAllowanceJson
=
[
{
{
created
:
"2015-08-10T09:15:45Z"
,
created
:
"2015-08-10T09:15:45Z"
,
...
@@ -306,11 +306,11 @@ describe('ProctoredExamAddAllowanceView', function () {
...
@@ -306,11 +306,11 @@ describe('ProctoredExamAddAllowanceView', function () {
);
);
//select the form values
//select the form values
// invalid user_info returns error
$
(
'#proctored_exam'
).
val
(
'Test Exam'
);
$
(
'#proctored_exam'
).
val
(
'Test Exam'
);
$
(
'#allowance_type'
).
val
(
'Additional time (minutes)'
);
$
(
'#allowance_type'
).
val
(
'Additional time (minutes)'
);
$
(
'#allowance_value'
).
val
(
'
asdasdasdsa
'
);
$
(
'#allowance_value'
).
val
(
'
2
'
);
$
(
"#user_info"
).
val
(
'testuser1'
);
$
(
"#user_info"
).
val
(
'testuser1
12321
'
);
// trigger the add allowance event.
// trigger the add allowance event.
var
spyEvent
=
spyOnEvent
(
'form'
,
'submit'
);
var
spyEvent
=
spyOnEvent
(
'form'
,
'submit'
);
...
@@ -320,9 +320,20 @@ describe('ProctoredExamAddAllowanceView', function () {
...
@@ -320,9 +320,20 @@ describe('ProctoredExamAddAllowanceView', function () {
this
.
server
.
respond
();
this
.
server
.
respond
();
this
.
server
.
respond
();
this
.
server
.
respond
();
expect
(
this
.
proctored_exam_allowance
.
$el
.
find
(
'tr.allowance-items'
).
html
()).
toContain
(
'testuser1'
);
expect
(
add_allowance_view
.
$el
.
find
(
'.error-response'
).
html
()).
toContain
(
'Cannot find user'
);
expect
(
this
.
proctored_exam_allowance
.
$el
.
find
(
'tr.allowance-items'
).
html
()).
toContain
(
'testuser1@test.com'
);
expect
(
this
.
proctored_exam_allowance
.
$el
.
find
(
'tr.allowance-items'
).
html
()).
toContain
(
'Additional time (minutes)'
);
//select the form values
expect
(
this
.
proctored_exam_allowance
.
$el
.
find
(
'tr.allowance-items'
).
html
()).
toContain
(
'Test Exam'
);
// empty value returns error
$
(
'#proctored_exam'
).
val
(
'Test Exam'
);
$
(
'#allowance_type'
).
val
(
'Additional time (minutes)'
);
$
(
'#allowance_value'
).
val
(
''
);
$
(
"#user_info"
).
val
(
'testuser1'
);
// trigger the add allowance event.
var
spyEvent
=
spyOnEvent
(
'form'
,
'submit'
);
$
(
'form'
).
trigger
(
"submit"
);
expect
(
add_allowance_view
.
$el
.
find
(
'.error-message'
).
html
()).
toContain
(
'Required field'
);
});
});
});
});
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