Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions ui/tests/acceptance/access-control-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();

Expand Down Expand Up @@ -63,7 +77,6 @@ module('Acceptance | access control', function (hooks) {
'management token can access /administration',
);

await a11yAudit(assert);

await Administration.visitTokens();
assert.deepEqual(
Expand Down
19 changes: 17 additions & 2 deletions ui/tests/acceptance/actions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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();
Expand Down
48 changes: 48 additions & 0 deletions ui/tests/acceptance/administration-tokens-test.js
Original file line number Diff line number Diff line change
@@ -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');
});
});
5 changes: 3 additions & 2 deletions ui/tests/acceptance/allocation-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions ui/tests/acceptance/application-errors-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions ui/tests/acceptance/behaviors/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions ui/tests/acceptance/client-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions ui/tests/acceptance/client-monitor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions ui/tests/acceptance/clients-list-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions ui/tests/acceptance/dynamic-host-volume-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions ui/tests/acceptance/evaluations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions ui/tests/acceptance/exec-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
8 changes: 8 additions & 0 deletions ui/tests/acceptance/global-header-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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');

Expand Down
5 changes: 3 additions & 2 deletions ui/tests/acceptance/job-allocations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions ui/tests/acceptance/job-clients-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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) {
Expand Down
Loading
Loading