diff --git a/ui/tests/acceptance/access-control-test.js b/ui/tests/acceptance/access-control-test.js index 1155b28f259..da7f717167b 100644 --- a/ui/tests/acceptance/access-control-test.js +++ b/ui/tests/acceptance/access-control-test.js @@ -4,13 +4,13 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { currentURL, triggerKeyEvent, click } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; import Administration from 'nomad-ui/tests/pages/administration'; import Tokens from 'nomad-ui/tests/pages/settings/tokens'; import { allScenarios } from '../../mirage/scenarios/default'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import faker from 'nomad-ui/mirage/faker'; // Several related tests within Access Control are contained in the Tokens, Roles, @@ -27,6 +27,20 @@ module('Acceptance | access control', function (hooks) { allScenarios.rolesTestCluster(this.server); }); + test('it passes an accessibility audit', async function (assert) { + try { + const managementToken = this.server.db.tokens.findBy({ + type: 'management', + }); + window.localStorage.nomadTokenSecret = managementToken.secretId; + await Administration.visit(); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + } finally { + window.localStorage.removeItem('nomadTokenSecret'); + } + }); + test('Access Control is only accessible by a management user', async function (assert) { await Administration.visit(); @@ -63,7 +77,6 @@ module('Acceptance | access control', function (hooks) { 'management token can access /administration', ); - await a11yAudit(assert); await Administration.visitTokens(); assert.deepEqual( diff --git a/ui/tests/acceptance/actions-test.js b/ui/tests/acceptance/actions-test.js index 70f0bc3b577..83e528638bb 100644 --- a/ui/tests/acceptance/actions-test.js +++ b/ui/tests/acceptance/actions-test.js @@ -3,10 +3,10 @@ * SPDX-License-Identifier: BUSL-1.1 */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; import Tokens from 'nomad-ui/tests/pages/settings/tokens'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Actions from 'nomad-ui/tests/pages/jobs/job/actions'; import { triggerEvent, visit, click } from '@ember/test-helpers'; import faker from 'nomad-ui/mirage/faker'; @@ -64,6 +64,22 @@ module('Acceptance | actions', function (hooks) { }); }); + test('it passes an accessibility audit', async function (assert) { + try { + const managementToken = this.server.create('token', { + type: 'management', + name: 'Management Token', + }); + await Tokens.visit(); + await Tokens.secret(managementToken.secretId).submit(); + await Actions.visitIndex({ id: 'actionable-job' }); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + } finally { + window.localStorage.removeItem('nomadTokenSecret'); + } + }); + test('Actions show up on the Job Index page, permissions allowing', async function (assert) { let managementToken = this.server.create('token', { type: 'management', @@ -113,7 +129,6 @@ module('Acceptance | actions', function (hooks) { ); assert.ok(Actions.taskRowActions.length, 'Task row has actions dropdowns'); - await a11yAudit(assert); // Sign out and sign back in as a token without alloc exec await Tokens.visit(); diff --git a/ui/tests/acceptance/administration-tokens-test.js b/ui/tests/acceptance/administration-tokens-test.js new file mode 100644 index 00000000000..5fea1a52f6e --- /dev/null +++ b/ui/tests/acceptance/administration-tokens-test.js @@ -0,0 +1,48 @@ +/** + * Copyright IBM Corp. 2015, 2026 + * SPDX-License-Identifier: BUSL-1.1 + */ + +import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; +import { visit } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import { setupMirage } from 'ember-cli-mirage/test-support'; +import { allScenarios } from '../../mirage/scenarios/default'; + +module('Acceptance | administration tokens', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + hooks.beforeEach(function () { + window.localStorage.clear(); + allScenarios.rolesTestCluster(this.server); + const managementToken = this.server.db.tokens.findBy({ + type: 'management', + }); + window.localStorage.nomadTokenSecret = managementToken.secretId; + }); + + hooks.afterEach(function () { + window.localStorage.clear(); + }); + + test('administration.tokens passes an accessibility audit', async function (assert) { + await visit('/administration/tokens'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('administration.tokens.new passes an accessibility audit', async function (assert) { + await visit('/administration/tokens/new'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('administration.tokens.token passes an accessibility audit', async function (assert) { + const token = this.server.db.tokens.findBy({ type: 'management' }); + await visit(`/administration/tokens/${token.id}`); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); +}); diff --git a/ui/tests/acceptance/allocation-detail-test.js b/ui/tests/acceptance/allocation-detail-test.js index 7b203c518ae..278d7529bee 100644 --- a/ui/tests/acceptance/allocation-detail-test.js +++ b/ui/tests/acceptance/allocation-detail-test.js @@ -14,9 +14,9 @@ import { waitUntil, } from '@ember/test-helpers'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Allocation from 'nomad-ui/tests/pages/allocations/detail'; import moment from 'moment'; import formatHost from 'nomad-ui/utils/format-host'; @@ -63,7 +63,8 @@ module('Acceptance | allocation detail', function (hooks) { }); test('it passes an accessibility audit', async function (assert) { - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/allocation/:id should name the allocation and link to the corresponding job and node', async function (assert) { diff --git a/ui/tests/acceptance/application-errors-test.js b/ui/tests/acceptance/application-errors-test.js index 852e8119604..052d4f77ec8 100644 --- a/ui/tests/acceptance/application-errors-test.js +++ b/ui/tests/acceptance/application-errors-test.js @@ -5,9 +5,9 @@ import { currentURL, visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import ClientsList from 'nomad-ui/tests/pages/clients/list'; import JobsList from 'nomad-ui/tests/pages/jobs/list'; import Job from 'nomad-ui/tests/pages/jobs/detail'; @@ -28,7 +28,8 @@ module('Acceptance | application errors ', function (hooks) { test('it passes an accessibility audit', async function (assert) { this.server.pretender.get('/v1/nodes', () => [500, {}, null]); await ClientsList.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('transitioning away from an error page resets the global error', async function (assert) { diff --git a/ui/tests/acceptance/behaviors/fs.js b/ui/tests/acceptance/behaviors/fs.js index bc15a886af7..2c9eb65483e 100644 --- a/ui/tests/acceptance/behaviors/fs.js +++ b/ui/tests/acceptance/behaviors/fs.js @@ -4,12 +4,12 @@ */ import { test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { getPageTitle } from 'ember-page-title/test-support'; import { currentURL, visit } from '@ember/test-helpers'; import { filesForPath } from 'nomad-ui/mirage/config'; import { formatBytes } from 'nomad-ui/utils/units'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { Response } from 'miragejs'; import moment from 'moment'; @@ -43,7 +43,8 @@ export default function browseFilesystem({ await FS[pageObjectVisitFunctionName]( visitSegments({ allocation: this.allocation, task: this.task }), ); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('visiting filesystem root', async function (assert) { diff --git a/ui/tests/acceptance/client-detail-test.js b/ui/tests/acceptance/client-detail-test.js index 95c72629ad2..bcde257a987 100644 --- a/ui/tests/acceptance/client-detail-test.js +++ b/ui/tests/acceptance/client-detail-test.js @@ -15,9 +15,9 @@ import { findAll, } from '@ember/test-helpers'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { formatBytes, formatHertz } from 'nomad-ui/utils/units'; import moment from 'moment'; import ClientDetail from 'nomad-ui/tests/pages/clients/detail'; @@ -70,7 +70,8 @@ module('Acceptance | client detail', function (hooks) { test('it passes an accessibility audit', async function (assert) { await ClientDetail.visit({ id: node.id }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/clients/:id should have a breadcrumb trail linking back to clients', async function (assert) { diff --git a/ui/tests/acceptance/client-monitor-test.js b/ui/tests/acceptance/client-monitor-test.js index 8add0f62bf4..f8fecab16ce 100644 --- a/ui/tests/acceptance/client-monitor-test.js +++ b/ui/tests/acceptance/client-monitor-test.js @@ -6,9 +6,9 @@ import { currentURL } from '@ember/test-helpers'; import { later, cancelTimers } from '@ember/runloop'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import ClientMonitor from 'nomad-ui/tests/pages/clients/monitor'; import Layout from 'nomad-ui/tests/pages/layout'; @@ -35,7 +35,8 @@ module.skip('Acceptance | client monitor', function (hooks) { test('it passes an accessibility audit', async function (assert) { await ClientMonitor.visit({ id: node.id }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/clients/:id/monitor should have a breadcrumb trail linking back to clients', async function (assert) { diff --git a/ui/tests/acceptance/clients-list-test.js b/ui/tests/acceptance/clients-list-test.js index e2557d71379..1981c4c470c 100644 --- a/ui/tests/acceptance/clients-list-test.js +++ b/ui/tests/acceptance/clients-list-test.js @@ -6,9 +6,9 @@ import { currentURL, settled } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import pageSizeSelect from './behaviors/page-size-select'; import ClientsList from 'nomad-ui/tests/pages/clients/list'; import faker from 'nomad-ui/mirage/faker'; @@ -29,7 +29,8 @@ module('Acceptance | clients list', function (hooks) { this.server.createList('agent', 1); await ClientsList.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/clients should list one page of clients', async function (assert) { diff --git a/ui/tests/acceptance/dynamic-host-volume-detail-test.js b/ui/tests/acceptance/dynamic-host-volume-detail-test.js index 7188c00e017..899d4b49f36 100644 --- a/ui/tests/acceptance/dynamic-host-volume-detail-test.js +++ b/ui/tests/acceptance/dynamic-host-volume-detail-test.js @@ -4,11 +4,11 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { currentURL } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import setupAuthenticatedAcceptance from 'nomad-ui/tests/helpers/setup-authenticated-acceptance'; import moment from 'moment'; import { formatBytes, formatHertz } from 'nomad-ui/utils/units'; @@ -42,7 +42,8 @@ module('Acceptance | dynamic host volume detail', function (hooks) { test('it passes an accessibility audit', async function (assert) { await VolumeDetail.visit({ id: `${volume.id}@default` }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/storage/volumes/:id should have a breadcrumb trail linking back to Volumes and Storage', async function (assert) { diff --git a/ui/tests/acceptance/evaluations-test.js b/ui/tests/acceptance/evaluations-test.js index 0a003e7466d..9855867bb46 100644 --- a/ui/tests/acceptance/evaluations-test.js +++ b/ui/tests/acceptance/evaluations-test.js @@ -13,10 +13,10 @@ import { waitUntil, } from '@ember/test-helpers'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; import { Response } from 'miragejs'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { selectChoose } from 'ember-power-select/test-support'; import { clickTrigger } from 'ember-power-select/test-support/helpers'; import { generateAcceptanceTestEvalMock } from '../../mirage/utils'; @@ -119,8 +119,8 @@ module('Acceptance | evaluations list', function (hooks) { 'evaluations.index', 'The default route in evaluations is evaluations index', ); - - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('it renders an empty message if there are no evaluations rendered', async function (assert) { diff --git a/ui/tests/acceptance/exec-test.js b/ui/tests/acceptance/exec-test.js index 34fc438afcf..4ae6d615b6c 100644 --- a/ui/tests/acceptance/exec-test.js +++ b/ui/tests/acceptance/exec-test.js @@ -4,11 +4,11 @@ */ import { module, skip, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { getPageTitle } from 'ember-page-title/test-support'; import { currentURL, settled } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Service from '@ember/service'; import Exec from 'nomad-ui/tests/pages/exec'; import KEYS from 'nomad-ui/utils/keys'; @@ -50,7 +50,8 @@ module('Acceptance | exec', function (hooks) { test('it passes an accessibility audit', async function (assert) { await Exec.visitJob({ job: this.job.id }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/exec/:job should show the region, namespace, and job name', async function (assert) { diff --git a/ui/tests/acceptance/global-header-test.js b/ui/tests/acceptance/global-header-test.js index de2d6771f38..455e8693ed9 100644 --- a/ui/tests/acceptance/global-header-test.js +++ b/ui/tests/acceptance/global-header-test.js @@ -4,6 +4,7 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { click, visit, currentURL } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; @@ -15,6 +16,13 @@ module('Acceptance | global header', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); + test('it passes an accessibility audit', async function (assert) { + this.server.create('agent'); + await visit('/'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + test('it diplays no links', async function (assert) { this.server.create('agent'); diff --git a/ui/tests/acceptance/job-allocations-test.js b/ui/tests/acceptance/job-allocations-test.js index 1ab34bb4334..3004f3f4dd2 100644 --- a/ui/tests/acceptance/job-allocations-test.js +++ b/ui/tests/acceptance/job-allocations-test.js @@ -6,9 +6,9 @@ import { currentURL, click } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Allocations from 'nomad-ui/tests/pages/jobs/job/allocations'; import moment from 'moment'; @@ -49,7 +49,8 @@ module('Acceptance | job allocations', function (hooks) { }).models; await Allocations.visit({ id: job.id }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('lists all allocations for the job', async function (assert) { diff --git a/ui/tests/acceptance/job-clients-test.js b/ui/tests/acceptance/job-clients-test.js index 0208870c7b4..881b91a418b 100644 --- a/ui/tests/acceptance/job-clients-test.js +++ b/ui/tests/acceptance/job-clients-test.js @@ -6,9 +6,9 @@ import { currentURL } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Clients from 'nomad-ui/tests/pages/jobs/job/clients'; import setPolicy from 'nomad-ui/tests/utils/set-policy'; @@ -71,7 +71,8 @@ module('Acceptance | job clients', function (hooks) { test('it passes an accessibility audit', async function (assert) { await Clients.visit({ id: job.id }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('lists all clients for the job', async function (assert) { diff --git a/ui/tests/acceptance/job-definition-test.js b/ui/tests/acceptance/job-definition-test.js index 5b9d29540ef..0915f51e8be 100644 --- a/ui/tests/acceptance/job-definition-test.js +++ b/ui/tests/acceptance/job-definition-test.js @@ -7,9 +7,9 @@ import { click, currentURL, waitUntil } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import faker from 'nomad-ui/mirage/faker'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import setupCodeMirror from 'nomad-ui/tests/helpers/codemirror'; import Definition from 'nomad-ui/tests/pages/jobs/job/definition'; import { JOB_JSON } from 'nomad-ui/tests/utils/generate-raw-json-job'; @@ -31,7 +31,8 @@ module('Acceptance | job definition', function (hooks) { }); test('it passes an accessibility audit', async function (assert) { - await a11yAudit(assert, 'scrollable-region-focusable'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('visiting /jobs/:job_id/definition', async function (assert) { diff --git a/ui/tests/acceptance/job-deployments-test.js b/ui/tests/acceptance/job-deployments-test.js index 6c3d6b8ff32..df050964a64 100644 --- a/ui/tests/acceptance/job-deployments-test.js +++ b/ui/tests/acceptance/job-deployments-test.js @@ -7,9 +7,9 @@ import { currentURL } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { get } from '@ember/object'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import moment from 'moment'; import Deployments from 'nomad-ui/tests/pages/jobs/job/deployments'; @@ -49,7 +49,8 @@ module('Acceptance | job deployments', function (hooks) { test('it passes an accessibility audit', async function (assert) { await Deployments.visit({ id: job.id }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/jobs/:id/deployments should list all job deployments', async function (assert) { diff --git a/ui/tests/acceptance/job-detail-test.js b/ui/tests/acceptance/job-detail-test.js index 4290df38c46..b0b1c4e3884 100644 --- a/ui/tests/acceptance/job-detail-test.js +++ b/ui/tests/acceptance/job-detail-test.js @@ -7,10 +7,10 @@ import { currentURL, settled } from '@ember/test-helpers'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; import moment from 'moment'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import moduleForJob, { moduleForJobWithClientStatus, } from 'nomad-ui/tests/helpers/module-for-job'; @@ -523,7 +523,8 @@ module('Acceptance | job detail (with namespaces)', function (hooks) { test('it passes an accessibility audit', async function (assert) { const namespace = this.server.db.namespaces.find(job.namespaceId); await JobDetail.visit({ id: `${job.id}@${namespace.name}` }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('when there are namespaces, the job detail page states the namespace for the job', async function (assert) { diff --git a/ui/tests/acceptance/job-dispatch-test.js b/ui/tests/acceptance/job-dispatch-test.js index 80f3019d2ae..648b9060544 100644 --- a/ui/tests/acceptance/job-dispatch-test.js +++ b/ui/tests/acceptance/job-dispatch-test.js @@ -6,12 +6,12 @@ /* eslint-disable ember/no-test-module-for */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; import setupCodeMirror from 'nomad-ui/tests/helpers/codemirror'; import JobDispatch from 'nomad-ui/tests/pages/jobs/dispatch'; import JobDetail from 'nomad-ui/tests/pages/jobs/detail'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { currentURL, waitFor, waitUntil } from '@ember/test-helpers'; const REQUIRED_INDICATOR = '*'; @@ -60,7 +60,8 @@ function moduleForJobDispatch(title, jobFactory) { test('it passes an accessibility audit', async function (assert) { await JobDispatch.visit({ id: `${job.id}@${namespace.name}` }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('the dispatch button is displayed with management token', async function (assert) { diff --git a/ui/tests/acceptance/job-evaluations-test.js b/ui/tests/acceptance/job-evaluations-test.js index 32f1e568dd1..6d16c0ee575 100644 --- a/ui/tests/acceptance/job-evaluations-test.js +++ b/ui/tests/acceptance/job-evaluations-test.js @@ -6,9 +6,9 @@ import { currentURL } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Evaluations from 'nomad-ui/tests/pages/jobs/job/evaluations'; let job; @@ -30,7 +30,8 @@ module('Acceptance | job evaluations', function (hooks) { }); test('it passes an accessibility audit', async function (assert) { - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('lists all evaluations for the job', async function (assert) { diff --git a/ui/tests/acceptance/job-run-templates-test.js b/ui/tests/acceptance/job-run-templates-test.js new file mode 100644 index 00000000000..cb33e7f1088 --- /dev/null +++ b/ui/tests/acceptance/job-run-templates-test.js @@ -0,0 +1,46 @@ +/** + * Copyright IBM Corp. 2015, 2026 + * SPDX-License-Identifier: BUSL-1.1 + */ + +import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; +import { visit } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import { setupMirage } from 'ember-cli-mirage/test-support'; + +module('Acceptance | job run templates', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + hooks.beforeEach(function () { + window.localStorage.clear(); + this.server.create('agent'); + this.server.create('node-pool'); + this.server.create('node'); + const managementToken = this.server.create('token', { type: 'management' }); + window.localStorage.nomadTokenSecret = managementToken.secretId; + }); + + hooks.afterEach(function () { + window.localStorage.clear(); + }); + + test('jobs.run.templates passes an accessibility audit', async function (assert) { + await visit('/jobs/run/templates'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('jobs.run.templates.new passes an accessibility audit', async function (assert) { + await visit('/jobs/run/templates/new'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('jobs.run.templates.manage passes an accessibility audit', async function (assert) { + await visit('/jobs/run/templates/manage'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); +}); diff --git a/ui/tests/acceptance/job-run-test.js b/ui/tests/acceptance/job-run-test.js index ea6aa453a7c..1b53bb9be7f 100644 --- a/ui/tests/acceptance/job-run-test.js +++ b/ui/tests/acceptance/job-run-test.js @@ -15,11 +15,11 @@ import { waitUntil, } from '@ember/test-helpers'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { selectChoose } from 'ember-power-select/test-support'; import { clickTrigger } from 'ember-power-select/test-support/helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import setupCodeMirror from 'nomad-ui/tests/helpers/codemirror'; import JobRun from 'nomad-ui/tests/pages/jobs/run'; import faker from 'nomad-ui/mirage/faker'; @@ -79,7 +79,8 @@ module('Acceptance | job run', function (hooks) { test('it passes an accessibility audit', async function (assert) { await JobRun.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('visiting /jobs/run', async function (assert) { diff --git a/ui/tests/acceptance/job-services-test.js b/ui/tests/acceptance/job-services-test.js index dfe1d782465..5b9eb379361 100644 --- a/ui/tests/acceptance/job-services-test.js +++ b/ui/tests/acceptance/job-services-test.js @@ -4,12 +4,12 @@ */ import { module, test } from 'qunit'; -import { find, findAll, currentURL, settled } from '@ember/test-helpers'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; +import { find, findAll, currentURL, settled, visit } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; import { allScenarios } from '../../mirage/scenarios/default'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Services from 'nomad-ui/tests/pages/jobs/job/services'; module('Acceptance | job services', function (hooks) { @@ -20,10 +20,23 @@ module('Acceptance | job services', function (hooks) { await Services.visit({ id: 'service-haver@default' }); }); + test('it passes an accessibility audit', async function (assert) { + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('jobs.job.services.service passes an accessibility audit', async function (assert) { + const serviceName = find( + '[data-test-service-level="group"][data-test-service-provider="nomad"]', + ).getAttribute('data-test-service-name'); + await visit(`/jobs/service-haver@default/services/${serviceName}`); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + test('Visiting job services', async function (assert) { assert.dom('.tabs.is-subnav a.is-active').hasText('Services'); assert.dom('.service-list table').exists(); - await a11yAudit(assert); }); test('it shows both consul and nomad, and both task and group services', async function (assert) { diff --git a/ui/tests/acceptance/job-status-panel-test.js b/ui/tests/acceptance/job-status-panel-test.js index d03327a0837..e05cb4d7d00 100644 --- a/ui/tests/acceptance/job-status-panel-test.js +++ b/ui/tests/acceptance/job-status-panel-test.js @@ -4,6 +4,7 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { @@ -18,7 +19,6 @@ import { import { setupMirage } from 'ember-cli-mirage/test-support'; import faker from 'nomad-ui/mirage/faker'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; // TODO: Mirage is not type-friendly / assigns "server" as a global. Try to work around this shortcoming. module('Acceptance | job status panel', function (hooks) { @@ -30,6 +30,20 @@ module('Acceptance | job status panel', function (hooks) { this.server.create('node'); }); + test('it passes an accessibility audit', async function (assert) { + faker.seed(1); + const job = this.server.create('job', { + status: 'running', + datacenters: ['*'], + type: 'service', + createAllocations: true, + noDeployments: true, + }); + await visit(`/jobs/${job.id}`); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + test('Status panel lets you switch between Current and Historical', async function (assert) { faker.seed(1); let job = this.server.create('job', { @@ -42,7 +56,6 @@ module('Acceptance | job status panel', function (hooks) { await visit(`/jobs/${job.id}`); assert.dom('.job-status-panel').exists(); - await a11yAudit(assert); assert .dom('[data-test-status-mode="current"]') diff --git a/ui/tests/acceptance/job-versions-test.js b/ui/tests/acceptance/job-versions-test.js index 65dbe3a8ba9..5766bd2382b 100644 --- a/ui/tests/acceptance/job-versions-test.js +++ b/ui/tests/acceptance/job-versions-test.js @@ -12,9 +12,9 @@ import { } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Versions from 'nomad-ui/tests/pages/jobs/job/versions'; import Layout from 'nomad-ui/tests/pages/layout'; import moment from 'moment'; @@ -62,7 +62,8 @@ module('Acceptance | job versions', function (hooks) { }); test('it passes an accessibility audit', async function (assert) { - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/jobs/:id/versions should list all job versions', async function (assert) { diff --git a/ui/tests/acceptance/jobs-list-test.js b/ui/tests/acceptance/jobs-list-test.js index 7b96e9b39b2..fe70ec2bb31 100644 --- a/ui/tests/acceptance/jobs-list-test.js +++ b/ui/tests/acceptance/jobs-list-test.js @@ -14,9 +14,9 @@ import { waitUntil, } from '@ember/test-helpers'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import pageSizeSelect from './behaviors/page-size-select'; import JobsList from 'nomad-ui/tests/pages/jobs/list'; import faker from 'nomad-ui/mirage/faker'; @@ -41,7 +41,8 @@ module('Acceptance | jobs list', function (hooks) { test('it passes an accessibility audit', async function (assert) { await JobsList.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('visiting /jobs', async function (assert) { diff --git a/ui/tests/acceptance/keyboard-test.js b/ui/tests/acceptance/keyboard-test.js index 024a260a5b9..bd346672fb0 100644 --- a/ui/tests/acceptance/keyboard-test.js +++ b/ui/tests/acceptance/keyboard-test.js @@ -4,6 +4,7 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { click, @@ -15,13 +16,18 @@ import { } from '@ember/test-helpers'; import { setupMirage } from 'ember-cli-mirage/test-support'; import Layout from 'nomad-ui/tests/pages/layout'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import faker from 'nomad-ui/mirage/faker'; module('Acceptance | keyboard', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); + test('it passes an accessibility audit', async function (assert) { + await visit('/'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + module('modal', function () { test('Opening and closing shortcuts modal with key commands', async function (assert) { faker.seed(1); @@ -29,7 +35,6 @@ module('Acceptance | keyboard', function (hooks) { assert.notOk(Layout.keyboard.modalShown); await triggerEvent('.page-layout', 'keydown', { key: '?' }); assert.ok(Layout.keyboard.modalShown); - await a11yAudit(assert); await triggerEvent('.page-layout', 'keydown', { key: 'Escape' }); assert.notOk(Layout.keyboard.modalShown); }); diff --git a/ui/tests/acceptance/namespaces-test.js b/ui/tests/acceptance/namespaces-test.js index 854651cfa3e..b33e555d685 100644 --- a/ui/tests/acceptance/namespaces-test.js +++ b/ui/tests/acceptance/namespaces-test.js @@ -4,6 +4,7 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { visit, currentURL, @@ -16,7 +17,6 @@ import { setupApplicationTest } from 'ember-qunit'; import { allScenarios } from '../../mirage/scenarios/default'; import { setupMirage } from 'ember-cli-mirage/test-support'; import faker from 'nomad-ui/mirage/faker'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; module('Acceptance | namespaces', function (hooks) { setupApplicationTest(hooks); @@ -26,6 +26,34 @@ module('Acceptance | namespaces', function (hooks) { faker.seed(1); }); + test('it passes an accessibility audit', async function (assert) { + allScenarios.namespacesTestCluster(this.server); + window.localStorage.nomadTokenSecret = this.server.db.tokens[0].secretId; + await visit('/administration/namespaces'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + window.localStorage.nomadTokenSecret = null; + }); + + test('administration.namespaces.new passes an accessibility audit', async function (assert) { + allScenarios.namespacesTestCluster(this.server); + window.localStorage.nomadTokenSecret = this.server.db.tokens[0].secretId; + await visit('/administration/namespaces/new'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + window.localStorage.nomadTokenSecret = null; + }); + + test('administration.namespaces.acl-namespace passes an accessibility audit', async function (assert) { + allScenarios.namespacesTestCluster(this.server); + window.localStorage.nomadTokenSecret = this.server.db.tokens[0].secretId; + const namespace = this.server.db.namespaces[0]; + await visit(`/administration/namespaces/${namespace.name}`); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + window.localStorage.nomadTokenSecret = null; + }); + test('Namespaces index, general', async function (assert) { allScenarios.namespacesTestCluster(this.server); window.localStorage.nomadTokenSecret = this.server.db.tokens[0].secretId; @@ -35,7 +63,6 @@ module('Acceptance | namespaces', function (hooks) { assert .dom('[data-test-namespace-row]') .exists({ count: this.server.db.namespaces.length }); - await a11yAudit(assert); // Reset Token window.localStorage.nomadTokenSecret = null; }); diff --git a/ui/tests/acceptance/not-found-test.js b/ui/tests/acceptance/not-found-test.js new file mode 100644 index 00000000000..b8f6d26652b --- /dev/null +++ b/ui/tests/acceptance/not-found-test.js @@ -0,0 +1,25 @@ +/** + * Copyright IBM Corp. 2015, 2026 + * SPDX-License-Identifier: BUSL-1.1 + */ + +import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; +import { visit } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import { setupMirage } from 'ember-cli-mirage/test-support'; + +module('Acceptance | not found', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + hooks.beforeEach(function () { + this.server.create('agent'); + }); + + test('not-found route passes an accessibility audit', async function (assert) { + await visit('/this-route-definitely-does-not-exist'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); +}); diff --git a/ui/tests/acceptance/optimize-test.js b/ui/tests/acceptance/optimize-test.js index c1f108e333c..0856d12a5a0 100644 --- a/ui/tests/acceptance/optimize-test.js +++ b/ui/tests/acceptance/optimize-test.js @@ -4,10 +4,10 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { currentURL, visit, waitUntil } from '@ember/test-helpers'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { Response } from 'miragejs'; import moment from 'moment'; import { formatBytes, formatHertz, replaceMinus } from 'nomad-ui/utils/units'; @@ -68,7 +68,16 @@ module('Acceptance | optimize', function (hooks) { test('it passes an accessibility audit', async function (assert) { await Optimize.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('optimize.summary passes an accessibility audit', async function (assert) { + await Optimize.visit(); + const summary = Optimize.recommendationSummaries[0]; + await visit(`/optimize/${summary.slug}`); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('lets recommendations be toggled, reports the choices to the recommendations API, and displays task group recommendations serially', async function (assert) { diff --git a/ui/tests/acceptance/plugin-allocations-test.js b/ui/tests/acceptance/plugin-allocations-test.js index e011975806b..518628d469c 100644 --- a/ui/tests/acceptance/plugin-allocations-test.js +++ b/ui/tests/acceptance/plugin-allocations-test.js @@ -4,10 +4,10 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { currentURL } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import setupAuthenticatedAcceptance from 'nomad-ui/tests/helpers/setup-authenticated-acceptance'; import pageSizeSelect from './behaviors/page-size-select'; import PluginAllocations from 'nomad-ui/tests/pages/storage/plugins/plugin/allocations'; @@ -34,7 +34,8 @@ module('Acceptance | plugin allocations', function (hooks) { }); await PluginAllocations.visit({ id: plugin.id }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/storage/plugins/:id/allocations shows all allocations in a single table', async function (assert) { diff --git a/ui/tests/acceptance/plugin-detail-test.js b/ui/tests/acceptance/plugin-detail-test.js index cf32301a1a4..3fcd1bc47ea 100644 --- a/ui/tests/acceptance/plugin-detail-test.js +++ b/ui/tests/acceptance/plugin-detail-test.js @@ -4,11 +4,11 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { getPageTitle } from 'ember-page-title/test-support'; import { currentURL } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import setupAuthenticatedAcceptance from 'nomad-ui/tests/helpers/setup-authenticated-acceptance'; import moment from 'moment'; import { formatBytes, formatHertz } from 'nomad-ui/utils/units'; @@ -30,7 +30,8 @@ module('Acceptance | plugin detail', function (hooks) { test('it passes an accessibility audit', async function (assert) { await PluginDetail.visit({ id: plugin.id }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/storage/plugins/:id should have a breadcrumb trail linking back to Plugins and Storage', async function (assert) { diff --git a/ui/tests/acceptance/plugins-list-test.js b/ui/tests/acceptance/plugins-list-test.js index ffd3ea88581..87a41e56e35 100644 --- a/ui/tests/acceptance/plugins-list-test.js +++ b/ui/tests/acceptance/plugins-list-test.js @@ -6,9 +6,9 @@ import { currentURL } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import setupAuthenticatedAcceptance from 'nomad-ui/tests/helpers/setup-authenticated-acceptance'; import pageSizeSelect from './behaviors/page-size-select'; import PluginsList from 'nomad-ui/tests/pages/storage/plugins/list'; @@ -26,7 +26,8 @@ module('Acceptance | plugins list', function (hooks) { test('it passes an accessibility audit', async function (assert) { await PluginsList.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('visiting /storage/plugins', async function (assert) { diff --git a/ui/tests/acceptance/policies-test.js b/ui/tests/acceptance/policies-test.js index 6f7801d1399..5e6c88fe517 100644 --- a/ui/tests/acceptance/policies-test.js +++ b/ui/tests/acceptance/policies-test.js @@ -4,6 +4,7 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { visit, currentURL, @@ -16,7 +17,6 @@ import { setupApplicationTest } from 'ember-qunit'; import { allScenarios } from '../../mirage/scenarios/default'; import { setupMirage } from 'ember-cli-mirage/test-support'; import faker from 'nomad-ui/mirage/faker'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; module('Acceptance | policies', function (hooks) { setupApplicationTest(hooks); @@ -26,6 +26,34 @@ module('Acceptance | policies', function (hooks) { faker.seed(1); }); + test('it passes an accessibility audit', async function (assert) { + allScenarios.policiesTestCluster(this.server); + window.localStorage.nomadTokenSecret = this.server.db.tokens[0].secretId; + await visit('/administration/policies'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + window.localStorage.nomadTokenSecret = null; + }); + + test('administration.policies.new passes an accessibility audit', async function (assert) { + allScenarios.policiesTestCluster(this.server); + window.localStorage.nomadTokenSecret = this.server.db.tokens[0].secretId; + await visit('/administration/policies/new'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + window.localStorage.nomadTokenSecret = null; + }); + + test('administration.policies.policy passes an accessibility audit', async function (assert) { + allScenarios.policiesTestCluster(this.server); + window.localStorage.nomadTokenSecret = this.server.db.tokens[0].secretId; + const policy = this.server.db.policies[0]; + await visit(`/administration/policies/${policy.name}`); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + window.localStorage.nomadTokenSecret = null; + }); + test('Policies index route looks good', async function (assert) { allScenarios.policiesTestCluster(this.server); window.localStorage.nomadTokenSecret = this.server.db.tokens[0].secretId; @@ -35,7 +63,6 @@ module('Acceptance | policies', function (hooks) { assert .dom('[data-test-policy-row]') .exists({ count: this.server.db.policies.length }); - await a11yAudit(assert); // Reset Token window.localStorage.nomadTokenSecret = null; }); diff --git a/ui/tests/acceptance/proxy-test.js b/ui/tests/acceptance/proxy-test.js index 50db89d53c1..3a4053152ae 100644 --- a/ui/tests/acceptance/proxy-test.js +++ b/ui/tests/acceptance/proxy-test.js @@ -5,6 +5,7 @@ // Tests for non-UI behaviour. import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; import Jobs from 'nomad-ui/tests/pages/jobs/list'; @@ -57,6 +58,12 @@ module('Acceptance | reverse proxy', function (hooks) { XMLHttpRequest.prototype.send = this._originalXMLHttpRequestSend; }); + test('it passes an accessibility audit', async function (assert) { + await Jobs.visit(); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + test('when token is inserted by a reverse proxy, the UI is adjusted', async function (assert) { // when token is inserted by reserve proxy, the token is reverse proxy const { secretId } = managementToken; diff --git a/ui/tests/acceptance/regions-test.js b/ui/tests/acceptance/regions-test.js index 2aff63e3ec7..7b38366667c 100644 --- a/ui/tests/acceptance/regions-test.js +++ b/ui/tests/acceptance/regions-test.js @@ -6,10 +6,10 @@ import { currentURL, settled } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { selectChoose } from 'ember-power-select/test-support'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import JobsList from 'nomad-ui/tests/pages/jobs/list'; import ClientsList from 'nomad-ui/tests/pages/clients/list'; import Layout from 'nomad-ui/tests/pages/layout'; @@ -32,7 +32,8 @@ module('Acceptance | regions (only one)', function (hooks) { test('it passes an accessibility audit', async function (assert) { await JobsList.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('when there is only one region, and it is the default one, the region switcher is not shown in the nav bar and the region is not in the page title', async function (assert) { diff --git a/ui/tests/acceptance/roles-test.js b/ui/tests/acceptance/roles-test.js index dffa19e1338..f92b80da3f7 100644 --- a/ui/tests/acceptance/roles-test.js +++ b/ui/tests/acceptance/roles-test.js @@ -4,10 +4,10 @@ */ import { module, test } from 'qunit'; -import { findAll, fillIn, find, click, currentURL } from '@ember/test-helpers'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; +import { findAll, fillIn, find, click, currentURL, visit } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { allScenarios } from '../../mirage/scenarios/default'; import Tokens from 'nomad-ui/tests/pages/settings/tokens'; import Administration from 'nomad-ui/tests/pages/administration'; @@ -36,8 +36,25 @@ module('Acceptance | roles', function (hooks) { await Tokens.clear(); }); + test('it passes an accessibility audit', async function (assert) { + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('administration.roles.new passes an accessibility audit', async function (assert) { + await visit('/administration/roles/new'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('administration.roles.role passes an accessibility audit', async function (assert) { + const role = this.server.db.roles.findBy({ name: 'reader' }); + await visit(`/administration/roles/${role.id}`); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + test('Roles index, general', async function (assert) { - await a11yAudit(assert); assert.deepEqual(currentURL(), '/administration/roles'); diff --git a/ui/tests/acceptance/search-test.js b/ui/tests/acceptance/search-test.js index 272b2aac8fa..1b8034f223e 100644 --- a/ui/tests/acceptance/search-test.js +++ b/ui/tests/acceptance/search-test.js @@ -4,6 +4,7 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { currentURL, triggerEvent, visit } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; @@ -16,6 +17,14 @@ module('Acceptance | search', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); + test('it passes an accessibility audit', async function (assert) { + this.server.create('node-pool'); + this.server.create('agent'); + await visit('/'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + test('search exposes and navigates to results from the fuzzy search endpoint', async function (assert) { this.server.create('node-pool'); this.server.create('node', { name: 'xyz' }); diff --git a/ui/tests/acceptance/sentinel-policies-test.js b/ui/tests/acceptance/sentinel-policies-test.js index aa65899120a..afc728165f9 100644 --- a/ui/tests/acceptance/sentinel-policies-test.js +++ b/ui/tests/acceptance/sentinel-policies-test.js @@ -4,10 +4,10 @@ */ import { module, test } from 'qunit'; -import { findAll, fillIn, find, click, currentURL } from '@ember/test-helpers'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; +import { findAll, fillIn, find, click, currentURL, visit } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { allScenarios } from '../../mirage/scenarios/default'; import Tokens from 'nomad-ui/tests/pages/settings/tokens'; import Administration from 'nomad-ui/tests/pages/administration'; @@ -36,8 +36,31 @@ module('Acceptance | sentinel policies', function (hooks) { await Tokens.clear(); }); + test('it passes an accessibility audit', async function (assert) { + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('administration.sentinel-policies.new passes an accessibility audit', async function (assert) { + await visit('/administration/sentinel-policies/new'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('administration.sentinel-policies.gallery passes an accessibility audit', async function (assert) { + await visit('/administration/sentinel-policies/gallery'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('administration.sentinel-policies.policy passes an accessibility audit', async function (assert) { + const policy = this.server.db.sentinelPolicies[0]; + await visit(`/administration/sentinel-policies/${policy.name}`); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + test('Sentinel Policies index, general', async function (assert) { - await a11yAudit(assert); assert.deepEqual(currentURL(), '/administration/sentinel-policies'); assert diff --git a/ui/tests/acceptance/server-detail-test.js b/ui/tests/acceptance/server-detail-test.js index 7fdd7e97383..6920c31a097 100644 --- a/ui/tests/acceptance/server-detail-test.js +++ b/ui/tests/acceptance/server-detail-test.js @@ -6,9 +6,9 @@ import { currentURL } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import ServerDetail from 'nomad-ui/tests/pages/servers/detail'; import formatHost from 'nomad-ui/utils/format-host'; @@ -29,7 +29,8 @@ module('Acceptance | server detail', function (hooks) { }); test('it passes an accessibility audit', async function (assert) { - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('visiting /servers/:server_name', async function (assert) { diff --git a/ui/tests/acceptance/server-monitor-test.js b/ui/tests/acceptance/server-monitor-test.js index c2f004e5b1a..2c683d18af5 100644 --- a/ui/tests/acceptance/server-monitor-test.js +++ b/ui/tests/acceptance/server-monitor-test.js @@ -6,9 +6,9 @@ import { currentURL } from '@ember/test-helpers'; import { later, cancelTimers } from '@ember/runloop'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import ServerMonitor from 'nomad-ui/tests/pages/servers/monitor'; import Layout from 'nomad-ui/tests/pages/layout'; @@ -33,7 +33,8 @@ module.skip('Acceptance | server monitor', function (hooks) { test('it passes an accessibility audit', async function (assert) { await ServerMonitor.visit({ name: agent.name }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/servers/:id/monitor should have a breadcrumb trail linking back to servers', async function (assert) { diff --git a/ui/tests/acceptance/servers-list-test.js b/ui/tests/acceptance/servers-list-test.js index 44cb3aff9c8..e0a7635059d 100644 --- a/ui/tests/acceptance/servers-list-test.js +++ b/ui/tests/acceptance/servers-list-test.js @@ -6,9 +6,9 @@ import { currentURL } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { findLeader } from '../../mirage/config'; import ServersList from 'nomad-ui/tests/pages/servers/list'; import formatHost from 'nomad-ui/utils/format-host'; @@ -41,7 +41,8 @@ module('Acceptance | servers list', function (hooks) { test('it passes an accessibility audit', async function (assert) { minimumSetup(this.server); await ServersList.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/servers should list all servers', async function (assert) { diff --git a/ui/tests/acceptance/settings-test.js b/ui/tests/acceptance/settings-test.js new file mode 100644 index 00000000000..3aab8d8d41e --- /dev/null +++ b/ui/tests/acceptance/settings-test.js @@ -0,0 +1,38 @@ +/** + * Copyright IBM Corp. 2015, 2026 + * SPDX-License-Identifier: BUSL-1.1 + */ + +import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; +import { visit } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import { setupMirage } from 'ember-cli-mirage/test-support'; + +module('Acceptance | settings', function (hooks) { + setupApplicationTest(hooks); + setupMirage(hooks); + + hooks.beforeEach(function () { + window.localStorage.clear(); + this.server.create('agent'); + }); + + test('settings index passes an accessibility audit', async function (assert) { + await visit('/settings'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('settings.tokens passes an accessibility audit', async function (assert) { + await visit('/settings/tokens'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('settings.user-settings passes an accessibility audit', async function (assert) { + await visit('/settings/user-settings'); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); +}); diff --git a/ui/tests/acceptance/storage-list-test.js b/ui/tests/acceptance/storage-list-test.js index fb199baef0f..b57d98110c4 100644 --- a/ui/tests/acceptance/storage-list-test.js +++ b/ui/tests/acceptance/storage-list-test.js @@ -6,9 +6,9 @@ import { currentURL, visit } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import setupAuthenticatedAcceptance from 'nomad-ui/tests/helpers/setup-authenticated-acceptance'; import StorageList from 'nomad-ui/tests/pages/storage/list'; import faker from 'nomad-ui/mirage/faker'; @@ -40,7 +40,8 @@ module('Acceptance | storage list', function (hooks) { test('it passes an accessibility audit', async function (assert) { await StorageList.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('visiting the now-deprecated /csi redirects to /storage', async function (assert) { diff --git a/ui/tests/acceptance/task-detail-test.js b/ui/tests/acceptance/task-detail-test.js index 5a7c925aa81..5f4b1ebe365 100644 --- a/ui/tests/acceptance/task-detail-test.js +++ b/ui/tests/acceptance/task-detail-test.js @@ -6,9 +6,9 @@ import { currentURL, waitFor, waitUntil } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Task from 'nomad-ui/tests/pages/allocations/task/detail'; import Layout from 'nomad-ui/tests/pages/layout'; import moment from 'moment'; @@ -38,7 +38,8 @@ module('Acceptance | task detail', function (hooks) { }); test('it passes an accessibility audit', async function (assert) { - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/allocation/:id/:task_name should name the task and list high-level task information', async function (assert) { diff --git a/ui/tests/acceptance/task-group-detail-test.js b/ui/tests/acceptance/task-group-detail-test.js index 0df4e642acb..6ffd67bab83 100644 --- a/ui/tests/acceptance/task-group-detail-test.js +++ b/ui/tests/acceptance/task-group-detail-test.js @@ -6,9 +6,9 @@ import { currentURL, settled } from '@ember/test-helpers'; import { getPageTitle } from 'ember-page-title/test-support'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { formatBytes, formatHertz, @@ -83,7 +83,8 @@ module('Acceptance | task group detail', function (hooks) { test('it passes an accessibility audit', async function (assert) { await TaskGroup.visit({ id: job.id, name: taskGroup.name }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('task group allocations show max run deadline when configured', async function (assert) { diff --git a/ui/tests/acceptance/task-logs-test.js b/ui/tests/acceptance/task-logs-test.js index b7f19f883ce..40d332bd50a 100644 --- a/ui/tests/acceptance/task-logs-test.js +++ b/ui/tests/acceptance/task-logs-test.js @@ -12,9 +12,9 @@ import { } from '@ember/test-helpers'; import { later, cancelTimers } from '@ember/runloop'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import TaskLogs from 'nomad-ui/tests/pages/allocations/task/logs'; import faker from 'nomad-ui/mirage/faker'; @@ -44,7 +44,8 @@ module.skip('Acceptance | task logs', function (hooks) { test('it passes an accessibility audit', async function (assert) { await TaskLogs.visit({ id: allocation.id, name: task.name }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/allocation/:id/:task_name/logs should have a log component', async function (assert) { diff --git a/ui/tests/acceptance/token-test.js b/ui/tests/acceptance/token-test.js index 2202965b8d4..d9e9815c2a3 100644 --- a/ui/tests/acceptance/token-test.js +++ b/ui/tests/acceptance/token-test.js @@ -14,9 +14,9 @@ import { waitUntil, } from '@ember/test-helpers'; import { module, skip, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Tokens from 'nomad-ui/tests/pages/settings/tokens'; import Jobs from 'nomad-ui/tests/pages/jobs/list'; import JobDetail from 'nomad-ui/tests/pages/jobs/detail'; @@ -63,7 +63,8 @@ module('Acceptance | tokens', function (hooks) { test('it passes an accessibility audit', async function (assert) { await Tokens.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('the token form sets the token in local storage', async function (assert) { diff --git a/ui/tests/acceptance/topology-test.js b/ui/tests/acceptance/topology-test.js index 0b2bd3cfb42..26f983efa7e 100644 --- a/ui/tests/acceptance/topology-test.js +++ b/ui/tests/acceptance/topology-test.js @@ -6,9 +6,9 @@ import { get } from '@ember/object'; import { currentURL, typeIn, click } from '@ember/test-helpers'; import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Topology from 'nomad-ui/tests/pages/topology'; import { formatBytes, @@ -36,7 +36,8 @@ module('Acceptance | topology', function (hooks) { this.server.createList('allocation', 5); await Topology.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('by default the info panel shows cluster aggregate stats', async function (assert) { diff --git a/ui/tests/acceptance/variables-test.js b/ui/tests/acceptance/variables-test.js index 14b086cced7..0c5e52e8141 100644 --- a/ui/tests/acceptance/variables-test.js +++ b/ui/tests/acceptance/variables-test.js @@ -16,7 +16,7 @@ import { setupMirage } from 'ember-cli-mirage/test-support'; import { clickToggle, clickOption } from 'nomad-ui/tests/helpers/helios'; import { setupApplicationTest } from 'ember-qunit'; import { module, test } from 'qunit'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { allScenarios } from '../../mirage/scenarios/default'; import cleanWhitespace from '../utils/clean-whitespace'; import faker from 'nomad-ui/mirage/faker'; @@ -374,7 +374,21 @@ module('Acceptance | variables', function (hooks) { const variablesToken = this.server.db.tokens.find(VARIABLE_TOKEN_ID); window.localStorage.nomadTokenSecret = variablesToken.secretId; await Variables.visit(); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + }); + + test('variables.variable.edit passes an accessibility audit', async function (assert) { + try { + allScenarios.variableTestCluster(this.server); + window.localStorage.nomadTokenSecret = this.server.db.tokens[0].secretId; + const variable = this.server.db.variables[0]; + await visit(`/variables/var/${variable.path}@${variable.namespace}/edit`); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); + } finally { + window.localStorage.removeItem('nomadTokenSecret'); + } }); module('create flow', function () { diff --git a/ui/tests/acceptance/volume-detail-test.js b/ui/tests/acceptance/volume-detail-test.js index 162b5bb10d8..7f64771febf 100644 --- a/ui/tests/acceptance/volume-detail-test.js +++ b/ui/tests/acceptance/volume-detail-test.js @@ -4,11 +4,11 @@ */ import { module, test } from 'qunit'; +import { a11yAudit } from 'ember-a11y-testing/test-support'; import { getPageTitle } from 'ember-page-title/test-support'; import { currentURL } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import setupAuthenticatedAcceptance from 'nomad-ui/tests/helpers/setup-authenticated-acceptance'; import moment from 'moment'; import { formatBytes, formatHertz } from 'nomad-ui/utils/units'; @@ -43,7 +43,8 @@ module('Acceptance | volume detail', function (hooks) { test('it passes an accessibility audit', async function (assert) { await VolumeDetail.visit({ id: `${volume.id}@default` }); - await a11yAudit(assert); + await a11yAudit(); + assert.ok(true, 'no a11y errors found'); }); test('/storage/volumes/:id should have a breadcrumb trail linking back to Volumes and Storage', async function (assert) { diff --git a/ui/tests/helpers/a11y-audit.js b/ui/tests/helpers/a11y-audit.js deleted file mode 100644 index 2e441c417d3..00000000000 --- a/ui/tests/helpers/a11y-audit.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright IBM Corp. 2015, 2025 - * SPDX-License-Identifier: BUSL-1.1 - */ - -import a11yAudit from 'ember-a11y-testing/test-support/audit'; - -function appendRuleOverrides(overriddenRules) { - const rules = { - 'color-contrast': { - enabled: false, - }, - 'heading-order': { - enabled: false, - }, - }; - - overriddenRules.forEach((rule) => (rules[rule] = { enabled: false })); - - return rules; -} - -export default async function defaultA11yAudit(assert, ...overriddenRules) { - await a11yAudit({ rules: appendRuleOverrides(overriddenRules) }); - assert.ok(true, 'a11y audit passes'); -} - -export async function componentA11yAudit(element, assert, ...overriddenRules) { - await a11yAudit(element, { rules: appendRuleOverrides(overriddenRules) }); - assert.ok(true, 'a11y audit passes'); -} diff --git a/ui/tests/integration/components/agent-monitor-test.js b/ui/tests/integration/components/agent-monitor-test.js index 9ff3625a0c6..e7170ae5768 100644 --- a/ui/tests/integration/components/agent-monitor-test.js +++ b/ui/tests/integration/components/agent-monitor-test.js @@ -15,7 +15,6 @@ import { selectOpen, selectOpenChoose, } from '../../utils/ember-power-select-extensions'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { capitalize } from '@ember/string'; module('Integration | Component | agent-monitor', function (hooks) { @@ -71,7 +70,6 @@ module('Integration | Component | agent-monitor', function (hooks) { assert.ok(find('[data-test-log-box]')); assert.ok(find('[data-test-log-box].is-full-bleed.is-dark')); - await componentA11yAudit(this.element, assert); }); // TODO(ember5-upgrade): Re-enable streaming behaviors once long-lived diff --git a/ui/tests/integration/components/allocation-row-test.js b/ui/tests/integration/components/allocation-row-test.js index 1c507a80330..bf2a725b2fa 100644 --- a/ui/tests/integration/components/allocation-row-test.js +++ b/ui/tests/integration/components/allocation-row-test.js @@ -11,7 +11,6 @@ import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import { find, render } from '@ember/test-helpers'; import { Response } from 'miragejs'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | allocation row', function (hooks) { setupRenderingTest(hooks); @@ -115,7 +114,6 @@ module('Integration | Component | allocation row', function (hooks) { find('[data-test-icon="unhealthy-driver"]'), 'Unhealthy driver icon is shown', ); - await componentA11yAudit(this.element, assert); }); test('Allocation row shows an icon indicator when it was preempted', async function (assert) { @@ -130,7 +128,6 @@ module('Integration | Component | allocation row', function (hooks) { `); assert.ok(find('[data-test-icon="preemption"]'), 'Preempted icon is shown'); - await componentA11yAudit(this.element, assert); }); test('when an allocation is not running, the utilization graphs are omitted', async function (assert) { diff --git a/ui/tests/integration/components/allocation-service-sidebar-test.js b/ui/tests/integration/components/allocation-service-sidebar-test.js index 1aa093f951e..bcd2cb1d07a 100644 --- a/ui/tests/integration/components/allocation-service-sidebar-test.js +++ b/ui/tests/integration/components/allocation-service-sidebar-test.js @@ -7,7 +7,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { click, render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import Service from '@ember/service'; import EmberObject from '@ember/object'; @@ -32,7 +31,6 @@ module( }); test('it supports basic open/close states', async function (assert) { - await componentA11yAudit(this.element, assert); this.set('closeSidebar', () => this.set('service', null)); diff --git a/ui/tests/integration/components/attributes-table-test.js b/ui/tests/integration/components/attributes-table-test.js index 1b6f85d9efc..7071c19a47d 100644 --- a/ui/tests/integration/components/attributes-table-test.js +++ b/ui/tests/integration/components/attributes-table-test.js @@ -7,7 +7,6 @@ import { find, findAll, render } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import PathTree from 'nomad-ui/utils/path-tree'; module('Integration | Component | attributes table', function (hooks) { @@ -57,7 +56,6 @@ module('Integration | Component | attributes table', function (hooks) { `Table has ${rowsCount} rows with values`, ); - await componentA11yAudit(this.element, assert); }); test('should render the full path of key/value pair from the root of the object', async function (assert) { diff --git a/ui/tests/integration/components/copy-button-test.js b/ui/tests/integration/components/copy-button-test.js index b2ddc0ee7d9..22b07a6c3df 100644 --- a/ui/tests/integration/components/copy-button-test.js +++ b/ui/tests/integration/components/copy-button-test.js @@ -7,7 +7,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { click, render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import sinon from 'sinon'; @@ -22,7 +21,6 @@ module('Integration | Component | copy-button', function (hooks) { test('it shows the copy icon by default', async function (assert) { await render(hbs``); assert.dom('.copy-button .hds-icon-clipboard-copy').exists(); - await componentA11yAudit(this.element, assert); }); test('it shows the success icon on success and resets afterward', async function (assert) { @@ -34,7 +32,6 @@ module('Integration | Component | copy-button', function (hooks) { await triggerCopySuccess('.copy-button button'); assert.dom('[data-test-copy-success]').exists(); - await componentA11yAudit(this.element, assert); clock.runAll(); @@ -51,6 +48,5 @@ module('Integration | Component | copy-button', function (hooks) { await triggerCopyError('.copy-button button'); assert.dom('.copy-button .hds-icon-clipboard-x').exists(); - await componentA11yAudit(this.element, assert); }); }); diff --git a/ui/tests/integration/components/das/dismissed-test.js b/ui/tests/integration/components/das/dismissed-test.js index d8a6bce029c..dff1baacd1d 100644 --- a/ui/tests/integration/components/das/dismissed-test.js +++ b/ui/tests/integration/components/das/dismissed-test.js @@ -7,7 +7,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { click, render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import sinon from 'sinon'; module('Integration | Component | das/dismissed', function (hooks) { @@ -23,7 +22,6 @@ module('Integration | Component | das/dismissed', function (hooks) { await render(hbs``); - await componentA11yAudit(this.element, assert); await click('input[type=checkbox]'); await click('[data-test-understood]'); @@ -45,7 +43,6 @@ module('Integration | Component | das/dismissed', function (hooks) { assert.dom('[data-test-understood]').doesNotExist(); - await componentA11yAudit(this.element, assert); assert.ok(proceedSpy.calledWith({ manuallyDismissed: false })); }); diff --git a/ui/tests/integration/components/das/recommendation-card-test.js b/ui/tests/integration/components/das/recommendation-card-test.js index 57a6b3f0609..30c209cf249 100644 --- a/ui/tests/integration/components/das/recommendation-card-test.js +++ b/ui/tests/integration/components/das/recommendation-card-test.js @@ -8,7 +8,6 @@ import { setupRenderingTest } from 'ember-qunit'; import { render, settled } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import Service from '@ember/service'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import RecommendationCardComponent from 'nomad-ui/tests/pages/components/recommendation-card'; import { create } from 'ember-cli-page-object'; @@ -237,7 +236,6 @@ module('Integration | Component | das/recommendation-card', function (hooks) { '125 MHz', ); - await componentA11yAudit(this.element, assert); }); test('it doesn’t have header toggles when there’s only one task', async function (assert) { diff --git a/ui/tests/integration/components/das/recommendation-chart-test.js b/ui/tests/integration/components/das/recommendation-chart-test.js index ded052105a5..f9838d08b19 100644 --- a/ui/tests/integration/components/das/recommendation-chart-test.js +++ b/ui/tests/integration/components/das/recommendation-chart-test.js @@ -7,7 +7,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render, triggerEvent } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | das/recommendation-chart', function (hooks) { setupRenderingTest(hooks); @@ -31,7 +30,6 @@ module('Integration | Component | das/recommendation-chart', function (hooks) { assert.dom('.recommendation-chart .resource').hasText('CPU'); assert.dom('.recommendation-chart .hds-icon-arrow-up').exists(); assert.dom('text.percent').hasText('+46%'); - await componentA11yAudit(this.element, assert); }); test('it renders a chart for a recommended memory decrease', async function (assert) { @@ -53,7 +51,6 @@ module('Integration | Component | das/recommendation-chart', function (hooks) { assert.dom('.recommendation-chart .resource').hasText('Mem'); assert.dom('.recommendation-chart .hds-icon-arrow-down').exists(); assert.dom('text.percent').hasText('−32%'); - await componentA11yAudit(this.element, assert); }); test('it handles the maximum being far beyond the recommended', async function (assert) { @@ -101,7 +98,6 @@ module('Integration | Component | das/recommendation-chart', function (hooks) { assert.dom('.recommendation-chart .changes').doesNotExist(); assert.dom('.recommendation-chart .resource').hasText('CPU'); assert.dom('.recommendation-chart .hds-icon-arrow-up').exists(); - await componentA11yAudit(this.element, assert); }); test('the stats labels shift aligment and disappear to account for space', async function (assert) { diff --git a/ui/tests/integration/components/flex-masonry-test.js b/ui/tests/integration/components/flex-masonry-test.js index 7c17170e119..705584022b8 100644 --- a/ui/tests/integration/components/flex-masonry-test.js +++ b/ui/tests/integration/components/flex-masonry-test.js @@ -8,7 +8,6 @@ import { click, find, findAll, render, settled } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; // Used to prevent XSS warnings in console const h = (height) => htmlSafe(`height:${height}px`); @@ -33,7 +32,6 @@ module('Integration | Component | FlexMasonry', function (hooks) { assert.deepEqual(div.tagName.toLowerCase(), 'div'); assert.deepEqual(div.children.length, 0); - await componentA11yAudit(this.element, assert); }); test('each item in @items gets wrapped in a flex-masonry-item wrapper', async function (assert) { diff --git a/ui/tests/integration/components/fs/file-test.js b/ui/tests/integration/components/fs/file-test.js index 402cfa2ed6e..28cd1907bd7 100644 --- a/ui/tests/integration/components/fs/file-test.js +++ b/ui/tests/integration/components/fs/file-test.js @@ -9,7 +9,6 @@ import { find, click, render, settled } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import Pretender from 'pretender'; import { logEncode } from '../../../../mirage/data/logs'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; const { assign } = Object; const HOST = '1.1.1.1:1111'; @@ -111,7 +110,6 @@ module('Integration | Component | fs/file', function (hooks) { 'The image file component was not rendered', ); - await componentA11yAudit(this.element, assert); }); test('When a file is an image, the file mode is image', async function (assert) { @@ -129,7 +127,6 @@ module('Integration | Component | fs/file', function (hooks) { 'The streaming file component was not rendered', ); - await componentA11yAudit(this.element, assert); }); test('When the file is neither text-based or an image, the unsupported file type empty state is shown', async function (assert) { @@ -150,7 +147,6 @@ module('Integration | Component | fs/file', function (hooks) { find('[data-test-unsupported-type]'), 'Unsupported file type message is shown', ); - await componentA11yAudit(this.element, assert); }); test('The unsupported file type empty state includes a link to the raw file', async function (assert) { @@ -262,7 +258,6 @@ module('Integration | Component | fs/file', function (hooks) { 'Yielded content shows up in the header', ); - await componentA11yAudit(this.element, assert); }); test('The body is full-bleed and dark when the file is streaming', async function (assert) { diff --git a/ui/tests/integration/components/gauge-chart-test.js b/ui/tests/integration/components/gauge-chart-test.js index bb2c96033c6..dce26aa14a4 100644 --- a/ui/tests/integration/components/gauge-chart-test.js +++ b/ui/tests/integration/components/gauge-chart-test.js @@ -7,7 +7,6 @@ import { find, render } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { create } from 'ember-cli-page-object'; import gaugeChart from 'nomad-ui/tests/pages/components/gauge-chart'; @@ -37,7 +36,6 @@ module('Integration | Component | gauge chart', function (hooks) { assert.deepEqual(GaugeChart.percentage, '50%'); assert.ok(GaugeChart.svgIsPresent); - await componentA11yAudit(this.element, assert); }); test('the width of the chart is determined based on the container and the height is a function of the width', async function (assert) { diff --git a/ui/tests/integration/components/image-file-test.js b/ui/tests/integration/components/image-file-test.js index a6d2fac4534..b3e115bb9c4 100644 --- a/ui/tests/integration/components/image-file-test.js +++ b/ui/tests/integration/components/image-file-test.js @@ -7,7 +7,6 @@ import { find, render, waitFor } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import sinon from 'sinon'; import RSVP from 'rsvp'; import { formatBytes } from 'nomad-ui/utils/units'; @@ -37,7 +36,6 @@ module('Integration | Component | image file', function (hooks) { `src is ${commonProperties.src}`, ); - await componentA11yAudit(this.element, assert); }); test('the image is wrapped in an anchor that links directly to the image', async function (assert) { diff --git a/ui/tests/integration/components/job-client-status-bar-test.js b/ui/tests/integration/components/job-client-status-bar-test.js index 3d515cc1f5e..ddb8e510ab9 100644 --- a/ui/tests/integration/components/job-client-status-bar-test.js +++ b/ui/tests/integration/components/job-client-status-bar-test.js @@ -9,7 +9,6 @@ import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import sinon from 'sinon'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import jobClientStatusBar from 'nomad-ui/tests/pages/components/job-client-status-bar'; const JobClientStatusBar = create(jobClientStatusBar()); @@ -54,7 +53,6 @@ module('Integration | Component | job-client-status-bar', function (hooks) { await render(commonTemplate); assert.ok(JobClientStatusBar.isPresent, 'Client Status Bar is rendered'); - await componentA11yAudit(this.element, assert); }); test('it fires the onBarClick handler method when clicking a bar in the chart', async function (assert) { diff --git a/ui/tests/integration/components/job-diff-test.js b/ui/tests/integration/components/job-diff-test.js index 907594bace6..369d1bcc5e8 100644 --- a/ui/tests/integration/components/job-diff-test.js +++ b/ui/tests/integration/components/job-diff-test.js @@ -8,7 +8,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; import cleanWhitespace from '../../utils/clean-whitespace'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | job diff', function (hooks) { setupRenderingTest(hooks); @@ -68,7 +67,6 @@ module('Integration | Component | job diff', function (hooks) { 'Removed field is rendered correctly', ); - await componentA11yAudit(this.element, assert); }); test('job object diffs', async function (assert) { @@ -183,7 +181,6 @@ module('Integration | Component | job diff', function (hooks) { 'Objects within objects are rendered', ); - await componentA11yAudit(this.element, assert); }); function field(name, type, newVal, oldVal) { diff --git a/ui/tests/integration/components/job-editor-test.js b/ui/tests/integration/components/job-editor-test.js index bac9180355c..da9192f7e0e 100644 --- a/ui/tests/integration/components/job-editor-test.js +++ b/ui/tests/integration/components/job-editor-test.js @@ -13,7 +13,6 @@ import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import jobEditor from 'nomad-ui/tests/pages/components/job-editor'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; import setupCodeMirror from 'nomad-ui/tests/helpers/codemirror'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; const Editor = create(jobEditor()); @@ -113,7 +112,6 @@ module('Integration | Component | job-editor', function (hooks) { await renderNewJob(this, job); assert.ok('[data-test-job-editor]', 'Editor is present'); - await componentA11yAudit(this.element, assert); }); test('submitting a json job skips the parse endpoint', async function (assert) { @@ -177,7 +175,6 @@ module('Integration | Component | job-editor', function (hooks) { .dom('[data-test-plan-help-title]') .exists('The plan explanation popup is shown'); - await componentA11yAudit(this.element, assert); }); test('from the plan screen, the cancel button goes back to the editor with the job still in tact', async function (assert) { @@ -221,7 +218,6 @@ module('Integration | Component | job-editor', function (hooks) { 'The error message from the server is shown in the error in the UI', ); - await componentA11yAudit(this.element, assert); }); test('when plan fails, the plan error message is shown', async function (assert) { @@ -253,7 +249,6 @@ module('Integration | Component | job-editor', function (hooks) { 'The error message from the server is shown in the error in the UI', ); - await componentA11yAudit(this.element, assert); }); test('when run fails, the run error message is shown', async function (assert) { @@ -284,7 +279,6 @@ module('Integration | Component | job-editor', function (hooks) { 'The error message from the server is shown in the error in the UI', ); - await componentA11yAudit(this.element, assert); }); test('when the scheduler dry-run has errors, the errors are shown to the user', async function (assert) { @@ -313,7 +307,6 @@ module('Integration | Component | job-editor', function (hooks) { 'The scheduler dry-run warning block is not present when there is an error but no warnings', ); - await componentA11yAudit(this.element, assert); }); @@ -346,7 +339,6 @@ module('Integration | Component | job-editor', function (hooks) { 'The warning message is not shown in addition to the success message', ); - await componentA11yAudit(this.element, assert); }); test('when a job is submitted in the edit context, a POST request is made to the update job endpoint', async function (assert) { @@ -456,7 +448,6 @@ module('Integration | Component | job-editor', function (hooks) { assert.ok(Editor.cancelEditingIsAvailable, 'Cancel editing button exists'); - await componentA11yAudit(this.element, assert); }); test('constructor sets definition and variables correctly', async function (assert) { diff --git a/ui/tests/integration/components/job-page/parts/body-test.js b/ui/tests/integration/components/job-page/parts/body-test.js index cd5104ef947..d38db3df1af 100644 --- a/ui/tests/integration/components/job-page/parts/body-test.js +++ b/ui/tests/integration/components/job-page/parts/body-test.js @@ -8,7 +8,6 @@ import { setupRenderingTest } from 'ember-qunit'; import { find, findAll, render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | job-page/parts/body', function (hooks) { setupRenderingTest(hooks); @@ -67,7 +66,6 @@ module('Integration | Component | job-page/parts/body', function (hooks) { 'Deployments link', ); - await componentA11yAudit(this.element, assert); }); test('the subnav does not include the deployments link when the job is not a service', async function (assert) { diff --git a/ui/tests/integration/components/job-page/parts/children-test.js b/ui/tests/integration/components/job-page/parts/children-test.js index 6a86dc5de88..2b80a2a3edb 100644 --- a/ui/tests/integration/components/job-page/parts/children-test.js +++ b/ui/tests/integration/components/job-page/parts/children-test.js @@ -8,7 +8,6 @@ import { findAll, find, render } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | job-page/parts/children', function (hooks) { setupRenderingTest(hooks); @@ -115,7 +114,6 @@ module('Integration | Component | job-page/parts/children', function (hooks) { 'Formats pagination to follow formula `startingIdx - endingIdx of totalTableCount', ); - await componentA11yAudit(this.element, assert); }); test('is sorted based on the sortProperty and sortDescending properties', async function (assert) { diff --git a/ui/tests/integration/components/job-page/parts/placement-failures-test.js b/ui/tests/integration/components/job-page/parts/placement-failures-test.js index 2ca80a9b3b5..4d6826d07f9 100644 --- a/ui/tests/integration/components/job-page/parts/placement-failures-test.js +++ b/ui/tests/integration/components/job-page/parts/placement-failures-test.js @@ -10,7 +10,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module( 'Integration | Component | job-page/parts/placement-failures', @@ -77,7 +76,6 @@ module( ); }); - await componentA11yAudit(this.element, assert); }); test('when the job has no placement failures, the placement failures section is gone', async function (assert) { diff --git a/ui/tests/integration/components/job-page/parts/summary-test.js b/ui/tests/integration/components/job-page/parts/summary-test.js index 86a65954101..60f7322fe31 100644 --- a/ui/tests/integration/components/job-page/parts/summary-test.js +++ b/ui/tests/integration/components/job-page/parts/summary-test.js @@ -9,7 +9,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | job-page/parts/summary', function (hooks) { setupRenderingTest(hooks); @@ -50,7 +49,6 @@ module('Integration | Component | job-page/parts/summary', function (hooks) { 'Allocation status bar not found', ); - await componentA11yAudit(this.element, assert); }); test('jobs without children use the allocations diagram', async function (assert) { @@ -75,7 +73,6 @@ module('Integration | Component | job-page/parts/summary', function (hooks) { 'Children status bar not found', ); - await componentA11yAudit(this.element, assert); }); test('the allocations diagram lists all allocation status figures', async function (assert) { @@ -203,7 +200,6 @@ module('Integration | Component | job-page/parts/summary', function (hooks) { 'Allocation bar is rendered in an inline-chart container', ); - await componentA11yAudit(this.element, assert); }); test('the collapsed/expanded state is persisted to localStorage', async function (assert) { diff --git a/ui/tests/integration/components/job-page/parts/task-groups-test.js b/ui/tests/integration/components/job-page/parts/task-groups-test.js index 7a4a8697616..a0a7947d8d9 100644 --- a/ui/tests/integration/components/job-page/parts/task-groups-test.js +++ b/ui/tests/integration/components/job-page/parts/task-groups-test.js @@ -8,7 +8,6 @@ import { findAll, find, render } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import { setupRenderingTest } from 'ember-qunit'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { formatScheduledHertz, formatScheduledBytes, @@ -67,7 +66,6 @@ module( 'One row per task group', ); - await componentA11yAudit(this.element, assert); }); test('each row in the task group table should show basic information about the task group', async function (assert) { diff --git a/ui/tests/integration/components/job-page/periodic-test.js b/ui/tests/integration/components/job-page/periodic-test.js index 6c08d7c7cea..1c403397f2d 100644 --- a/ui/tests/integration/components/job-page/periodic-test.js +++ b/ui/tests/integration/components/job-page/periodic-test.js @@ -22,7 +22,6 @@ import { expectStartRequest, expectPurgeRequest, } from './helpers'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; // A minimum viable page object to use with the pageSizeSelect behavior const PeriodicJobPage = create({ @@ -180,7 +179,6 @@ module('Integration | Component | job-page/periodic', function (hooks) { find('[data-test-stop] [data-test-idle-button]').hasAttribute('disabled'), ); - await componentA11yAudit(this.element, assert); }); test('Starting a job sends a post request for the job using the current definition', async function (assert) { diff --git a/ui/tests/integration/components/job-page/service-test.js b/ui/tests/integration/components/job-page/service-test.js index a6c57e80e74..331c086c0b1 100644 --- a/ui/tests/integration/components/job-page/service-test.js +++ b/ui/tests/integration/components/job-page/service-test.js @@ -19,7 +19,6 @@ import { } from './helpers'; import Job from 'nomad-ui/tests/pages/jobs/detail'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | job-page/service', function (hooks) { setupRenderingTest(hooks); @@ -108,7 +107,6 @@ module('Integration | Component | job-page/service', function (hooks) { find('[data-test-stop] [data-test-idle-button]').hasAttribute('disabled'), ); - await componentA11yAudit(this.element, assert); }); test('Starting a job sends a post request for the job using the current definition', async function (assert) { @@ -201,7 +199,6 @@ module('Integration | Component | job-page/service', function (hooks) { 'Task Group name', ); - await componentA11yAudit(this.element, assert); }); test('Recent allocations caps out at five', async function (assert) { @@ -239,7 +236,6 @@ module('Integration | Component | job-page/service', function (hooks) { 'No allocations empty message', ); - await componentA11yAudit(this.element, assert); }); test('Active deployment can be promoted', async function (assert) { @@ -318,12 +314,6 @@ module('Integration | Component | job-page/service', function (hooks) { await click('[data-test-promote-canary]'); await expectError(assert, 'Could Not Promote Deployment'); - - await componentA11yAudit( - this.element, - assert, - 'scrollable-region-focusable', - ); //keyframe animation fades from opacity 0 }); test('Active deployment can be failed', async function (assert) { @@ -368,11 +358,5 @@ module('Integration | Component | job-page/service', function (hooks) { await click('.active-deployment [data-test-fail]'); await expectError(assert, 'Could Not Fail Deployment'); - - await componentA11yAudit( - this.element, - assert, - 'scrollable-region-focusable', - ); //keyframe animation fades from opacity 0 }); }); diff --git a/ui/tests/integration/components/job-search-box-test.js b/ui/tests/integration/components/job-search-box-test.js index 7290726c289..4acf1ea9e87 100644 --- a/ui/tests/integration/components/job-search-box-test.js +++ b/ui/tests/integration/components/job-search-box-test.js @@ -8,7 +8,6 @@ import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { fillIn, find, triggerEvent } from '@ember/test-helpers'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; const DEBOUNCE_MS = 500; @@ -25,7 +24,6 @@ module('Integration | Component | job-search-box', function (hooks) { await render( hbs``, ); - await componentA11yAudit(this.element, assert); const element = find('input'); await fillIn('input', 'test1'); diff --git a/ui/tests/integration/components/job-status-panel-test.js b/ui/tests/integration/components/job-status-panel-test.js index 9f1559c51f2..67b855ca166 100644 --- a/ui/tests/integration/components/job-status-panel-test.js +++ b/ui/tests/integration/components/job-status-panel-test.js @@ -9,7 +9,6 @@ import { find, render, settled } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module( 'Integration | Component | job status panel | active deployment', @@ -372,12 +371,6 @@ module( .replace(/\s\s+/g, ' '), '20 Running 5 Complete', ); - - await componentA11yAudit( - this.element, - assert, - 'scrollable-region-focusable', - ); //keyframe animation fades from opacity 0 }); test('non-running allocations are grouped regardless of health', async function (assert) { diff --git a/ui/tests/integration/components/job-status/failed-or-lost-test.js b/ui/tests/integration/components/job-status/failed-or-lost-test.js index 6312b5b09ae..374cad20ce1 100644 --- a/ui/tests/integration/components/job-status/failed-or-lost-test.js +++ b/ui/tests/integration/components/job-status/failed-or-lost-test.js @@ -7,7 +7,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | job-status/failed-or-lost', function (hooks) { setupRenderingTest(hooks); @@ -38,7 +37,6 @@ module('Integration | Component | job-status/failed-or-lost', function (hooks) { assert.dom('h4').hasText('Replaced Allocations'); assert.dom('.failed-or-lost-links').hasText('2 Restarted'); - await componentA11yAudit(this.element, assert); }); test('it links or does not link appropriately', async function (assert) { diff --git a/ui/tests/integration/components/lifecycle-chart-test.js b/ui/tests/integration/components/lifecycle-chart-test.js index 73f5c1567d5..36c50257a19 100644 --- a/ui/tests/integration/components/lifecycle-chart-test.js +++ b/ui/tests/integration/components/lifecycle-chart-test.js @@ -8,7 +8,6 @@ import { setupRenderingTest } from 'ember-qunit'; import { render, settled } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { set } from '@ember/object'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { create } from 'ember-cli-page-object'; import LifecycleChart from 'nomad-ui/tests/pages/components/lifecycle-chart'; @@ -92,7 +91,6 @@ module('Integration | Component | lifecycle-chart', function (hooks) { assert.notOk(task.isFinished); }); - await componentA11yAudit(this.element, assert); }); test('it doesn’t render when there’s only one phase', async function (assert) { @@ -135,7 +133,6 @@ module('Integration | Component | lifecycle-chart', function (hooks) { this.set('taskStates.4.state', 'running'); await settled(); - await componentA11yAudit(this.element, assert); assert.ok(Chart.tasks[5].isActive); diff --git a/ui/tests/integration/components/line-chart-test.js b/ui/tests/integration/components/line-chart-test.js index 97cf1562e8c..136c945129e 100644 --- a/ui/tests/integration/components/line-chart-test.js +++ b/ui/tests/integration/components/line-chart-test.js @@ -15,7 +15,6 @@ import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; import sinon from 'sinon'; import moment from 'moment'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; const REF_DATE = new Date(); @@ -56,7 +55,6 @@ module('Integration | Component | line-chart', function (hooks) { ); }); - await componentA11yAudit(this.element, assert); }); test('when a chart has annotations and is timeseries, annotations are sorted reverse-chronologically', async function (assert) { @@ -163,7 +161,6 @@ module('Integration | Component | line-chart', function (hooks) { assert.ok(annotationEls[1].classList.contains('is-staggered')); assert.notOk(annotationEls[2].classList.contains('is-staggered')); - await componentA11yAudit(this.element, assert); }); test('horizontal annotations render in order', async function (assert) { diff --git a/ui/tests/integration/components/list-pagination-test.js b/ui/tests/integration/components/list-pagination-test.js index 27f70969e2a..f7a9a2707b5 100644 --- a/ui/tests/integration/components/list-pagination-test.js +++ b/ui/tests/integration/components/list-pagination-test.js @@ -7,7 +7,6 @@ import { findAll, find, render } from '@ember/test-helpers'; import { module, skip, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | list pagination', function (hooks) { setupRenderingTest(hooks); @@ -50,7 +49,6 @@ module('Integration | Component | list pagination', function (hooks) { findAll('.prev').length, 'On the first page, there is no prev link', ); - await componentA11yAudit(this.element, assert); assert.deepEqual( findAll('.link').length, @@ -73,7 +71,6 @@ module('Integration | Component | list pagination', function (hooks) { findAll('.last').length, 'While not on the last page, there is a last link', ); - await componentA11yAudit(this.element, assert); assert.deepEqual( findAll('.item').length, diff --git a/ui/tests/integration/components/list-table-test.js b/ui/tests/integration/components/list-table-test.js index 1407d04c1fa..39d9d369bd3 100644 --- a/ui/tests/integration/components/list-table-test.js +++ b/ui/tests/integration/components/list-table-test.js @@ -8,7 +8,6 @@ import { module, skip, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import faker from 'nomad-ui/mirage/faker'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | list table', function (hooks) { setupRenderingTest(hooks); @@ -101,7 +100,6 @@ module('Integration | Component | list table', function (hooks) { ); }); - await componentA11yAudit(this.element, assert); }); // Ember doesn't support query params (or controllers or routes) in integration tests, diff --git a/ui/tests/integration/components/multi-select-dropdown-test.js b/ui/tests/integration/components/multi-select-dropdown-test.js index 08d9a0c7d48..ce09a9c5c4e 100644 --- a/ui/tests/integration/components/multi-select-dropdown-test.js +++ b/ui/tests/integration/components/multi-select-dropdown-test.js @@ -15,7 +15,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import sinon from 'sinon'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; const TAB = 9; const ESC = 27; @@ -64,7 +63,6 @@ module('Integration | Component | multi-select dropdown', function (hooks) { 'Options are not rendered', ); - await componentA11yAudit(this.element, assert); }); test('component opens the options dropdown when clicked', async function (assert) { @@ -78,7 +76,6 @@ module('Integration | Component | multi-select dropdown', function (hooks) { find('[data-test-dropdown-options]'), 'Options are shown now', ); - await componentA11yAudit(this.element, assert); await click('[data-test-dropdown-trigger]'); @@ -151,7 +148,6 @@ module('Integration | Component | multi-select dropdown', function (hooks) { 'The count is accurate', ); - await componentA11yAudit(this.element, assert); await this.set('selection', []); @@ -362,6 +358,5 @@ module('Integration | Component | multi-select dropdown', function (hooks) { ); assert.ok(find('[data-test-dropdown-empty]'), 'The empty state is shown'); assert.notOk(find('[data-test-dropdown-option]'), 'No options are shown'); - await componentA11yAudit(this.element, assert); }); }); diff --git a/ui/tests/integration/components/page-layout-test.js b/ui/tests/integration/components/page-layout-test.js index 5d68dcc7835..30b09ec89e4 100644 --- a/ui/tests/integration/components/page-layout-test.js +++ b/ui/tests/integration/components/page-layout-test.js @@ -8,7 +8,6 @@ import { setupRenderingTest } from 'ember-qunit'; import { find, click, render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | page layout', function (hooks) { setupRenderingTest(hooks); @@ -34,7 +33,6 @@ module('Integration | Component | page layout', function (hooks) { find('[data-test-gutter-menu]').classList.contains('is-open'), 'Gutter menu is open', ); - await componentA11yAudit(this.element, assert); }); test('the gutter-menu hamburger menu closes the gutter menu', async function (assert) { diff --git a/ui/tests/integration/components/placement-failure-test.js b/ui/tests/integration/components/placement-failure-test.js index 98e5c404fbe..23a6e896489 100644 --- a/ui/tests/integration/components/placement-failure-test.js +++ b/ui/tests/integration/components/placement-failure-test.js @@ -8,7 +8,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; import cleanWhitespace from '../../utils/clean-whitespace'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | placement failures', function (hooks) { setupRenderingTest(hooks); @@ -92,7 +91,6 @@ module('Integration | Component | placement failures', function (hooks) { 'Scores message shown', ); - await componentA11yAudit(this.element, assert); }); test('should render correctly when a node is not evaluated', async function (assert) { @@ -117,7 +115,6 @@ module('Integration | Component | placement failures', function (hooks) { 'Nodes exhausted message NOT shown when there are no nodes exhausted', ); - await componentA11yAudit(this.element, assert); }); function createFixture(obj = {}, name = 'Placement Failure') { diff --git a/ui/tests/integration/components/plugin-allocation-row-test.js b/ui/tests/integration/components/plugin-allocation-row-test.js index 5077c1f5481..43591385c16 100644 --- a/ui/tests/integration/components/plugin-allocation-row-test.js +++ b/ui/tests/integration/components/plugin-allocation-row-test.js @@ -9,7 +9,6 @@ import { hbs } from 'ember-cli-htmlbars'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import { render, settled } from '@ember/test-helpers'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | plugin allocation row', function (hooks) { setupRenderingTest(hooks); @@ -50,7 +49,6 @@ module('Integration | Component | plugin allocation row', function (hooks) { allocationRequest.url, `/v1/allocation/${storageController.allocID}`, ); - await componentA11yAudit(this.element, assert); }); test('After the plugin allocation row fetches the plugin allocation, allocation stats are fetched', async function (assert) { diff --git a/ui/tests/integration/components/policy-editor-test.js b/ui/tests/integration/components/policy-editor-test.js index 89197c660a6..d03ed899dcc 100644 --- a/ui/tests/integration/components/policy-editor-test.js +++ b/ui/tests/integration/components/policy-editor-test.js @@ -7,14 +7,13 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | policy-editor', function (hooks) { setupRenderingTest(hooks); test('it renders', async function (assert) { + assert.expect(0); await render(hbs``); - await componentA11yAudit(this.element, assert); }); test('Only has editable name if new', async function (assert) { diff --git a/ui/tests/integration/components/popover-menu-test.js b/ui/tests/integration/components/popover-menu-test.js index c7c9e613faf..1d96e1bc606 100644 --- a/ui/tests/integration/components/popover-menu-test.js +++ b/ui/tests/integration/components/popover-menu-test.js @@ -7,7 +7,6 @@ import { click, render } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { create } from 'ember-cli-page-object'; import popoverMenuPageObject from 'nomad-ui/tests/pages/components/popover-menu'; @@ -45,7 +44,6 @@ module('Integration | Component | popover-menu', function (hooks) { assert.ok(PopoverMenu.labelHasIcon); assert.notOk(PopoverMenu.menu.isOpen); assert.deepEqual(PopoverMenu.label, props.label); - await componentA11yAudit(this.element, assert); }); test('clicking the trigger button toggles the popover menu', async function (assert) { @@ -57,7 +55,6 @@ module('Integration | Component | popover-menu', function (hooks) { await PopoverMenu.toggle(); assert.ok(PopoverMenu.menu.isOpen); - await componentA11yAudit(this.element, assert); }); test('the trigger gets the triggerClass prop assigned as a class', async function (assert) { diff --git a/ui/tests/integration/components/primary-metric/allocation-test.js b/ui/tests/integration/components/primary-metric/allocation-test.js index 57f9ff2367a..f1773f41e42 100644 --- a/ui/tests/integration/components/primary-metric/allocation-test.js +++ b/ui/tests/integration/components/primary-metric/allocation-test.js @@ -9,7 +9,6 @@ import { findAll, render } from '@ember/test-helpers'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; import { hbs } from 'ember-cli-htmlbars'; import { setupPrimaryMetricMocks, primaryMetric } from './primary-metric'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; const mockTasks = [ @@ -55,13 +54,13 @@ module('Integration | Component | PrimaryMetric::Allocation', function (hooks) { store.peekAll('allocation').get('firstObject'); test('Must pass an accessibility audit', async function (assert) { + assert.expect(0); await preload(this.store); const resource = findResource(this.store); this.setProperties({ resource, metric: 'cpu' }); await render(template); - await componentA11yAudit(this.element, assert); }); test('Each task for the allocation gets its own line', async function (assert) { diff --git a/ui/tests/integration/components/primary-metric/node-test.js b/ui/tests/integration/components/primary-metric/node-test.js index f2976d1349f..aa00121f6ad 100644 --- a/ui/tests/integration/components/primary-metric/node-test.js +++ b/ui/tests/integration/components/primary-metric/node-test.js @@ -9,7 +9,6 @@ import { find, render } from '@ember/test-helpers'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; import { hbs } from 'ember-cli-htmlbars'; import { setupPrimaryMetricMocks, primaryMetric } from './primary-metric'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import { formatScheduledHertz } from 'nomad-ui/utils/units'; @@ -43,13 +42,13 @@ module('Integration | Component | PrimaryMetric::Node', function (hooks) { const findResource = (store) => store.peekAll('node').get('firstObject'); test('Must pass an accessibility audit', async function (assert) { + assert.expect(0); await preload(this.store); const resource = findResource(this.store); this.setProperties({ resource, metric: 'cpu' }); await render(template); - await componentA11yAudit(this.element, assert); }); test('When the node has a reserved amount for the metric, a horizontal annotation is shown', async function (assert) { diff --git a/ui/tests/integration/components/primary-metric/task-test.js b/ui/tests/integration/components/primary-metric/task-test.js index 01432f024dc..4ced1be9a29 100644 --- a/ui/tests/integration/components/primary-metric/task-test.js +++ b/ui/tests/integration/components/primary-metric/task-test.js @@ -9,7 +9,6 @@ import { render } from '@ember/test-helpers'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; import { hbs } from 'ember-cli-htmlbars'; import { setupPrimaryMetricMocks, primaryMetric } from './primary-metric'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; const mockTasks = [ @@ -61,13 +60,13 @@ module('Integration | Component | PrimaryMetric::Task', function (hooks) { store.peekAll('allocation').get('firstObject.states.firstObject'); test('Must pass an accessibility audit', async function (assert) { + assert.expect(0); await preload(this.store); const resource = findResource(this.store); this.setProperties({ resource, metric: 'cpu' }); await render(template); - await componentA11yAudit(this.element, assert); }); primaryMetric({ diff --git a/ui/tests/integration/components/reschedule-event-timeline-test.js b/ui/tests/integration/components/reschedule-event-timeline-test.js index b0bcbcfa14c..96e61f588be 100644 --- a/ui/tests/integration/components/reschedule-event-timeline-test.js +++ b/ui/tests/integration/components/reschedule-event-timeline-test.js @@ -8,7 +8,6 @@ import { setupRenderingTest } from 'ember-qunit'; import { find, findAll, render } from '@ember/test-helpers'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import moment from 'moment'; module('Integration | Component | reschedule event timeline', function (hooks) { @@ -77,7 +76,6 @@ module('Integration | Component | reschedule event timeline', function (hooks) { 'Allocation shows the status', ); - await componentA11yAudit(this.element, assert); }); test('when the allocation has failed and there is a follow up evaluation, a note with a time is shown', async function (assert) { @@ -106,7 +104,6 @@ module('Integration | Component | reschedule event timeline', function (hooks) { 'Reschdule attempt notice is not shown', ); - await componentA11yAudit(this.element, assert); }); test('when the allocation has failed and there is no follow up evaluation, a warning is shown', async function (assert) { @@ -141,7 +138,6 @@ module('Integration | Component | reschedule event timeline', function (hooks) { ); assert.notOk(find('[data-test-stop-warning]'), 'Stop warning is not shown'); - await componentA11yAudit(this.element, assert); }); test('when the allocation has a next allocation already, it is shown in the timeline', async function (assert) { diff --git a/ui/tests/integration/components/scale-events-accordion-test.js b/ui/tests/integration/components/scale-events-accordion-test.js index 9f6ac5562b1..d3be8e553a6 100644 --- a/ui/tests/integration/components/scale-events-accordion-test.js +++ b/ui/tests/integration/components/scale-events-accordion-test.js @@ -10,7 +10,6 @@ import { hbs } from 'ember-cli-htmlbars'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import setupCodeMirror from 'nomad-ui/tests/helpers/codemirror'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | scale-events-accordion', function (hooks) { setupRenderingTest(hooks); @@ -57,7 +56,6 @@ module('Integration | Component | scale-events-accordion', function (hooks) { findAll('[data-test-scale-events] [data-test-accordion-head]').length, eventCount, ); - await componentA11yAudit(this.element, assert); }); test('when an event is an error, an error icon is shown', async function (assert) { @@ -69,7 +67,6 @@ module('Integration | Component | scale-events-accordion', function (hooks) { await render(commonTemplate); assert.ok(find('[data-test-error]')); - await componentA11yAudit(this.element, assert); }); test('when an event has a count higher than previous count, an up arrow is shown', async function (assert) { @@ -90,7 +87,6 @@ module('Integration | Component | scale-events-accordion', function (hooks) { Number(find('[data-test-count]').textContent.trim()), count, ); - await componentA11yAudit(this.element, assert); }); test('when an event has a count lower than previous count, a down arrow is shown', async function (assert) { @@ -136,7 +132,6 @@ module('Integration | Component | scale-events-accordion', function (hooks) { assert.ok( find('[data-test-accordion-toggle]').classList.contains('is-invisible'), ); - await componentA11yAudit(this.element, assert); }); test('when an event has meta properties, the accordion entry is expanding, presenting the meta properties in a json viewer', async function (assert) { @@ -163,6 +158,5 @@ module('Integration | Component | scale-events-accordion', function (hooks) { this.getCodeMirrorInstance('[data-test-json-viewer]').getValue(), JSON.stringify(meta, null, 2), ); - await componentA11yAudit(this.element, assert); }); }); diff --git a/ui/tests/integration/components/scale-events-chart-test.js b/ui/tests/integration/components/scale-events-chart-test.js index 11ee1ba0fb9..53b3877b69c 100644 --- a/ui/tests/integration/components/scale-events-chart-test.js +++ b/ui/tests/integration/components/scale-events-chart-test.js @@ -9,7 +9,6 @@ import { click, find, findAll, render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import moment from 'moment'; import setupCodeMirror from 'nomad-ui/tests/helpers/codemirror'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | scale-events-chart', function (hooks) { setupRenderingTest(hooks); @@ -64,7 +63,6 @@ module('Integration | Component | scale-events-chart', function (hooks) { findAll('[data-test-annotation]').length, events.filter((ev) => ev.count == null).length, ); - await componentA11yAudit(this.element, assert); }); test('clicking an annotation presents details for the event', async function (assert) { @@ -90,7 +88,6 @@ module('Integration | Component | scale-events-chart', function (hooks) { JSON.stringify(annotation.meta, null, 2), ); - await componentA11yAudit(this.element, assert); }); test('clicking an active annotation closes event details', async function (assert) { diff --git a/ui/tests/integration/components/service-status-bar-test.js b/ui/tests/integration/components/service-status-bar-test.js index 3fa2cafb8cd..3f55a8105e4 100644 --- a/ui/tests/integration/components/service-status-bar-test.js +++ b/ui/tests/integration/components/service-status-bar-test.js @@ -7,7 +7,6 @@ import { findAll, render } from '@ember/test-helpers'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | Service Status Bar', function (hooks) { setupRenderingTest(hooks); @@ -30,7 +29,6 @@ module('Integration | Component | Service Status Bar', function (hooks) { `); - await componentA11yAudit(this.element, assert); const bars = findAll('g > g').length; assert.deepEqual(bars, 3, 'It visualizes services by status'); diff --git a/ui/tests/integration/components/single-select-dropdown-test.js b/ui/tests/integration/components/single-select-dropdown-test.js index c95e7508ea3..3642e16af23 100644 --- a/ui/tests/integration/components/single-select-dropdown-test.js +++ b/ui/tests/integration/components/single-select-dropdown-test.js @@ -10,7 +10,6 @@ import { selectChoose } from 'ember-power-select/test-support'; import { clickTrigger } from 'ember-power-select/test-support/helpers'; import sinon from 'sinon'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; module('Integration | Component | single-select dropdown', function (hooks) { setupRenderingTest(hooks); @@ -52,7 +51,6 @@ module('Integration | Component | single-select dropdown', function (hooks) { ); assert.notOk(find('[data-test-dropdown-options]')); - await componentA11yAudit(this.element, assert); }); test('all options are shown in the dropdown', async function (assert) { diff --git a/ui/tests/integration/components/stepper-input-test.js b/ui/tests/integration/components/stepper-input-test.js index 6545e498e8a..128b34ba86f 100644 --- a/ui/tests/integration/components/stepper-input-test.js +++ b/ui/tests/integration/components/stepper-input-test.js @@ -7,7 +7,6 @@ import { find, render, settled, triggerEvent } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import sinon from 'sinon'; import { create } from 'ember-cli-page-object'; import stepperInput from 'nomad-ui/tests/pages/components/stepper-input'; @@ -56,7 +55,6 @@ module('Integration | Component | stepper input', function (hooks) { StepperInput.increment.classNames.split(' ').includes(this.classVariant), ); - await componentA11yAudit(this.element, assert); }); test('clicking the increment and decrement buttons immediately changes the shown value in the input but debounces the onUpdate call', async function (assert) { diff --git a/ui/tests/integration/components/streaming-file-test.js b/ui/tests/integration/components/streaming-file-test.js index 4d17ae4f579..dee542703c5 100644 --- a/ui/tests/integration/components/streaming-file-test.js +++ b/ui/tests/integration/components/streaming-file-test.js @@ -7,7 +7,6 @@ import { find, render, triggerKeyEvent, waitUntil } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import Pretender from 'pretender'; import { logEncode } from '../../../mirage/data/logs'; import Log from 'nomad-ui/utils/classes/log'; @@ -71,7 +70,6 @@ module('Integration | Component | streaming file', function (hooks) { 'Query params are correct', ); assert.deepEqual(find('[data-test-output]').textContent, 'Hello World'); - await componentA11yAudit(this.element, assert); }); test('when mode is `tail`, the logger signals tail', async function (assert) { diff --git a/ui/tests/integration/components/task-group-row-test.js b/ui/tests/integration/components/task-group-row-test.js index 0417cf08402..7d3e058497a 100644 --- a/ui/tests/integration/components/task-group-row-test.js +++ b/ui/tests/integration/components/task-group-row-test.js @@ -9,7 +9,6 @@ import { find, render, settled } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; import { initialize as fragmentSerializerInitializer } from 'nomad-ui/initializers/fragment-serializer'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; const jobName = 'test-job'; const jobId = JSON.stringify([jobName, 'default']); @@ -89,7 +88,6 @@ module('Integration | Component | task group row', function (hooks) { await settled(); assert.ok(find('[data-test-scale]')); - await componentA11yAudit(this.element, assert); }); test('Clicking scaling buttons immediately updates the rendered count but debounces the scaling API request', async function (assert) { @@ -145,7 +143,6 @@ module('Integration | Component | task group row', function (hooks) { await render(commonTemplate); assert.ok(find('[data-test-scale="increment"]:disabled')); - await componentA11yAudit(this.element, assert); }); test('When the current count is equal to the min count, the decrement count button is disabled', async function (assert) { @@ -161,7 +158,6 @@ module('Integration | Component | task group row', function (hooks) { await render(commonTemplate); assert.ok(find('[data-test-scale="decrement"]:disabled')); - await componentA11yAudit(this.element, assert); }); test('When there is an active deployment, both scale buttons are disabled', async function (assert) { @@ -176,7 +172,6 @@ module('Integration | Component | task group row', function (hooks) { assert.ok(find('[data-test-scale="increment"]:disabled')); assert.ok(find('[data-test-scale="decrement"]:disabled')); - await componentA11yAudit(this.element, assert); }); test('When the current ACL token does not have the namespace:scale-job or namespace:submit-job policy rule', async function (assert) { diff --git a/ui/tests/integration/components/task-log-test.js b/ui/tests/integration/components/task-log-test.js index b194c4283a8..ffabb79ed95 100644 --- a/ui/tests/integration/components/task-log-test.js +++ b/ui/tests/integration/components/task-log-test.js @@ -8,7 +8,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { find, click, render, settled } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import Pretender from 'pretender'; import { logEncode } from '../../../mirage/data/logs'; import { startMirage } from 'nomad-ui/tests/helpers/start-mirage'; @@ -120,7 +119,6 @@ module.skip('Integration | Component | task log', function (hooks) { 'Cli is preformatted and using the cli-window component class', ); - await componentA11yAudit(this.element, assert); }); test('Streaming starts on creation', async function (assert) { @@ -147,7 +145,6 @@ module.skip('Integration | Component | task log', function (hooks) { 'First chunk of streaming log is shown', ); - await componentA11yAudit(this.element, assert); }); test('Clicking Head loads the log head', async function (assert) { @@ -367,7 +364,6 @@ module.skip('Integration | Component | task log', function (hooks) { 'The error message is dismissable', ); - await componentA11yAudit(this.element, assert); }); test('When the client is inaccessible, the server is accessible, and stderr is pressed before the client timeout occurs, the no connection error is not shown', async function (assert) { diff --git a/ui/tests/integration/components/task-sub-row-test.js b/ui/tests/integration/components/task-sub-row-test.js index c62640cd156..28c198f944d 100644 --- a/ui/tests/integration/components/task-sub-row-test.js +++ b/ui/tests/integration/components/task-sub-row-test.js @@ -7,7 +7,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; const mockTask = { name: 'another-server', @@ -77,6 +76,5 @@ module('Integration | Component | task-sub-row', function (hooks) { ); assert.dom('.task-sub-row td:nth-child(1)').hasAttribute('colspan', '9'); - await componentA11yAudit(this.element, assert); }); }); diff --git a/ui/tests/integration/components/toggle-test.js b/ui/tests/integration/components/toggle-test.js index f6b1391424b..9490ab49921 100644 --- a/ui/tests/integration/components/toggle-test.js +++ b/ui/tests/integration/components/toggle-test.js @@ -7,7 +7,6 @@ import { find, render, settled } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import sinon from 'sinon'; import { create } from 'ember-cli-page-object'; import togglePageObject from 'nomad-ui/tests/pages/components/toggle'; @@ -57,7 +56,6 @@ module('Integration | Component | toggle', function (hooks) { 'The input type is checkbox', ); - await componentA11yAudit(this.element, assert); }); test('the isActive property dictates the active state and class', async function (assert) { @@ -74,7 +72,6 @@ module('Integration | Component | toggle', function (hooks) { assert.ok(Toggle.isActive); assert.ok(Toggle.hasActiveClass); - await componentA11yAudit(this.element, assert); }); test('the isDisabled property dictates the disabled state and class', async function (assert) { @@ -91,7 +88,6 @@ module('Integration | Component | toggle', function (hooks) { assert.ok(Toggle.isDisabled); assert.ok(Toggle.hasDisabledClass); - await componentA11yAudit(this.element, assert); }); test('toggling the input calls the onToggle action', async function (assert) { diff --git a/ui/tests/integration/components/topo-viz-test.js b/ui/tests/integration/components/topo-viz-test.js index 4cbc50ed089..08b267b1189 100644 --- a/ui/tests/integration/components/topo-viz-test.js +++ b/ui/tests/integration/components/topo-viz-test.js @@ -7,7 +7,6 @@ import { module, test } from 'qunit'; import { render, triggerEvent } from '@ember/test-helpers'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { create } from 'ember-cli-page-object'; import { setupMirage } from 'ember-cli-mirage/test-support'; import sinon from 'sinon'; @@ -70,7 +69,6 @@ module('Integration | Component | TopoViz', function (hooks) { assert.deepEqual(TopoViz.datacenters[0].nodes[0].memoryRects.length, 2); assert.deepEqual(TopoViz.datacenters[1].nodes[0].memoryRects.length, 1); - await componentA11yAudit(this.element, assert); }); test('clicking on a node in a deeply nested TopoViz::Node will toggle node selection and call @onNodeSelect', async function (assert) { diff --git a/ui/tests/integration/components/topo-viz/datacenter-test.js b/ui/tests/integration/components/topo-viz/datacenter-test.js index 942942855b8..c0b02e93a3e 100644 --- a/ui/tests/integration/components/topo-viz/datacenter-test.js +++ b/ui/tests/integration/components/topo-viz/datacenter-test.js @@ -8,7 +8,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; import { setupMirage } from 'ember-cli-mirage/test-support'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { create } from 'ember-cli-page-object'; import sinon from 'sinon'; import faker from 'nomad-ui/mirage/faker'; @@ -78,7 +77,6 @@ module('Integration | Component | TopoViz::Datacenter', function (hooks) { this.datacenter.nodes.length, ); - await componentA11yAudit(this.element, assert); }); test('datacenter stats are an aggregate of node stats', async function (assert) { diff --git a/ui/tests/integration/components/topo-viz/node-test.js b/ui/tests/integration/components/topo-viz/node-test.js index 94320701f90..46aed011f2f 100644 --- a/ui/tests/integration/components/topo-viz/node-test.js +++ b/ui/tests/integration/components/topo-viz/node-test.js @@ -10,7 +10,6 @@ import { hbs } from 'ember-cli-htmlbars'; import { create } from 'ember-cli-page-object'; import sinon from 'sinon'; import faker from 'nomad-ui/mirage/faker'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { setupMirage } from 'ember-cli-mirage/test-support'; import topoVisNodePageObject from 'nomad-ui/tests/pages/components/topo-viz/node'; import { @@ -93,7 +92,6 @@ module('Integration | Component | TopoViz::Node', function (hooks) { ); assert.ok(TopoVizNode.cpuRects.length); - await componentA11yAudit(this.element, assert); }); test('the label contains aggregate information about the node', async function (assert) { diff --git a/ui/tests/integration/components/two-step-button-test.js b/ui/tests/integration/components/two-step-button-test.js index 09f59a90512..7732e6a9c10 100644 --- a/ui/tests/integration/components/two-step-button-test.js +++ b/ui/tests/integration/components/two-step-button-test.js @@ -7,7 +7,6 @@ import { find, click, render } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import sinon from 'sinon'; import { create } from 'ember-cli-page-object'; import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button'; @@ -59,7 +58,6 @@ module('Integration | Component | two step button', function (hooks) { 'No confirmation message yet', ); - await componentA11yAudit(this.element, assert); }); test('clicking the idle state button transitions into the promptForConfirmation state', async function (assert) { @@ -90,7 +88,6 @@ module('Integration | Component | two step button', function (hooks) { ); assert.notOk(find('[data-test-idle-button]'), 'No more idle button'); - await componentA11yAudit(this.element, assert); }); test('canceling in the promptForConfirmation state calls the onCancel hook and resets to the idle state', async function (assert) { @@ -139,7 +136,6 @@ module('Integration | Component | two step button', function (hooks) { 'The confirm button is in a loading state', ); - await componentA11yAudit(this.element, assert); }); test('when in the prompt state, clicking outside will reset state back to idle', async function (assert) { @@ -193,6 +189,5 @@ module('Integration | Component | two step button', function (hooks) { assert.ok(TwoStepButton.isDisabled, 'The idle button is disabled'); - await componentA11yAudit(this.element, assert); }); }); diff --git a/ui/tests/integration/components/variable-form-test.js b/ui/tests/integration/components/variable-form-test.js index e5a440f51bd..9314ca3250e 100644 --- a/ui/tests/integration/components/variable-form-test.js +++ b/ui/tests/integration/components/variable-form-test.js @@ -6,7 +6,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import { click, typeIn, find, findAll, render } from '@ember/test-helpers'; import { setupMirage } from 'ember-cli-mirage/test-support'; import setupCodeMirror from 'nomad-ui/tests/helpers/codemirror'; @@ -21,6 +20,7 @@ module('Integration | Component | variable-form', function (hooks) { setupCodeMirror(hooks); test('passes an accessibility audit', async function (assert) { + assert.expect(0); this.set( 'mockedModel', this.server.create('variable', { @@ -28,7 +28,6 @@ module('Integration | Component | variable-form', function (hooks) { }), ); await render(hbs``); - await componentA11yAudit(this.element, assert); }); test('shows a single row by default and modifies on "Add More" and "Delete"', async function (assert) { diff --git a/ui/tests/integration/components/variable-paths-test.js b/ui/tests/integration/components/variable-paths-test.js index 8d584a09eae..c5cbf460e85 100644 --- a/ui/tests/integration/components/variable-paths-test.js +++ b/ui/tests/integration/components/variable-paths-test.js @@ -7,7 +7,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import { componentA11yAudit } from 'nomad-ui/tests/helpers/a11y-audit'; import pathTree from 'nomad-ui/utils/path-tree'; import Service from '@ember/service'; let tree; @@ -44,7 +43,6 @@ module('Integration | Component | variable-paths', function (hooks) { await render(hbs``); assert.dom('tbody tr').exists({ count: 0 }); - await componentA11yAudit(this.element, assert); }); test('it renders with data', async function (assert) { @@ -52,7 +50,6 @@ module('Integration | Component | variable-paths', function (hooks) { await render(hbs``); assert.dom('tbody tr').exists({ count: 2 }, 'There are two rows'); - await componentA11yAudit(this.element, assert); }); test('it allows for traversal: Folders', async function (assert) { @@ -73,7 +70,6 @@ module('Integration | Component | variable-paths', function (hooks) { 'Correctly renders the folder icon', ); - await componentA11yAudit(this.element, assert); }); test('it allows for traversal: Files', async function (assert) { @@ -137,6 +133,5 @@ module('Integration | Component | variable-paths', function (hooks) { 'file-text', 'Correctly renders the file icon', ); - await componentA11yAudit(this.element, assert); }); }); diff --git a/ui/tests/test-helper.ts b/ui/tests/test-helper.ts index fdb1ceeae90..a4ae48e1187 100644 --- a/ui/tests/test-helper.ts +++ b/ui/tests/test-helper.ts @@ -9,6 +9,7 @@ import * as QUnit from 'qunit'; import { setApplication } from '@ember/test-helpers'; import { setup } from 'qunit-dom'; import { setupEmberOnerrorValidation } from 'ember-qunit'; +import { setupGlobalA11yHooks } from 'ember-a11y-testing/test-support'; // @ts-expect-error: no types for ember-exam import { start } from 'ember-exam/test-support'; @@ -17,5 +18,14 @@ setApplication(Application.create(config.APP)); setup(QUnit.assert); setupEmberOnerrorValidation(); +// Configure ember-a11y-testing per addon instructions: +// https://github.com/ember-a11y/ember-a11y-testing +// +// Automatically run an a11y audit after every interaction helper (visit, +// click, fillIn, render, etc.) so accessibility is verified each time a page +// is visited. Acceptance tests should also call `a11yAudit` explicitly after +// `visit(...)` for an opt-in, assertion-emitting audit per route. +setupGlobalA11yHooks(() => true); + // eslint-disable-next-line @typescript-eslint/no-unsafe-call start();