Commit 63d9456e by Joshua Spayd Committed by Farhanah Sheets

Make timer toggle accessible

parent 4364ba17
......@@ -181,11 +181,11 @@ var edx = edx || {};
var timer = this.$el.find('span#time_remaining_id b');
if (timer.hasClass('timer-hidden')) {
timer.removeClass('timer-hidden');
button.attr('title', gettext('Hide Timer'));
button.attr('aria-pressed', 'false');
icon.removeClass('fa-eye').addClass('fa-eye-slash');
} else {
timer.addClass('timer-hidden');
button.attr('title', gettext('Show Timer'));
button.attr('aria-pressed', 'true');
icon.removeClass('fa-eye-slash').addClass('fa-eye');
}
event.stopPropagation();
......
......@@ -10,8 +10,8 @@ describe('ProctoredExamView', function () {
'<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' +
'<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>' +
'<b> </b> <button role="button" id="toggle_timer" aria-label="Hide Timer" aria-pressed="false">' +
'<i class="fa fa-eye-slash" aria-hidden="true"></i></button>' +
'</span> </span>' +
'</div>' +
'</script>'+
......@@ -46,8 +46,8 @@ describe('ProctoredExamView', function () {
});
it('renders items correctly', function () {
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').not('#toggle_timer')).toContainHtml(this.model.get('exam_display_name'));
expect(this.proctored_exam_view.$el.find('a')).toHaveAttr('href', this.model.get("exam_url_path"));
expect(this.proctored_exam_view.$el.find('a')).toContainHtml(this.model.get('exam_display_name'));
});
it('changes behavior when clock time decreases low threshold', function () {
this.proctored_exam_view.secondsLeft = 25;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment