diff --git a/ui/tests/acceptance/allocation-detail-test.js b/ui/tests/acceptance/allocation-detail-test.js index 1fdc767dfba..8fc11906d54 100644 --- a/ui/tests/acceptance/allocation-detail-test.js +++ b/ui/tests/acceptance/allocation-detail-test.js @@ -4,6 +4,7 @@ import { assign } from '@ember/polyfills'; import { module, test } from 'qunit'; 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'; @@ -46,6 +47,11 @@ module('Acceptance | allocation detail', function(hooks) { await Allocation.visit({ id: allocation.id }); }); + test('it passes an accessibility audit', async function(assert) { + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/allocation/:id should name the allocation and link to the corresponding job and node', async function(assert) { assert.ok(Allocation.title.includes(allocation.name), 'Allocation name is in the heading'); assert.equal(Allocation.details.job, job.name, 'Job name is in the subheading'); diff --git a/ui/tests/acceptance/application-errors-test.js b/ui/tests/acceptance/application-errors-test.js index ceec14f5040..ac9ac9bb94f 100644 --- a/ui/tests/acceptance/application-errors-test.js +++ b/ui/tests/acceptance/application-errors-test.js @@ -2,6 +2,7 @@ import { currentURL, visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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'; @@ -16,6 +17,14 @@ module('Acceptance | application errors ', function(hooks) { server.create('job'); }); + test('it passes an accessibility audit', async function(assert) { + server.pretender.get('/v1/nodes', () => [500, {}, null]); + await ClientsList.visit(); + await a11yAudit(); + + assert.ok(true, 'a11y audit passes'); + }); + test('transitioning away from an error page resets the global error', async function(assert) { server.pretender.get('/v1/nodes', () => [500, {}, null]); diff --git a/ui/tests/acceptance/behaviors/fs.js b/ui/tests/acceptance/behaviors/fs.js index 0d13c021f59..574bd06555a 100644 --- a/ui/tests/acceptance/behaviors/fs.js +++ b/ui/tests/acceptance/behaviors/fs.js @@ -3,6 +3,7 @@ import { currentURL, visit } from '@ember/test-helpers'; import { filesForPath } from 'nomad-ui/mirage/config'; import { formatBytes } from 'nomad-ui/helpers/format-bytes'; +import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import Response from 'ember-cli-mirage/response'; import moment from 'moment'; @@ -24,6 +25,12 @@ const fileSort = (prop, files) => { }; export default function browseFilesystem({ pageObjectVisitPathFunctionName, pageObjectVisitFunctionName, visitSegments, getExpectedPathBase, getTitleComponent, getBreadcrumbComponent, getFilesystemRoot }) { + test('it passes an accessibility audit', async function(assert) { + await FS[pageObjectVisitFunctionName](visitSegments({allocation: this.allocation, task: this.task })); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('visiting filesystem root', async function(assert) { await FS[pageObjectVisitFunctionName](visitSegments({allocation: this.allocation, task: this.task })); diff --git a/ui/tests/acceptance/client-detail-test.js b/ui/tests/acceptance/client-detail-test.js index 104429cb64c..4d0b2b2ce2a 100644 --- a/ui/tests/acceptance/client-detail-test.js +++ b/ui/tests/acceptance/client-detail-test.js @@ -3,6 +3,7 @@ import { assign } from '@ember/polyfills'; import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; +import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { formatBytes } from 'nomad-ui/helpers/format-bytes'; import moment from 'moment'; import ClientDetail from 'nomad-ui/tests/pages/clients/detail'; @@ -41,6 +42,12 @@ module('Acceptance | client detail', function(hooks) { }); }); + test('it passes an accessibility audit', async function(assert) { + await ClientDetail.visit({ id: node.id }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/clients/:id should have a breadcrumb trail linking back to clients', async function(assert) { await ClientDetail.visit({ id: node.id }); diff --git a/ui/tests/acceptance/client-monitor-test.js b/ui/tests/acceptance/client-monitor-test.js index d9ea888a4ba..2107034d779 100644 --- a/ui/tests/acceptance/client-monitor-test.js +++ b/ui/tests/acceptance/client-monitor-test.js @@ -3,6 +3,7 @@ import { run } from '@ember/runloop'; import { module, test } from 'qunit'; 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'; let node; @@ -25,6 +26,12 @@ module('Acceptance | client monitor', function(hooks) { run.later(run, run.cancelTimers, 500); }); + test('it passes an accessibility audit', async function(assert) { + await ClientMonitor.visit({ id: node.id }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/clients/:id/monitor should have a breadcrumb trail linking back to clients', async function(assert) { await ClientMonitor.visit({ id: node.id }); diff --git a/ui/tests/acceptance/clients-list-test.js b/ui/tests/acceptance/clients-list-test.js index db4e52bca27..282ba522117 100644 --- a/ui/tests/acceptance/clients-list-test.js +++ b/ui/tests/acceptance/clients-list-test.js @@ -2,6 +2,7 @@ import { currentURL, settled } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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'; @@ -13,6 +14,17 @@ module('Acceptance | clients list', function(hooks) { window.localStorage.clear(); }); + test('it passes an accessibility audit', async function(assert) { + const nodesCount = ClientsList.pageSize + 1; + + server.createList('node', nodesCount); + server.createList('agent', 1); + + await ClientsList.visit(); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/clients should list one page of clients', async function(assert) { // Make sure to make more nodes than 1 page to assert that pagination is working const nodesCount = ClientsList.pageSize + 1; diff --git a/ui/tests/acceptance/exec-test.js b/ui/tests/acceptance/exec-test.js index a367b276aa2..13e20dd3fef 100644 --- a/ui/tests/acceptance/exec-test.js +++ b/ui/tests/acceptance/exec-test.js @@ -2,6 +2,7 @@ import { module, skip, test } from 'qunit'; 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'; @@ -33,6 +34,12 @@ module('Acceptance | exec', function(hooks) { }); }); + test('it passes an accessibility audit', async function(assert) { + await Exec.visitJob({ job: this.job.id }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/exec/:job should show the region, namespace, and job name', async function(assert) { server.create('namespace'); let namespace = server.create('namespace'); diff --git a/ui/tests/acceptance/job-allocations-test.js b/ui/tests/acceptance/job-allocations-test.js index 011cbf8b875..3d0a4102863 100644 --- a/ui/tests/acceptance/job-allocations-test.js +++ b/ui/tests/acceptance/job-allocations-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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'; let job; @@ -28,6 +29,15 @@ module('Acceptance | job allocations', function(hooks) { job = server.create('job', { noFailedPlacements: true, createAllocations: false }); }); + test('it passes an accessibility audit', async function(assert) { + server.createList('allocation', Allocations.pageSize - 1, { shallow: true }); + allocations = server.schema.allocations.where({ jobId: job.id }).models; + + await Allocations.visit({ id: job.id }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('lists all allocations for the job', async function(assert) { server.createList('allocation', Allocations.pageSize - 1, { shallow: true }); allocations = server.schema.allocations.where({ jobId: job.id }).models; diff --git a/ui/tests/acceptance/job-definition-test.js b/ui/tests/acceptance/job-definition-test.js index 973fb5a5f75..59b60981ec1 100644 --- a/ui/tests/acceptance/job-definition-test.js +++ b/ui/tests/acceptance/job-definition-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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'; @@ -19,6 +20,11 @@ module('Acceptance | job definition', function(hooks) { await Definition.visit({ id: job.id }); }); + test('it passes an accessibility audit', async function(assert) { + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('visiting /jobs/:job_id/definition', async function(assert) { assert.equal(currentURL(), `/jobs/${job.id}/definition`); assert.equal(document.title, `Job ${job.name} definition - Nomad`); diff --git a/ui/tests/acceptance/job-deployments-test.js b/ui/tests/acceptance/job-deployments-test.js index e683c1c2c76..3c935fc8240 100644 --- a/ui/tests/acceptance/job-deployments-test.js +++ b/ui/tests/acceptance/job-deployments-test.js @@ -3,6 +3,7 @@ import { get } from '@ember/object'; import { module, test } from 'qunit'; 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'; @@ -33,6 +34,12 @@ module('Acceptance | job deployments', function(hooks) { }); }); + test('it passes an accessibility audit', async function(assert) { + await Deployments.visit({ id: job.id }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/jobs/:id/deployments should list all job deployments', async function(assert) { await Deployments.visit({ id: job.id }); diff --git a/ui/tests/acceptance/job-detail-test.js b/ui/tests/acceptance/job-detail-test.js index 0a94ad75077..16c8b18e437 100644 --- a/ui/tests/acceptance/job-detail-test.js +++ b/ui/tests/acceptance/job-detail-test.js @@ -3,6 +3,7 @@ import { module, test } from 'qunit'; 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 moduleForJob from 'nomad-ui/tests/helpers/module-for-job'; import JobDetail from 'nomad-ui/tests/pages/jobs/detail'; import JobsList from 'nomad-ui/tests/pages/jobs/list'; @@ -76,6 +77,13 @@ module('Acceptance | job detail (with namespaces)', function(hooks) { clientToken = server.create('token'); }); + test('it passes an accessibility audit', async function(assert) { + const namespace = server.db.namespaces.find(job.namespaceId); + await JobDetail.visit({ id: job.id, namespace: namespace.name }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('when there are namespaces, the job detail page states the namespace for the job', async function(assert) { const namespace = server.db.namespaces.find(job.namespaceId); await JobDetail.visit({ id: job.id, namespace: namespace.name }); diff --git a/ui/tests/acceptance/job-evaluations-test.js b/ui/tests/acceptance/job-evaluations-test.js index 1bc3a67e670..5e1195fef5c 100644 --- a/ui/tests/acceptance/job-evaluations-test.js +++ b/ui/tests/acceptance/job-evaluations-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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; @@ -18,6 +19,11 @@ module('Acceptance | job evaluations', function(hooks) { await Evaluations.visit({ id: job.id }); }); + test('it passes an accessibility audit', async function(assert) { + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('lists all evaluations for the job', async function(assert) { assert.equal(Evaluations.evaluations.length, evaluations.length, 'All evaluations are listed'); diff --git a/ui/tests/acceptance/job-run-test.js b/ui/tests/acceptance/job-run-test.js index fcdb0a2d8e5..f0596bca212 100644 --- a/ui/tests/acceptance/job-run-test.js +++ b/ui/tests/acceptance/job-run-test.js @@ -3,6 +3,7 @@ import { assign } from '@ember/polyfills'; import { module, test } from 'qunit'; 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'; @@ -54,6 +55,12 @@ module('Acceptance | job run', function(hooks) { window.localStorage.nomadTokenSecret = managementToken.secretId; }); + test('it passes an accessibility audit', async function(assert) { + await JobRun.visit(); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('visiting /jobs/run', async function(assert) { await JobRun.visit(); diff --git a/ui/tests/acceptance/job-versions-test.js b/ui/tests/acceptance/job-versions-test.js index 7990437be45..6aed64e5d2b 100644 --- a/ui/tests/acceptance/job-versions-test.js +++ b/ui/tests/acceptance/job-versions-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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 moment from 'moment'; @@ -19,6 +20,11 @@ module('Acceptance | job versions', function(hooks) { await Versions.visit({ id: job.id }); }); + test('it passes an accessibility audit', async function(assert) { + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/jobs/:id/versions should list all job versions', async function(assert) { assert.ok(Versions.versions.length, versions.length, 'Each version gets a row in the timeline'); assert.equal(document.title, `Job ${job.name} versions - Nomad`); diff --git a/ui/tests/acceptance/jobs-list-test.js b/ui/tests/acceptance/jobs-list-test.js index ff5b438381c..4b35c379a20 100644 --- a/ui/tests/acceptance/jobs-list-test.js +++ b/ui/tests/acceptance/jobs-list-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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 Layout from 'nomad-ui/tests/pages/layout'; @@ -23,6 +24,12 @@ module('Acceptance | jobs list', function(hooks) { window.localStorage.nomadTokenSecret = managementToken.secretId; }); + test('it passes an accessibility audit', async function(assert) { + await JobsList.visit(); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('visiting /jobs', async function(assert) { await JobsList.visit(); diff --git a/ui/tests/acceptance/namespaces-test.js b/ui/tests/acceptance/namespaces-test.js index d25e8d369de..3c0c31cd6e4 100644 --- a/ui/tests/acceptance/namespaces-test.js +++ b/ui/tests/acceptance/namespaces-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; +import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { selectChoose } from 'ember-power-select/test-support'; import JobsList from 'nomad-ui/tests/pages/jobs/list'; import ClientsList from 'nomad-ui/tests/pages/clients/list'; @@ -47,6 +48,12 @@ module('Acceptance | namespaces (enabled)', function(hooks) { window.localStorage.clear(); }); + test('it passes an accessibility audit', async function(assert) { + await JobsList.visit(); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('the namespace switcher lists all namespaces', async function(assert) { const namespaces = server.db.namespaces; diff --git a/ui/tests/acceptance/plugin-allocations-test.js b/ui/tests/acceptance/plugin-allocations-test.js index 1d4cfddc5fc..15156bd89f9 100644 --- a/ui/tests/acceptance/plugin-allocations-test.js +++ b/ui/tests/acceptance/plugin-allocations-test.js @@ -2,6 +2,7 @@ import { module, test } from 'qunit'; 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 pageSizeSelect from './behaviors/page-size-select'; import PluginAllocations from 'nomad-ui/tests/pages/storage/plugins/plugin/allocations'; @@ -16,6 +17,19 @@ module('Acceptance | plugin allocations', function(hooks) { window.localStorage.clear(); }); + test('it passes an accessibility audit', async function(assert) { + plugin = server.create('csi-plugin', { + shallow: true, + controllerRequired: true, + controllersExpected: 3, + nodesExpected: 3, + }); + + await PluginAllocations.visit({ id: plugin.id }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/csi/plugins/:id/allocations shows all allocations in a single table', async function(assert) { plugin = server.create('csi-plugin', { shallow: true, diff --git a/ui/tests/acceptance/plugin-detail-test.js b/ui/tests/acceptance/plugin-detail-test.js index 5c618024122..405bd3b2f5a 100644 --- a/ui/tests/acceptance/plugin-detail-test.js +++ b/ui/tests/acceptance/plugin-detail-test.js @@ -2,6 +2,7 @@ import { module, test } from 'qunit'; 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 moment from 'moment'; import { formatBytes } from 'nomad-ui/helpers/format-bytes'; import PluginDetail from 'nomad-ui/tests/pages/storage/plugins/detail'; @@ -17,6 +18,12 @@ module('Acceptance | plugin detail', function(hooks) { plugin = server.create('csi-plugin', { controllerRequired: true }); }); + test('it passes an accessibility audit', async function(assert) { + await PluginDetail.visit({ id: plugin.id }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/csi/plugins/:id should have a breadcrumb trail linking back to Plugins and Storage', async function(assert) { await PluginDetail.visit({ id: plugin.id }); diff --git a/ui/tests/acceptance/plugins-list-test.js b/ui/tests/acceptance/plugins-list-test.js index 22710fa2b69..37279683a50 100644 --- a/ui/tests/acceptance/plugins-list-test.js +++ b/ui/tests/acceptance/plugins-list-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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 PluginsList from 'nomad-ui/tests/pages/storage/plugins/list'; @@ -14,6 +15,12 @@ module('Acceptance | plugins list', function(hooks) { window.localStorage.clear(); }); + test('it passes an accessibility audit', async function(assert) { + await PluginsList.visit(); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('visiting /csi/plugins', async function(assert) { await PluginsList.visit(); diff --git a/ui/tests/acceptance/regions-test.js b/ui/tests/acceptance/regions-test.js index 2bfeb53f2df..b3305ff018a 100644 --- a/ui/tests/acceptance/regions-test.js +++ b/ui/tests/acceptance/regions-test.js @@ -3,6 +3,7 @@ import { module, test } from 'qunit'; 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 PageLayout from 'nomad-ui/tests/pages/layout'; @@ -18,6 +19,12 @@ module('Acceptance | regions (only one)', function(hooks) { server.createList('job', 2, { createAllocations: false, noDeployments: true }); }); + test('it passes an accessibility audit', async function(assert) { + await JobsList.visit(); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('when there is only one region, the region switcher is not shown in the nav bar and the region is not in the page title', async function(assert) { server.create('region', { id: 'global' }); diff --git a/ui/tests/acceptance/server-detail-test.js b/ui/tests/acceptance/server-detail-test.js index 82560352eca..1f84307566d 100644 --- a/ui/tests/acceptance/server-detail-test.js +++ b/ui/tests/acceptance/server-detail-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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'; let agent; @@ -16,6 +17,11 @@ module('Acceptance | server detail', function(hooks) { await ServerDetail.visit({ name: agent.name }); }); + test('it passes an accessibility audit', async function(assert) { + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('visiting /servers/:server_name', async function(assert) { assert.equal(currentURL(), `/servers/${encodeURIComponent(agent.name)}`); assert.equal(document.title, `Server ${agent.name} - Nomad`); diff --git a/ui/tests/acceptance/server-monitor-test.js b/ui/tests/acceptance/server-monitor-test.js index 5c64fdd3fde..d5a6cbdfccd 100644 --- a/ui/tests/acceptance/server-monitor-test.js +++ b/ui/tests/acceptance/server-monitor-test.js @@ -3,6 +3,7 @@ import { run } from '@ember/runloop'; import { module, test } from 'qunit'; 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'; let agent; @@ -24,6 +25,12 @@ module('Acceptance | server monitor', function(hooks) { run.later(run, run.cancelTimers, 500); }); + test('it passes an accessibility audit', async function(assert) { + await ServerMonitor.visit({ name: agent.name }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/servers/:id/monitor should have a breadcrumb trail linking back to servers', async function(assert) { await ServerMonitor.visit({ name: agent.name }); diff --git a/ui/tests/acceptance/servers-list-test.js b/ui/tests/acceptance/servers-list-test.js index 8e588b87378..0b5ccf00566 100644 --- a/ui/tests/acceptance/servers-list-test.js +++ b/ui/tests/acceptance/servers-list-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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'; @@ -23,6 +24,13 @@ module('Acceptance | servers list', function(hooks) { setupApplicationTest(hooks); setupMirage(hooks); + test('it passes an accessibility audit', async function(assert) { + minimumSetup(); + await ServersList.visit(); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/servers should list all servers', async function(assert) { server.createList('node', 1); server.createList('agent', 10); diff --git a/ui/tests/acceptance/task-detail-test.js b/ui/tests/acceptance/task-detail-test.js index d9d219d0696..585f03ff91a 100644 --- a/ui/tests/acceptance/task-detail-test.js +++ b/ui/tests/acceptance/task-detail-test.js @@ -2,6 +2,7 @@ import { currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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 moment from 'moment'; @@ -22,6 +23,11 @@ module('Acceptance | task detail', function(hooks) { await Task.visit({ id: allocation.id, name: task.name }); }); + test('it passes an accessibility audit', async function(assert) { + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/allocation/:id/:task_name should name the task and list high-level task information', async function(assert) { assert.ok(Task.title.text.includes(task.name), 'Task name'); assert.ok(Task.state.includes(task.state), 'Task state'); diff --git a/ui/tests/acceptance/task-group-detail-test.js b/ui/tests/acceptance/task-group-detail-test.js index 15b477b3491..3f667bd3f4c 100644 --- a/ui/tests/acceptance/task-group-detail-test.js +++ b/ui/tests/acceptance/task-group-detail-test.js @@ -2,6 +2,7 @@ import { currentURL, settled } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; +import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit'; import { formatBytes } from 'nomad-ui/helpers/format-bytes'; import TaskGroup from 'nomad-ui/tests/pages/jobs/job/task-group'; import pageSizeSelect from './behaviors/page-size-select'; @@ -67,6 +68,12 @@ module('Acceptance | task group detail', function(hooks) { window.localStorage.clear(); }); + test('it passes an accessibility audit', async function(assert) { + await TaskGroup.visit({ id: job.id, name: taskGroup.name }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/jobs/:id/:task-group should list high-level metrics for the allocation', async function(assert) { const totalCPU = tasks.mapBy('Resources.CPU').reduce(sum, 0); const totalMemory = tasks.mapBy('Resources.MemoryMB').reduce(sum, 0); diff --git a/ui/tests/acceptance/task-logs-test.js b/ui/tests/acceptance/task-logs-test.js index 12a38ae2a03..ebba5b25325 100644 --- a/ui/tests/acceptance/task-logs-test.js +++ b/ui/tests/acceptance/task-logs-test.js @@ -3,6 +3,7 @@ import { run } from '@ember/runloop'; import { module, test } from 'qunit'; 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'; let allocation; @@ -24,6 +25,11 @@ module('Acceptance | task logs', function(hooks) { await TaskLogs.visit({ id: allocation.id, name: task.name }); }); + test('it passes an accessibility audit', async function(assert) { + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/allocation/:id/:task_name/logs should have a log component', async function(assert) { assert.equal(currentURL(), `/allocations/${allocation.id}/${task.name}/logs`, 'No redirect'); assert.ok(TaskLogs.hasTaskLog, 'Task log component found'); diff --git a/ui/tests/acceptance/token-test.js b/ui/tests/acceptance/token-test.js index 7109f5b72d9..a7e0f9c8b97 100644 --- a/ui/tests/acceptance/token-test.js +++ b/ui/tests/acceptance/token-test.js @@ -2,6 +2,7 @@ import { find } from '@ember/test-helpers'; import { module, skip, test } from 'qunit'; 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'; @@ -27,6 +28,12 @@ module('Acceptance | tokens', function(hooks) { clientToken = server.create('token'); }); + test('it passes an accessibility audit', async function(assert) { + await Tokens.visit(); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('the token form sets the token in local storage', async function(assert) { const { secretId } = managementToken; diff --git a/ui/tests/acceptance/volume-detail-test.js b/ui/tests/acceptance/volume-detail-test.js index 01139293030..bbe785ad9d4 100644 --- a/ui/tests/acceptance/volume-detail-test.js +++ b/ui/tests/acceptance/volume-detail-test.js @@ -2,6 +2,7 @@ import { module, test } from 'qunit'; 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 moment from 'moment'; import { formatBytes } from 'nomad-ui/helpers/format-bytes'; import VolumeDetail from 'nomad-ui/tests/pages/storage/volumes/detail'; @@ -28,6 +29,12 @@ module('Acceptance | volume detail', function(hooks) { volume = server.create('csi-volume'); }); + test('it passes an accessibility audit', async function(assert) { + await VolumeDetail.visit({ id: volume.id }); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('/csi/volumes/:id should have a breadcrumb trail linking back to Volumes and Storage', async function(assert) { await VolumeDetail.visit({ id: volume.id }); diff --git a/ui/tests/acceptance/volumes-list-test.js b/ui/tests/acceptance/volumes-list-test.js index e48108a5df8..2818716fbc8 100644 --- a/ui/tests/acceptance/volumes-list-test.js +++ b/ui/tests/acceptance/volumes-list-test.js @@ -2,6 +2,7 @@ import { currentURL, visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; 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 VolumesList from 'nomad-ui/tests/pages/storage/volumes/list'; import Layout from 'nomad-ui/tests/pages/layout'; @@ -26,6 +27,12 @@ module('Acceptance | volumes list', function(hooks) { window.localStorage.clear(); }); + test('it passes an accessibility audit', async function(assert) { + await VolumesList.visit(); + await a11yAudit(); + assert.ok(true, 'a11y audit passes'); + }); + test('visiting /csi redirects to /csi/volumes', async function(assert) { await visit('/csi');