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
edx
edx-proctoring
Commits
4364ba17
Commit
4364ba17
authored
Jul 25, 2017
by
Joshua Spayd
Committed by
Farhanah Sheets
Oct 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for toggle timer
parent
06a0f4f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
edx_proctoring/static/proctoring/spec/proctored_exam_spec.js
+16
-3
No files found.
edx_proctoring/static/proctoring/spec/proctored_exam_spec.js
View file @
4364ba17
...
@@ -9,7 +9,11 @@ describe('ProctoredExamView', function () {
...
@@ -9,7 +9,11 @@ describe('ProctoredExamView', function () {
'You are taking "'
+
'You are taking "'
+
'<a href="<%= exam_url_path %>"> <%= exam_display_name %> </a>'
+
'<a href="<%= exam_url_path %>"> <%= exam_display_name %> </a>'
+
'" as a proctored exam. The timer on the right shows the time remaining in the exam'
+
'" as a proctored exam. The timer on the right shows the time remaining in the exam'
+
'<span id="time_remaining_id" class="pull-right"> <b> </b> </span> </div>'
+
'<span class="exam-timer-clock"> <span id="time_remaining_id">'
+
'<b> </b> <a id="toggle_timer" href="#" title="Hide Timer">'
+
'<i class="fa fa-eye-slash" aria-hidden="true"></i></a>'
+
'</span> </span>'
+
'</div>'
+
'</script>'
+
'</script>'
+
'</div>'
'</div>'
);
);
...
@@ -42,8 +46,8 @@ describe('ProctoredExamView', function () {
...
@@ -42,8 +46,8 @@ describe('ProctoredExamView', function () {
});
});
it
(
'renders items correctly'
,
function
()
{
it
(
'renders items correctly'
,
function
()
{
expect
(
this
.
proctored_exam_view
.
$el
.
find
(
'a'
)).
toHaveAttr
(
'href'
,
this
.
model
.
get
(
"exam_url_path"
));
expect
(
this
.
proctored_exam_view
.
$el
.
find
(
'a'
)
.
not
(
'#toggle_timer'
)
).
toHaveAttr
(
'href'
,
this
.
model
.
get
(
"exam_url_path"
));
expect
(
this
.
proctored_exam_view
.
$el
.
find
(
'a'
)).
toContainHtml
(
this
.
model
.
get
(
'exam_display_name'
));
expect
(
this
.
proctored_exam_view
.
$el
.
find
(
'a'
)
.
not
(
'#toggle_timer'
)
).
toContainHtml
(
this
.
model
.
get
(
'exam_display_name'
));
});
});
it
(
'changes behavior when clock time decreases low threshold'
,
function
()
{
it
(
'changes behavior when clock time decreases low threshold'
,
function
()
{
this
.
proctored_exam_view
.
secondsLeft
=
25
;
this
.
proctored_exam_view
.
secondsLeft
=
25
;
...
@@ -55,6 +59,15 @@ describe('ProctoredExamView', function () {
...
@@ -55,6 +59,15 @@ describe('ProctoredExamView', function () {
this
.
proctored_exam_view
.
render
();
this
.
proctored_exam_view
.
render
();
expect
(
this
.
proctored_exam_view
.
$el
.
find
(
'div.exam-timer'
)).
toHaveClass
(
'low-time critical'
);
expect
(
this
.
proctored_exam_view
.
$el
.
find
(
'div.exam-timer'
)).
toHaveClass
(
'low-time critical'
);
});
});
it
(
'toggles timer visibility correctly'
,
function
()
{
var
button
=
this
.
proctored_exam_view
.
$el
.
find
(
'#toggle_timer'
);
var
timer
=
this
.
proctored_exam_view
.
$el
.
find
(
'span#time_remaining_id b'
);
expect
(
timer
).
not
.
toHaveClass
(
'timer-hidden'
);
button
.
click
();
expect
(
timer
).
toHaveClass
(
'timer-hidden'
);
button
.
click
();
expect
(
timer
).
not
.
toHaveClass
(
'timer-hidden'
);
});
it
(
"reload the page when the exam time finishes"
,
function
(){
it
(
"reload the page when the exam time finishes"
,
function
(){
this
.
proctored_exam_view
.
secondsLeft
=
-
10
;
this
.
proctored_exam_view
.
secondsLeft
=
-
10
;
var
reloadPage
=
spyOn
(
this
.
proctored_exam_view
,
'reloadPage'
);
var
reloadPage
=
spyOn
(
this
.
proctored_exam_view
,
'reloadPage'
);
...
...
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