diff --git a/ui/app/templates/components/gutter-menu.hbs b/ui/app/templates/components/gutter-menu.hbs index e531a8c61ef..7878a4baf02 100644 --- a/ui/app/templates/components/gutter-menu.hbs +++ b/ui/app/templates/components/gutter-menu.hbs @@ -51,13 +51,27 @@ Workload
Integrations
Cluster diff --git a/ui/tests/acceptance/jobs-list-test.js b/ui/tests/acceptance/jobs-list-test.js index 5e0a15c6883..1a23555abcb 100644 --- a/ui/tests/acceptance/jobs-list-test.js +++ b/ui/tests/acceptance/jobs-list-test.js @@ -4,6 +4,7 @@ import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; import pageSizeSelect from './behaviors/page-size-select'; import JobsList from 'nomad-ui/tests/pages/jobs/list'; +import Layout from 'nomad-ui/tests/pages/layout'; let managementToken, clientToken; @@ -341,6 +342,17 @@ module('Acceptance | jobs list', function(hooks) { assert.equal(JobsList.jobs.length, 1, 'Only one job shown due to query param'); }); + test('the active namespace is carried over to the storage pages', async function(assert) { + server.createList('namespace', 2); + + const namespace = server.db.namespaces[1]; + await JobsList.visit({ namespace: namespace.id }); + + await Layout.gutter.visitStorage(); + + assert.equal(currentURL(), `/csi/volumes?namespace=${namespace.id}`); + }); + pageSizeSelect({ resourceName: 'job', pageObject: JobsList, diff --git a/ui/tests/acceptance/volumes-list-test.js b/ui/tests/acceptance/volumes-list-test.js index 4c15ff44ac4..e48108a5df8 100644 --- a/ui/tests/acceptance/volumes-list-test.js +++ b/ui/tests/acceptance/volumes-list-test.js @@ -4,6 +4,7 @@ import { setupApplicationTest } from 'ember-qunit'; import { setupMirage } from 'ember-cli-mirage/test-support'; 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'; const assignWriteAlloc = (volume, alloc) => { volume.writeAllocs.add(alloc); @@ -142,6 +143,17 @@ module('Acceptance | volumes list', function(hooks) { assert.equal(VolumesList.volumes.objectAt(0).name, volume2.id); }); + test('the active namespace is carried over to the jobs pages', async function(assert) { + server.createList('namespace', 2); + + const namespace = server.db.namespaces[1]; + await VolumesList.visit({ namespace: namespace.id }); + + await Layout.gutter.visitJobs(); + + assert.equal(currentURL(), `/jobs?namespace=${namespace.id}`); + }); + test('when accessing volumes is forbidden, a message is shown with a link to the tokens page', async function(assert) { server.pretender.get('/v1/volumes', () => [403, {}, null]); diff --git a/ui/tests/pages/layout.js b/ui/tests/pages/layout.js index e276310bb14..257caf2e804 100644 --- a/ui/tests/pages/layout.js +++ b/ui/tests/pages/layout.js @@ -27,5 +27,6 @@ export default create({ visitJobs: clickable('[data-test-gutter-link="jobs"]'), visitClients: clickable('[data-test-gutter-link="clients"]'), visitServers: clickable('[data-test-gutter-link="servers"]'), + visitStorage: clickable('[data-test-gutter-link="storage"]'), }, });