(HACK WEEK 2025) a11y-audit-ignore codemod (#2946)

* chore: 🤖 add ember-a11y-ignore tool

* chore: 🤖 fix handling existing setRunOptions imports

* chore: 🤖 move codemod to support folder

* chore: 🤖 fix edge case for handling property key names

* chore: 🤖 handle case where multiple of same violation in test

This fixes a bug where multiple cases of the same violation would end up
with multiple entries

* chore: 🤖 ignore axe rules that are currently failing in admin

* chore: 🤖 ignore axe rules that are currently failing in desktop

* docs: ✏️ add a comment explaining the codemod

* chore: 🤖 include test.each cases for a11y ignores

* fix: 🐛 handle test.each test cases for a11y ignore codemod
This commit is contained in:
hashicc authored and Cameron Perera committed 2025-08-19 10:51:44 -05:00
1 parent 1f4076d8d4
commit dc9376a460
114 files changed
+8044

No files matched your search

@@ -16,6 +16,7 @@ import {
} from 'api/models/auth-method';
import * as commonSelectors from 'admin/tests/helpers/selectors';
import * as selectors from './selectors';
import { setRunOptions } from 'ember-a11y-testing/test-support';
module('Acceptance | auth-methods | update', function (hooks) {
setupApplicationTest(hooks);
@@ -66,6 +67,15 @@ module('Acceptance | auth-methods | update', function (hooks) {
});
test('can update an auth method and save changes', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
await visit(urls.authMethods);
await click(commonSelectors.HREF(urls.authMethod));
@@ -85,6 +95,15 @@ module('Acceptance | auth-methods | update', function (hooks) {
});
test('can update an oidc auth method and save changes', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
instances.authMethod = this.server.create('auth-method', {
scope: instances.scopes.org,
type: TYPE_AUTH_METHOD_OIDC,
@@ -232,6 +251,15 @@ module('Acceptance | auth-methods | update', function (hooks) {
});
test('can update an ldap auth method and save changes', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
featuresService.enable('ldap-auth-methods');
await visit(urls.authMethods);
@@ -362,6 +390,15 @@ module('Acceptance | auth-methods | update', function (hooks) {
});
test('can update an ldap auth method and cancel changes', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
featuresService.enable('ldap-auth-methods');
await visit(urls.authMethods);
const name = instances.ldapAuthMethod.name;
@@ -392,6 +429,15 @@ module('Acceptance | auth-methods | update', function (hooks) {
});
test('cannot make changes to an existing auth method without proper authorization', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
instances.authMethod.authorized_actions =
instances.authMethod.authorized_actions.filter(
(item) => item !== 'update',
@@ -404,6 +450,15 @@ module('Acceptance | auth-methods | update', function (hooks) {
});
test('cannot make changes to an existing ldap auth method without proper authorization', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
featuresService.enable('ldap-auth-methods');
instances.ldapAuthMethod.authorized_actions =
instances.ldapAuthMethod.authorized_actions.filter(
@@ -417,6 +472,15 @@ module('Acceptance | auth-methods | update', function (hooks) {
});
test('saving an existing auth method with invalid fields displays error messages', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
const errorMessage = 'The request was invalid.';
const errorDescription = 'Name is required.';
this.server.patch('/auth-methods/:id', () => {
@@ -450,6 +514,15 @@ module('Acceptance | auth-methods | update', function (hooks) {
});
test('saving an existing ldap auth method with invalid fields displays error messages', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
featuresService.enable('ldap-auth-methods');
const errorMessage = 'The request was invalid.';
const errorDescription = 'URL field is required';