(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:
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 | read', function (hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
@@ -67,6 +68,15 @@ module('Acceptance | auth-methods | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('visiting auth methods in org scope', 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.orgScope);
|
||||
|
||||
await click(commonSelectors.HREF(urls.orgAuthMethods));
|
||||
@@ -75,6 +85,15 @@ module('Acceptance | auth-methods | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('visiting auth methods in global scope', 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.globalScope);
|
||||
|
||||
await click(commonSelectors.HREF(urls.globalAuthMethods));
|
||||
@@ -83,6 +102,15 @@ module('Acceptance | auth-methods | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('can navigate to an auth method form in org scope', 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.orgScope);
|
||||
|
||||
await click(commonSelectors.HREF(urls.orgAuthMethods));
|
||||
@@ -102,6 +130,15 @@ module('Acceptance | auth-methods | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('can navigate to an auth method form in global scope', 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.globalScope);
|
||||
|
||||
await click(commonSelectors.HREF(urls.globalAuthMethods));
|
||||
@@ -121,6 +158,15 @@ module('Acceptance | auth-methods | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot navigate to an auth method form without proper authorization in org scope', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
instances.passwordAuthMethodOrg.authorized_actions =
|
||||
instances.passwordAuthMethodOrg.authorized_actions.filter(
|
||||
(item) => item !== 'read',
|
||||
@@ -135,6 +181,15 @@ module('Acceptance | auth-methods | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot navigate to an auth method form without proper authorization in global scope', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
instances.oidcAuthMethodGlobal.authorized_actions =
|
||||
instances.oidcAuthMethodGlobal.authorized_actions.filter(
|
||||
(item) => item !== 'read',
|
||||
@@ -149,6 +204,15 @@ module('Acceptance | auth-methods | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot navigate to an ldap auth method form in global scope', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
instances.ldapAuthMethod = this.server.create('auth-method', {
|
||||
scope: instances.scopes.global,
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
@@ -169,6 +233,15 @@ module('Acceptance | auth-methods | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot navigate to an ldap auth method form in org scope', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
instances.ldapAuthMethod = this.server.create('auth-method', {
|
||||
scope: instances.scopes.org,
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
@@ -189,6 +262,15 @@ module('Acceptance | auth-methods | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('users can navigate to auth method and incorrect url autocorrects', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const orgScope = this.server.create('scope', {
|
||||
type: 'org',
|
||||
scope: { id: 'global', type: 'global' },
|
||||
|
||||
Reference in new issue
Block a user