(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 | users | accounts', function (hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
@@ -65,6 +66,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('visiting user accounts', 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.user);
|
||||
|
||||
await click(commonSelectors.HREF(urls.accounts));
|
||||
@@ -74,6 +84,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('can remove an account', 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.user);
|
||||
|
||||
await click(commonSelectors.HREF(urls.accounts));
|
||||
@@ -87,6 +106,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot remove an account 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,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const authorized_actions = instances.user.authorized_actions.filter(
|
||||
(item) => item !== 'remove-accounts',
|
||||
);
|
||||
@@ -101,6 +129,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot remove an ldap account when feature flag disabled', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const authMethod = this.server.create('auth-method', {
|
||||
scope: instances.scopes.org,
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
@@ -120,6 +157,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('can remove an ldap account when feature flag enabled', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
features.enable('ldap-auth-methods');
|
||||
const authMethod = this.server.create('auth-method', {
|
||||
scope: instances.scopes.org,
|
||||
@@ -140,6 +186,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('shows error message on account remove', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
this.server.post('/users/:idMethod', () => {
|
||||
return new Response(
|
||||
400,
|
||||
@@ -165,6 +220,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('visiting account add accounts', 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.accounts);
|
||||
|
||||
await click(selectors.MANAGE_DROPDOWN_USER);
|
||||
@@ -174,6 +238,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('can navigate to add accounts 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(urls.user);
|
||||
|
||||
await click(commonSelectors.HREF(urls.accounts));
|
||||
@@ -183,6 +256,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot navigate to add accounts 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,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const authorized_actions = instances.user.authorized_actions.filter(
|
||||
(item) => item !== 'add-accounts',
|
||||
);
|
||||
@@ -195,6 +277,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot add ldap accounts to user when feature flag is disabled', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const authMethod = this.server.create('auth-method', {
|
||||
scope: instances.scopes.org,
|
||||
type: TYPE_AUTH_METHOD_LDAP,
|
||||
@@ -219,6 +310,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('can add ldap accounts to user when feature flag is enabled', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
features.enable('ldap-auth-methods');
|
||||
const authMethod = this.server.create('auth-method', {
|
||||
scope: instances.scopes.org,
|
||||
@@ -244,6 +344,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('select and save accounts to add', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
instances.user.update({ accountIds: [] });
|
||||
await visit(urls.user);
|
||||
|
||||
@@ -268,6 +377,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('select and cancel accounts to add', 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.user);
|
||||
|
||||
await click(commonSelectors.HREF(urls.accounts));
|
||||
@@ -287,6 +405,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('shows error message on account add', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
this.server.post('/users/:idMethod', () => {
|
||||
return new Response(
|
||||
400,
|
||||
@@ -309,6 +436,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('can navigate to account link for password account', 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.user);
|
||||
await click(commonSelectors.HREF(urls.accounts));
|
||||
|
||||
@@ -323,6 +459,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('can navigate to account link for oidc account', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
this.server.schema.authMethods.all().destroy();
|
||||
this.server.schema.users.all().destroy();
|
||||
this.server.schema.accounts.all().destroy();
|
||||
@@ -352,6 +497,15 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('can navigate to account link for ldap account', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
this.server.schema.authMethods.all().destroy();
|
||||
this.server.schema.users.all().destroy();
|
||||
this.server.schema.accounts.all().destroy();
|
||||
|
||||
@@ -11,6 +11,7 @@ import { setupIndexedDb } from 'api/test-support/helpers/indexed-db';
|
||||
import { Response } from 'miragejs';
|
||||
import { authenticateSession } from 'ember-simple-auth/test-support';
|
||||
import * as commonSelectors from 'admin/tests/helpers/selectors';
|
||||
import { setRunOptions } from 'ember-a11y-testing/test-support';
|
||||
|
||||
module('Acceptance | users | create', function (hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
@@ -54,6 +55,15 @@ module('Acceptance | users | create', function (hooks) {
|
||||
});
|
||||
|
||||
test('can create new users', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const usersCount = getUsersCount();
|
||||
await visit(urls.users);
|
||||
|
||||
@@ -65,6 +75,15 @@ module('Acceptance | users | create', function (hooks) {
|
||||
});
|
||||
|
||||
test('users can navigate to new users 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(urls.orgScope);
|
||||
|
||||
await click(commonSelectors.HREF(urls.users));
|
||||
@@ -78,6 +97,15 @@ module('Acceptance | users | create', function (hooks) {
|
||||
});
|
||||
|
||||
test('users cannot navigate to new users route 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.scopes.org.authorized_collection_actions.users =
|
||||
instances.scopes.org.authorized_collection_actions.users.filter(
|
||||
(item) => item !== 'create',
|
||||
@@ -96,6 +124,15 @@ module('Acceptance | users | create', function (hooks) {
|
||||
});
|
||||
|
||||
test('can cancel creation of a new user', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const usersCount = getUsersCount();
|
||||
await visit(urls.users);
|
||||
|
||||
@@ -108,6 +145,15 @@ module('Acceptance | users | create', function (hooks) {
|
||||
});
|
||||
|
||||
test('saving a new user 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 usersCount = getUsersCount();
|
||||
const errorMessage =
|
||||
'Invalid request. Request attempted to make second resource with the same field value that must be unique.';
|
||||
@@ -136,6 +182,15 @@ module('Acceptance | users | create', function (hooks) {
|
||||
});
|
||||
|
||||
test('users cannot directly navigate to new user route 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.scopes.org.authorized_collection_actions.users =
|
||||
instances.scopes.org.authorized_collection_actions.users.filter(
|
||||
(item) => item !== 'create',
|
||||
|
||||
@@ -12,6 +12,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 | users | delete', function (hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
@@ -53,6 +54,15 @@ module('Acceptance | users | delete', function (hooks) {
|
||||
});
|
||||
|
||||
test('can delete a user', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const usersCount = getUsersCount();
|
||||
await visit(urls.users);
|
||||
|
||||
@@ -65,6 +75,15 @@ module('Acceptance | users | delete', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot delete a user 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.user.authorized_actions =
|
||||
instances.user.authorized_actions.filter((item) => item !== 'delete');
|
||||
await visit(urls.users);
|
||||
@@ -76,6 +95,15 @@ module('Acceptance | users | delete', function (hooks) {
|
||||
});
|
||||
|
||||
test('can accept delete user via dialog', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const usersCount = getUsersCount();
|
||||
confirmService.enabled = true;
|
||||
await visit(urls.users);
|
||||
@@ -93,6 +121,15 @@ module('Acceptance | users | delete', function (hooks) {
|
||||
});
|
||||
|
||||
test('can cancel delete user via dialog', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const usersCount = getUsersCount();
|
||||
confirmService.enabled = true;
|
||||
await visit(urls.users);
|
||||
@@ -107,6 +144,15 @@ module('Acceptance | users | delete', function (hooks) {
|
||||
});
|
||||
|
||||
test('errors are displayed when user deletion fails', 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.users);
|
||||
this.server.del('/users/:id', () => {
|
||||
return new Response(
|
||||
|
||||
@@ -19,6 +19,7 @@ import { authenticateSession } from 'ember-simple-auth/test-support';
|
||||
import * as commonSelectors from 'admin/tests/helpers/selectors';
|
||||
import * as selectors from './selectors';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import { setRunOptions } from 'ember-a11y-testing/test-support';
|
||||
|
||||
module('Acceptance | users | list', function (hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
@@ -63,6 +64,15 @@ module('Acceptance | users | list', function (hooks) {
|
||||
});
|
||||
|
||||
test('users can navigate to users 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(urls.globalScope);
|
||||
|
||||
await click(commonSelectors.HREF(urls.orgScope));
|
||||
@@ -79,6 +89,15 @@ module('Acceptance | users | list', function (hooks) {
|
||||
});
|
||||
|
||||
test('user cannot navigate to users tab without either list or create actions', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
instances.scopes.org.authorized_collection_actions.users = [];
|
||||
await visit(urls.globalScope);
|
||||
|
||||
@@ -96,6 +115,15 @@ module('Acceptance | users | list', function (hooks) {
|
||||
});
|
||||
|
||||
test('user can navigate to users tab with only create action', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
instances.scopes.org.authorized_collection_actions.users =
|
||||
instances.scopes.org.authorized_collection_actions.users.filter(
|
||||
(item) => item !== 'list',
|
||||
@@ -121,6 +149,15 @@ module('Acceptance | users | list', function (hooks) {
|
||||
});
|
||||
|
||||
test('user can navigate to users tab with only list action', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
instances.scopes.org.authorized_collection_actions.users =
|
||||
instances.scopes.org.authorized_collection_actions.users.filter(
|
||||
(item) => item !== 'create',
|
||||
@@ -145,6 +182,15 @@ module('Acceptance | users | list', function (hooks) {
|
||||
});
|
||||
|
||||
test('user can search for a user by id', 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.users));
|
||||
@@ -162,6 +208,15 @@ module('Acceptance | users | list', function (hooks) {
|
||||
});
|
||||
|
||||
test('user can search for users and get no results', 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.users));
|
||||
@@ -178,6 +233,15 @@ module('Acceptance | users | list', function (hooks) {
|
||||
});
|
||||
|
||||
test('users are sorted by created_time descending by default', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
this.server.schema.users.all().destroy();
|
||||
|
||||
const years = ['2026', '2025', '2024', '2023'];
|
||||
@@ -226,6 +290,15 @@ module('Acceptance | users | list', function (hooks) {
|
||||
},
|
||||
},
|
||||
async function (assert, input) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-04
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
this.server.schema.users.all().destroy();
|
||||
|
||||
faker.helpers.shuffle(input.attribute.values).forEach((value) => {
|
||||
|
||||
@@ -10,6 +10,7 @@ import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
||||
import { setupIndexedDb } from 'api/test-support/helpers/indexed-db';
|
||||
import { authenticateSession } from 'ember-simple-auth/test-support';
|
||||
import * as commonSelectors from 'admin/tests/helpers/selectors';
|
||||
import { setRunOptions } from 'ember-a11y-testing/test-support';
|
||||
|
||||
module('Acceptance | users | read', function (hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
@@ -46,6 +47,15 @@ module('Acceptance | users | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('visiting users', 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.users));
|
||||
@@ -54,6 +64,15 @@ module('Acceptance | users | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('visiting user', 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.users);
|
||||
|
||||
await click(commonSelectors.HREF(urls.user));
|
||||
@@ -62,6 +81,15 @@ module('Acceptance | users | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot navigate to an account form 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.user.authorized_actions =
|
||||
instances.user.authorized_actions.filter((item) => item !== 'read');
|
||||
await visit(urls.orgScope);
|
||||
@@ -72,6 +100,15 @@ module('Acceptance | users | read', function (hooks) {
|
||||
});
|
||||
|
||||
test('users can link to docs page for users', 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.users));
|
||||
|
||||
@@ -11,6 +11,7 @@ import { setupIndexedDb } from 'api/test-support/helpers/indexed-db';
|
||||
import { Response } from 'miragejs';
|
||||
import { authenticateSession } from 'ember-simple-auth/test-support';
|
||||
import * as commonSelectors from 'admin/tests/helpers/selectors';
|
||||
import { setRunOptions } from 'ember-a11y-testing/test-support';
|
||||
|
||||
module('Acceptance | users | update', function (hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
@@ -51,6 +52,15 @@ module('Acceptance | users | update', function (hooks) {
|
||||
});
|
||||
|
||||
test('can save changes to an existing user', 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.users);
|
||||
|
||||
await click(commonSelectors.HREF(urls.user));
|
||||
@@ -66,6 +76,15 @@ module('Acceptance | users | update', function (hooks) {
|
||||
});
|
||||
|
||||
test('cannot make changes to an existing user 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.user.authorized_actions =
|
||||
instances.user.authorized_actions.filter((item) => item !== 'update');
|
||||
await visit(urls.users);
|
||||
@@ -77,6 +96,15 @@ module('Acceptance | users | update', function (hooks) {
|
||||
});
|
||||
|
||||
test('can cancel changes to an existing user', 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.users);
|
||||
|
||||
await click(commonSelectors.HREF(urls.user));
|
||||
@@ -89,6 +117,15 @@ module('Acceptance | users | update', function (hooks) {
|
||||
});
|
||||
|
||||
test('saving an existing user 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 =
|
||||
'Invalid request. Request attempted to make second resource with the same field value that must be unique.';
|
||||
await visit(urls.users);
|
||||
@@ -113,6 +150,15 @@ module('Acceptance | users | update', function (hooks) {
|
||||
});
|
||||
|
||||
test('can discard unsaved user changes via dialog', async function (assert) {
|
||||
setRunOptions({
|
||||
rules: {
|
||||
'color-contrast': {
|
||||
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
confirmService.enabled = true;
|
||||
assert.notEqual(instances.user.name, commonSelectors.FIELD_NAME_VALUE);
|
||||
await visit(urls.user);
|
||||
|
||||
Reference in new issue
Block a user