add aXe testing to assignment views
also correct ignore rules from html-lang to html-has-lang test plan: - run the spec files edited in this patch normally with yarn run jspec-watch path/to/spec - tests should all pass as expected - run the spec files edited in this patch with the new command yarn run a11y-report path/to/spec - you should get aXe errors on existing a11y violations Change-Id: I239d81fbfcfc8cdbec89d88e5966308de3b6aae7 Reviewed-on: https://gerrit.instructure.com/130892 Reviewed-by: Steven Burnett <sburnett@instructure.com> Tested-by: Jenkins Product-Review: Matt Berns <mberns@instructure.com> QA-Review: Matt Berns <mberns@instructure.com>
This commit is contained in:
parent
37b34d71e4
commit
3c91cd73cf
|
@ -32,7 +32,7 @@ define ['jquery', 'underscore', 'axe-core'], ($, _, axe) ->
|
|||
isAccessible: ($el, done, options={}) ->
|
||||
if options.a11yReport
|
||||
if __A11Y_REPORT
|
||||
options.ignores = ':html-lang, :document-title, :region, :meta-viewport, :skip-link'
|
||||
options.ignores = ':html-has-lang, :document-title, :region, :meta-viewport, :skip-link'
|
||||
else
|
||||
ok(true)
|
||||
return done()
|
||||
|
|
|
@ -25,8 +25,9 @@ define [
|
|||
'compiled/views/assignments/ToggleShowByView'
|
||||
'jquery'
|
||||
'helpers/fakeENV'
|
||||
'helpers/assertions'
|
||||
'helpers/jquery.simulate'
|
||||
], (Backbone, AssignmentGroup, Course, AssignmentGroupCollection, AssignmentGroupListView, IndexView, ToggleShowByView, $, fakeENV) ->
|
||||
], (Backbone, AssignmentGroup, Course, AssignmentGroupCollection, AssignmentGroupListView, IndexView, ToggleShowByView, $, fakeENV, assertions) ->
|
||||
|
||||
|
||||
fixtures = $('#fixtures')
|
||||
|
@ -81,6 +82,11 @@ define [
|
|||
assignmentGroups = null
|
||||
fixtures.empty()
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
view = assignmentIndex()
|
||||
done = assert.async()
|
||||
assertions.isAccessible view, done, {'a11yReport': true}
|
||||
|
||||
test 'should filter by search term', ->
|
||||
|
||||
view = assignmentIndex()
|
||||
|
|
|
@ -27,8 +27,9 @@ define [
|
|||
'helpers/I18nStubber'
|
||||
'helpers/fakeENV'
|
||||
'jsx/shared/conditional_release/CyoeHelper'
|
||||
'helpers/assertions'
|
||||
'helpers/jquery.simulate'
|
||||
], (Backbone, Assignment, Submission, AssignmentListItemView, $, tz, juneau, french, I18nStubber, fakeENV, CyoeHelper) ->
|
||||
], (Backbone, Assignment, Submission, AssignmentListItemView, $, tz, juneau, french, I18nStubber, fakeENV, CyoeHelper, assertions) ->
|
||||
screenreaderText = null
|
||||
nonScreenreaderText = null
|
||||
|
||||
|
@ -175,6 +176,11 @@ define [
|
|||
tz.restore(@snapshot)
|
||||
I18nStubber.popFrame()
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
view = createView(@model, canManage: true)
|
||||
done = assert.async()
|
||||
assertions.isAccessible view, done, {'a11yReport': true}
|
||||
|
||||
test "initializes child views if can manage", ->
|
||||
view = createView(@model, canManage: true)
|
||||
ok view.publishIconView
|
||||
|
|
|
@ -24,8 +24,9 @@ define [
|
|||
'compiled/views/assignments/AssignmentGroupWeightsView'
|
||||
'jquery'
|
||||
'helpers/fakeENV'
|
||||
'helpers/assertions'
|
||||
'helpers/jquery.simulate'
|
||||
], (Backbone, AssignmentGroupCollection, Course, AssignmentGroup, AssignmentSettingsView, AssignmentGroupWeightsView, $, fakeENV) ->
|
||||
], (Backbone, AssignmentGroupCollection, Course, AssignmentGroup, AssignmentSettingsView, AssignmentGroupWeightsView, $, fakeENV, assertions) ->
|
||||
|
||||
group = (opts = {}) ->
|
||||
new AssignmentGroup $.extend({group_weight: 50}, opts)
|
||||
|
@ -49,6 +50,11 @@ define [
|
|||
setup: -> fakeENV.setup()
|
||||
teardown: -> fakeENV.teardown()
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
view = createView(true)
|
||||
done = assert.async()
|
||||
assertions.isAccessible view, done, {'a11yReport': true}
|
||||
|
||||
test 'sets the checkbox to the right value on open', ->
|
||||
view = createView(weighted: true)
|
||||
ok view.$('#apply_assignment_group_weights').prop('checked')
|
||||
|
|
|
@ -29,6 +29,7 @@ define [
|
|||
'timezone/fr_FR'
|
||||
'helpers/I18nStubber'
|
||||
'helpers/fakeENV'
|
||||
'helpers/assertions'
|
||||
'helpers/jquery.simulate'
|
||||
'compiled/behaviors/tooltip'
|
||||
], (
|
||||
|
@ -44,7 +45,8 @@ define [
|
|||
juneau,
|
||||
french,
|
||||
I18nStubber,
|
||||
fakeENV) ->
|
||||
fakeENV,
|
||||
assertions) ->
|
||||
|
||||
fixtures = $('#fixtures')
|
||||
|
||||
|
@ -163,6 +165,11 @@ define [
|
|||
tz.restore(@snapshot)
|
||||
I18nStubber.popFrame()
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
view = createView(@assignment1)
|
||||
done = assert.async()
|
||||
assertions.isAccessible view, done, {'a11yReport': true}
|
||||
|
||||
test "initialize generates a new assignment for creation", ->
|
||||
view = createView(@group)
|
||||
equal view.model.get("assignment_group_id"), @group.get("id")
|
||||
|
|
|
@ -25,8 +25,9 @@ define [
|
|||
'compiled/views/assignments/CreateGroupView'
|
||||
'jquery'
|
||||
'helpers/fakeENV'
|
||||
'helpers/assertions'
|
||||
'helpers/jquery.simulate'
|
||||
], (_, Backbone, AssignmentGroupCollection, AssignmentGroup, Assignment, Course, CreateGroupView, $, fakeENV) ->
|
||||
], (_, Backbone, AssignmentGroupCollection, AssignmentGroup, Assignment, Course, CreateGroupView, $, fakeENV, assertions) ->
|
||||
|
||||
group = (opts = {}) ->
|
||||
new AssignmentGroup $.extend({
|
||||
|
@ -55,6 +56,11 @@ define [
|
|||
fakeENV.teardown()
|
||||
$("form[id^=ui-id-]").remove()
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
view = createView()
|
||||
done = assert.async()
|
||||
assertions.isAccessible view, done, {'a11yReport': true}
|
||||
|
||||
test 'hides drop options for no assignments', ->
|
||||
view = createView()
|
||||
view.render()
|
||||
|
|
|
@ -24,9 +24,9 @@ define [
|
|||
'compiled/models/Assignment'
|
||||
'compiled/views/assignments/DeleteGroupView'
|
||||
'jquery'
|
||||
'helpers/assertions'
|
||||
'helpers/jquery.simulate'
|
||||
'helpers/fakeENV'
|
||||
], (_, Backbone, AssignmentGroupCollection, AssignmentCollection, AssignmentGroup, Assignment, DeleteGroupView, $) ->
|
||||
], (_, Backbone, AssignmentGroupCollection, AssignmentCollection, AssignmentGroup, Assignment, DeleteGroupView, $, assertions) ->
|
||||
|
||||
group = (assignments=true, id) ->
|
||||
new AssignmentGroup
|
||||
|
@ -51,6 +51,11 @@ define [
|
|||
$("#fixtures").empty()
|
||||
$("form.dialogFormView").remove()
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
view = createView(false, true)
|
||||
done = assert.async()
|
||||
assertions.isAccessible view, done, {'a11yReport': true}
|
||||
|
||||
test 'it should delete a group without assignments', ->
|
||||
@stub(window, "confirm").returns(true)
|
||||
view = createView(false, true)
|
||||
|
|
|
@ -23,7 +23,8 @@ define [
|
|||
'jst/assignments/EditView'
|
||||
'helpers/fakeENV'
|
||||
'Backbone'
|
||||
], ($, _, Assignment, EditHeaderView, editViewTemplate, fakeENV, Backbone) ->
|
||||
'helpers/assertions'
|
||||
], ($, _, Assignment, EditHeaderView, editViewTemplate, fakeENV, Backbone, assertions) ->
|
||||
|
||||
defaultAssignmentOpts =
|
||||
name: 'Test Assignment'
|
||||
|
@ -52,6 +53,11 @@ define [
|
|||
fakeENV.teardown()
|
||||
$(document).off 'submit'
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
view = editHeaderView()
|
||||
done = assert.async()
|
||||
assertions.isAccessible view, done, {'a11yReport': true}
|
||||
|
||||
test 'renders', ->
|
||||
view = editHeaderView()
|
||||
ok view.$('.header-bar-right').length > 0, 'header bar is rendered'
|
||||
|
|
|
@ -30,6 +30,7 @@ define [
|
|||
'compiled/views/assignments/PeerReviewsSelector'
|
||||
'helpers/fakeENV'
|
||||
'compiled/userSettings'
|
||||
'helpers/assertions'
|
||||
'helpers/jquery.simulate'
|
||||
], (
|
||||
$,
|
||||
|
@ -45,7 +46,8 @@ define [
|
|||
GroupCategorySelector,
|
||||
PeerReviewsSelector,
|
||||
fakeENV,
|
||||
userSettings) ->
|
||||
userSettings,
|
||||
assertions) ->
|
||||
|
||||
s_params = 'some super secure params'
|
||||
|
||||
|
@ -112,6 +114,11 @@ define [
|
|||
editView: ->
|
||||
editView.apply(this, arguments)
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
view = @editView()
|
||||
done = assert.async()
|
||||
assertions.isAccessible view, done, {'a11yReport': true}
|
||||
|
||||
test 'renders', ->
|
||||
view = @editView()
|
||||
equal view.$('#assignment_name').val(), 'Test Assignment'
|
||||
|
|
|
@ -19,7 +19,8 @@ define [
|
|||
'compiled/views/assignments/SectionDropdownView'
|
||||
'compiled/models/AssignmentOverride'
|
||||
'compiled/models/Section'
|
||||
], ( SectionDropdownView, AssignmentOverride, Section ) ->
|
||||
'helpers/assertions'
|
||||
], ( SectionDropdownView, AssignmentOverride, Section, assertions ) ->
|
||||
|
||||
QUnit.module "SectionDropdownView",
|
||||
setup: ->
|
||||
|
@ -31,6 +32,10 @@ define [
|
|||
@view = new SectionDropdownView( sections: @sections, override: @override )
|
||||
@view.render()
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
done = assert.async()
|
||||
assertions.isAccessible @view, done, {'a11yReport': true}
|
||||
|
||||
test "updates the course_section_id when the form element changes", ->
|
||||
@view.$el.val('2').trigger 'change'
|
||||
strictEqual @override.get('course_section_id'), '2'
|
||||
|
|
|
@ -19,7 +19,8 @@ define [
|
|||
'compiled/views/assignments/SpeedgraderLinkView'
|
||||
'compiled/models/Assignment'
|
||||
'jquery'
|
||||
], (SpeedgraderLinkView, Assignment, $) ->
|
||||
'helpers/assertions'
|
||||
], (SpeedgraderLinkView, Assignment, $, assertions) ->
|
||||
|
||||
QUnit.module "SpeedgraderLinkView",
|
||||
setup: ->
|
||||
|
@ -36,6 +37,10 @@ define [
|
|||
@view.remove()
|
||||
$('#fixtures').empty()
|
||||
|
||||
test 'it should be accessible', (assert) ->
|
||||
done = assert.async()
|
||||
assertions.isAccessible @view, done, {'a11yReport': true}
|
||||
|
||||
test "#toggleSpeedgraderLink toggles visibility of speedgrader link on change", ->
|
||||
@model.set 'published', true
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@ define [
|
|||
'compiled/views/assignments/ToggleShowByView'
|
||||
'jquery'
|
||||
'helpers/fakeENV'
|
||||
], (_, Backbone, AssignmentGroup, Assignment, Course, AssignmentGroupCollection, AssignmentGroupListView, IndexView, ToggleShowByView, $, fakeENV) ->
|
||||
'helpers/assertions'
|
||||
], (_, Backbone, AssignmentGroup, Assignment, Course, AssignmentGroupCollection, AssignmentGroupListView, IndexView, ToggleShowByView, $, fakeENV, assertions) ->
|
||||
|
||||
|
||||
COURSE_SUBMISSIONS_URL = "/courses/1/submissions"
|
||||
|
@ -86,6 +87,11 @@ define [
|
|||
$(".ui-dialog").remove()
|
||||
$("ul[id^=ui-id-]").remove()
|
||||
|
||||
test 'should be accessible', (assert) ->
|
||||
view = createView(true)
|
||||
done = assert.async()
|
||||
assertions.isAccessible view, done, {'a11yReport': true}
|
||||
|
||||
test 'should sort assignments into groups correctly', ->
|
||||
|
||||
view = createView()
|
||||
|
|
Loading…
Reference in New Issue