(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

@@ -11,6 +11,7 @@ import { Response } from 'miragejs';
import { authenticateSession } from 'ember-simple-auth/test-support';
import * as commonSelectors from 'admin/tests/helpers/selectors';
import * as selectors from './selectors';
import { setRunOptions } from 'ember-a11y-testing/test-support';
module('Acceptance | workers | create', function (hooks) {
setupApplicationTest(hooks);
@@ -34,6 +35,20 @@ module('Acceptance | workers | create', function (hooks) {
});
test('can create new workers', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
'heading-order': {
// [ember-a11y-ignore]: axe rule "heading-order" automatically ignored on 2025-08-01
enabled: false,
},
},
});
const workersCount = getWorkersCount();
await visit(newWorkerURL);
@@ -47,6 +62,20 @@ module('Acceptance | workers | create', function (hooks) {
});
test('cluster id input field is visible for `hcp` binary', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
'heading-order': {
// [ember-a11y-ignore]: axe rule "heading-order" automatically ignored on 2025-08-01
enabled: false,
},
},
});
featuresService.enable('byow-pki-hcp-cluster-id');
await visit(newWorkerURL);
@@ -57,6 +86,20 @@ module('Acceptance | workers | create', function (hooks) {
});
test('initial upstreams input field is visible for `oss` binary', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
'heading-order': {
// [ember-a11y-ignore]: axe rule "heading-order" automatically ignored on 2025-08-01
enabled: false,
},
},
});
await visit(newWorkerURL);
const labels = findAll(selectors.WORKER_CREATE_SECTION_FORM_LABEL);
@@ -67,6 +110,20 @@ module('Acceptance | workers | create', function (hooks) {
});
test('download and install step shows correct oss instructions', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
'heading-order': {
// [ember-a11y-ignore]: axe rule "heading-order" automatically ignored on 2025-08-01
enabled: false,
},
},
});
await visit(newWorkerURL);
const createSection = findAll(selectors.WORKER_CREATE_SECTION);
@@ -85,6 +142,20 @@ module('Acceptance | workers | create', function (hooks) {
});
test('download and install step shows correct hcp instructions', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
'heading-order': {
// [ember-a11y-ignore]: axe rule "heading-order" automatically ignored on 2025-08-01
enabled: false,
},
},
});
featuresService.enable('byow-pki-hcp-cluster-id');
await visit(newWorkerURL);
@@ -103,6 +174,15 @@ module('Acceptance | workers | create', function (hooks) {
});
test('Users can navigate to new workers route with proper authorization', async function (assert) {
setRunOptions({
rules: {
'color-contrast': {
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
enabled: false,
},
},
});
await visit(workersURL);
assert.ok(
@@ -126,6 +206,20 @@ module('Acceptance | workers | create', function (hooks) {
});
test('saving a new worker 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,
},
'heading-order': {
// [ember-a11y-ignore]: axe rule "heading-order" automatically ignored on 2025-08-01
enabled: false,
},
},
});
this.server.post('/workers:create:worker-led', () => {
return new Response(
500,