@@ -186,29 +276,46 @@
- Name |
- Type |
- Source |
- Permissions |
+
+ Name
+ |
+
+ Type
+ |
+
+ Source
+ |
+
+ Permissions
+ |
{{#if row.model.isCSI}}
-
+
{{row.model.name}}
{{else}}
{{row.model.name}}
{{/if}}
|
- {{row.model.type}} |
- {{row.model.source}} |
- {{if row.model.readOnly "Read" "Read/Write"}} |
+
+ {{row.model.type}}
+ |
+
+ {{row.model.source}}
+ |
+
+ {{if row.model.readOnly "Read" "Read/Write"}}
+ |
{{/if}}
-
+
\ No newline at end of file
diff --git a/ui/config/environment.js b/ui/config/environment.js
index d0bfae30743..5cfb8fc4b08 100644
--- a/ui/config/environment.js
+++ b/ui/config/environment.js
@@ -25,8 +25,8 @@ module.exports = function (environment) {
APP: {
blockingQueries: true,
- mirageScenario: 'topoMedium',
- mirageWithNamespaces: false,
+ mirageScenario: 'smallCluster',
+ mirageWithNamespaces: true,
mirageWithTokens: true,
mirageWithRegions: true,
showStorybookLink: process.env.STORYBOOK_LINK === 'true',
diff --git a/ui/tests/acceptance/allocation-detail-test.js b/ui/tests/acceptance/allocation-detail-test.js
index a22ff469fa1..ed447d45699 100644
--- a/ui/tests/acceptance/allocation-detail-test.js
+++ b/ui/tests/acceptance/allocation-detail-test.js
@@ -499,6 +499,7 @@ module('Acceptance | allocation detail (preemptions)', function (hooks) {
);
await Allocation.visit({ id: allocation.id });
+
await Allocation.preempter.visitJob();
assert.equal(
currentURL(),
diff --git a/ui/tests/acceptance/job-detail-test.js b/ui/tests/acceptance/job-detail-test.js
index e6027ef3c95..4dc485cf1b4 100644
--- a/ui/tests/acceptance/job-detail-test.js
+++ b/ui/tests/acceptance/job-detail-test.js
@@ -251,13 +251,16 @@ module('Acceptance | job detail (with namespaces)', function (hooks) {
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 JobDetail.visit({ id: `${job.id}@${namespace.name}` });
await a11yAudit(assert);
});
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 });
+
+ await JobDetail.visit({
+ id: `${job.id}@${namespace.name}`,
+ });
assert.ok(
JobDetail.statFor('namespace').text,
@@ -301,7 +304,8 @@ module('Acceptance | job detail (with namespaces)', function (hooks) {
assert.notOk(JobDetail.execButton.isDisabled);
const secondNamespace = server.db.namespaces[1];
- await JobDetail.visit({ id: job2.id, namespace: secondNamespace.name });
+ await JobDetail.visit({ id: `${job2.id}@${secondNamespace.name}` });
+
assert.ok(JobDetail.execButton.isDisabled);
});
@@ -322,9 +326,9 @@ module('Acceptance | job detail (with namespaces)', function (hooks) {
});
await JobDetail.visit({
- id: job.id,
- namespace: server.db.namespaces[1].name,
+ id: `${job.id}@${server.db.namespaces[1].name}`,
});
+
assert.notOk(JobDetail.execButton.isDisabled);
});
@@ -338,14 +342,13 @@ module('Acceptance | job detail (with namespaces)', function (hooks) {
});
await JobDetail.visit({
- id: job.id,
- namespace: server.db.namespaces[1].name,
+ id: `${job.id}@${server.db.namespaces[1].name}`,
});
+
assert.notOk(JobDetail.metaTable, 'Meta table not present');
await JobDetail.visit({
- id: jobWithMeta.id,
- namespace: server.db.namespaces[1].name,
+ id: `${jobWithMeta.id}@${server.db.namespaces[1].name}`,
});
assert.ok(JobDetail.metaTable, 'Meta table is present');
});
@@ -361,7 +364,8 @@ module('Acceptance | job detail (with namespaces)', function (hooks) {
},
});
- await JobDetail.visit({ id: jobFromPack.id, namespace });
+ await JobDetail.visit({ id: `${jobFromPack.id}@${namespace}` });
+
assert.ok(JobDetail.packTag, 'Pack tag is present');
assert.equal(
JobDetail.packStatFor('name').text,
@@ -388,8 +392,7 @@ module('Acceptance | job detail (with namespaces)', function (hooks) {
window.localStorage.nomadTokenSecret = managementToken.secretId;
await JobDetail.visit({
- id: job.id,
- namespace: server.db.namespaces[1].name,
+ id: `${job.id}@${server.db.namespaces[1].name}`,
});
const groupsWithRecommendations = job.taskGroups.filter((group) =>
@@ -439,8 +442,7 @@ module('Acceptance | job detail (with namespaces)', function (hooks) {
test('resource recommendations are not fetched when the feature doesn’t exist', async function (assert) {
window.localStorage.nomadTokenSecret = managementToken.secretId;
await JobDetail.visit({
- id: job.id,
- namespace: server.db.namespaces[1].name,
+ id: `${job.id}@${server.db.namespaces[1].name}`,
});
assert.equal(JobDetail.recommendations.length, 0);
@@ -518,10 +520,10 @@ module('Acceptance | job detail (with namespaces)', function (hooks) {
clientToken.save();
window.localStorage.nomadTokenSecret = clientToken.secretId;
- await JobDetail.visit({ id: job.id, namespace: namespace.name });
+ await JobDetail.visit({ id: `${job.id}@${namespace.name}` });
assert.notOk(JobDetail.incrementButton.isDisabled);
- await JobDetail.visit({ id: job2.id, namespace: secondNamespace.name });
+ await JobDetail.visit({ id: `${job2.id}@${secondNamespace.name}` });
assert.ok(JobDetail.incrementButton.isDisabled);
});
});
diff --git a/ui/tests/acceptance/job-dispatch-test.js b/ui/tests/acceptance/job-dispatch-test.js
index ef476431074..e7f0e011370 100644
--- a/ui/tests/acceptance/job-dispatch-test.js
+++ b/ui/tests/acceptance/job-dispatch-test.js
@@ -54,12 +54,12 @@ function moduleForJobDispatch(title, jobFactory) {
});
test('it passes an accessibility audit', async function (assert) {
- await JobDispatch.visit({ id: job.id, namespace: namespace.name });
+ await JobDispatch.visit({ id: `${job.id}@${namespace.name}` });
await a11yAudit(assert);
});
test('the dispatch button is displayed with management token', async function (assert) {
- await JobDetail.visit({ id: job.id, namespace: namespace.name });
+ await JobDetail.visit({ id: `${job.id}@${namespace.name}` });
assert.notOk(JobDetail.dispatchButton.isDisabled);
});
@@ -82,7 +82,7 @@ function moduleForJobDispatch(title, jobFactory) {
clientToken.policyIds = [policy.id];
clientToken.save();
- await JobDetail.visit({ id: job.id, namespace: namespace.name });
+ await JobDetail.visit({ id: `${job.id}@${namespace.name}` });
assert.notOk(JobDetail.dispatchButton.isDisabled);
// Reset clientToken policies.
@@ -93,12 +93,12 @@ function moduleForJobDispatch(title, jobFactory) {
test('the dispatch button is disabled when not allowed', async function (assert) {
window.localStorage.nomadTokenSecret = clientToken.secretId;
- await JobDetail.visit({ id: job.id, namespace: namespace.name });
+ await JobDetail.visit({ id: `${job.id}@${namespace.name}` });
assert.ok(JobDetail.dispatchButton.isDisabled);
});
test('all meta fields are displayed', async function (assert) {
- await JobDispatch.visit({ id: job.id, namespace: namespace.name });
+ await JobDispatch.visit({ id: `${job.id}@${namespace.name}` });
assert.equal(
JobDispatch.metaFields.length,
job.parameterizedJob.MetaOptional.length +
@@ -107,7 +107,7 @@ function moduleForJobDispatch(title, jobFactory) {
});
test('required meta fields are properly indicated', async function (assert) {
- await JobDispatch.visit({ id: job.id, namespace: namespace.name });
+ await JobDispatch.visit({ id: `${job.id}@${namespace.name}` });
JobDispatch.metaFields.forEach((f) => {
const hasIndicator = f.label.includes(REQUIRED_INDICATOR);
@@ -136,10 +136,7 @@ function moduleForJobDispatch(title, jobFactory) {
},
});
- await JobDispatch.visit({
- id: jobWithoutMeta.id,
- namespace: namespace.name,
- });
+ await JobDispatch.visit({ id: `${jobWithoutMeta.id}@${namespace.name}` });
assert.ok(JobDispatch.dispatchButton.isPresent);
});
@@ -147,7 +144,7 @@ function moduleForJobDispatch(title, jobFactory) {
job.parameterizedJob.Payload = 'forbidden';
job.save();
- await JobDispatch.visit({ id: job.id, namespace: namespace.name });
+ await JobDispatch.visit({ id: `${job.id}@${namespace.name}` });
assert.ok(JobDispatch.payload.emptyMessage.isPresent);
assert.notOk(JobDispatch.payload.editor.isPresent);
@@ -170,8 +167,7 @@ function moduleForJobDispatch(title, jobFactory) {
});
await JobDispatch.visit({
- id: jobPayloadRequired.id,
- namespace: namespace.name,
+ id: `${jobPayloadRequired.id}@${namespace.name}`,
});
let payloadTitle = JobDispatch.payload.title;
@@ -181,8 +177,7 @@ function moduleForJobDispatch(title, jobFactory) {
);
await JobDispatch.visit({
- id: jobPayloadOptional.id,
- namespace: namespace.name,
+ id: `${jobPayloadOptional.id}@${namespace.name}`,
});
payloadTitle = JobDispatch.payload.title;
@@ -199,7 +194,7 @@ function moduleForJobDispatch(title, jobFactory) {
).length;
}
- await JobDispatch.visit({ id: job.id, namespace: namespace.name });
+ await JobDispatch.visit({ id: `${job.id}@${namespace.name}` });
// Fill form.
JobDispatch.metaFields.map((f) => f.field.input('meta value'));
@@ -222,7 +217,7 @@ function moduleForJobDispatch(title, jobFactory) {
job.parameterizedJob.Payload = 'forbidden';
job.save();
- await JobDispatch.visit({ id: job.id, namespace: namespace.name });
+ await JobDispatch.visit({ id: `${job.id}@${namespace.name}` });
// Fill only optional meta params.
JobDispatch.optionalMetaFields.map((f) => f.field.input('meta value'));
@@ -237,7 +232,7 @@ function moduleForJobDispatch(title, jobFactory) {
job.parameterizedJob.Payload = 'required';
job.save();
- await JobDispatch.visit({ id: job.id, namespace: namespace.name });
+ await JobDispatch.visit({ id: `${job.id}@${namespace.name}` });
await JobDispatch.dispatchButton.click();
assert.ok(JobDispatch.hasError, 'Dispatch error message is shown');
diff --git a/ui/tests/acceptance/job-versions-test.js b/ui/tests/acceptance/job-versions-test.js
index af43ded0a28..596c5df8880 100644
--- a/ui/tests/acceptance/job-versions-test.js
+++ b/ui/tests/acceptance/job-versions-test.js
@@ -30,7 +30,7 @@ module('Acceptance | job versions', function (hooks) {
const managementToken = server.create('token');
window.localStorage.nomadTokenSecret = managementToken.secretId;
- await Versions.visit({ id: job.id, namespace: namespace.id });
+ await Versions.visit({ id: `${job.id}@${namespace.id}` });
});
test('it passes an accessibility audit', async function (assert) {
diff --git a/ui/tests/acceptance/task-detail-test.js b/ui/tests/acceptance/task-detail-test.js
index b9adbb3d082..ab3f8c16766 100644
--- a/ui/tests/acceptance/task-detail-test.js
+++ b/ui/tests/acceptance/task-detail-test.js
@@ -375,7 +375,7 @@ module('Acceptance | task detail (different namespace)', function (hooks) {
await Layout.breadcrumbFor('jobs.job.index').visit();
assert.equal(
currentURL(),
- `/jobs/${job.id}?namespace=other-namespace`,
+ `/jobs/${job.id}@other-namespace`,
'Job breadcrumb links correctly'
);
@@ -383,7 +383,7 @@ module('Acceptance | task detail (different namespace)', function (hooks) {
await Layout.breadcrumbFor('jobs.job.task-group').visit();
assert.equal(
currentURL(),
- `/jobs/${job.id}/${taskGroup}?namespace=other-namespace`,
+ `/jobs/${job.id}@other-namespace/${taskGroup}`,
'Task Group breadcrumb links correctly'
);
diff --git a/ui/tests/acceptance/task-group-detail-test.js b/ui/tests/acceptance/task-group-detail-test.js
index 97facf08c54..dc54767564a 100644
--- a/ui/tests/acceptance/task-group-detail-test.js
+++ b/ui/tests/acceptance/task-group-detail-test.js
@@ -104,7 +104,7 @@ module('Acceptance | task group detail', function (hooks) {
totalMemoryMaxAddendum = ` (${formatScheduledBytes(
totalMemoryMax,
'MiB'
- )} Max)`;
+ )}Max)`;
}
assert.equal(
@@ -232,25 +232,23 @@ module('Acceptance | task group detail', function (hooks) {
window.localStorage.nomadTokenSecret = clientToken.secretId;
await TaskGroup.visit({
- id: job.id,
+ id: `${job.id}@${SCALE_AND_WRITE_NAMESPACE}`,
name: scalingGroup.name,
- namespace: SCALE_AND_WRITE_NAMESPACE,
});
assert.equal(
- currentURL(),
- `/jobs/${job.id}/scaling?namespace=${SCALE_AND_WRITE_NAMESPACE}`
+ decodeURIComponent(currentURL()),
+ `/jobs/${job.id}@${SCALE_AND_WRITE_NAMESPACE}/scaling`
);
assert.notOk(TaskGroup.countStepper.increment.isDisabled);
await TaskGroup.visit({
- id: job2.id,
+ id: `${job2.id}@${secondNamespace.name}`,
name: scalingGroup2.name,
- namespace: secondNamespace.name,
});
assert.equal(
- currentURL(),
- `/jobs/${job2.id}/scaling?namespace=${READ_ONLY_NAMESPACE}`
+ decodeURIComponent(currentURL()),
+ `/jobs/${job2.id}@${READ_ONLY_NAMESPACE}/scaling`
);
assert.ok(TaskGroup.countStepper.increment.isDisabled);
});
diff --git a/ui/tests/acceptance/volume-detail-test.js b/ui/tests/acceptance/volume-detail-test.js
index fb264110acf..fdb6f291c4b 100644
--- a/ui/tests/acceptance/volume-detail-test.js
+++ b/ui/tests/acceptance/volume-detail-test.js
@@ -34,12 +34,12 @@ module('Acceptance | volume detail', function (hooks) {
});
test('it passes an accessibility audit', async function (assert) {
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
await a11yAudit(assert);
});
test('/csi/volumes/:id should have a breadcrumb trail linking back to Volumes and Storage', async function (assert) {
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
assert.equal(Layout.breadcrumbFor('csi.index').text, 'Storage');
assert.equal(Layout.breadcrumbFor('csi.volumes').text, 'Volumes');
@@ -47,14 +47,14 @@ module('Acceptance | volume detail', function (hooks) {
});
test('/csi/volumes/:id should show the volume name in the title', async function (assert) {
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
assert.equal(document.title, `CSI Volume ${volume.name} - Nomad`);
assert.equal(VolumeDetail.title, volume.name);
});
test('/csi/volumes/:id should list additional details for the volume below the title', async function (assert) {
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
assert.ok(
VolumeDetail.health.includes(
@@ -75,7 +75,7 @@ module('Acceptance | volume detail', function (hooks) {
writeAllocations.forEach((alloc) => assignWriteAlloc(volume, alloc));
readAllocations.forEach((alloc) => assignReadAlloc(volume, alloc));
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
assert.equal(VolumeDetail.writeAllocations.length, writeAllocations.length);
writeAllocations
@@ -95,7 +95,7 @@ module('Acceptance | volume detail', function (hooks) {
writeAllocations.forEach((alloc) => assignWriteAlloc(volume, alloc));
readAllocations.forEach((alloc) => assignReadAlloc(volume, alloc));
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
assert.equal(VolumeDetail.readAllocations.length, readAllocations.length);
readAllocations
@@ -126,7 +126,7 @@ module('Acceptance | volume detail', function (hooks) {
0
);
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
VolumeDetail.writeAllocations.objectAt(0).as((allocationRow) => {
assert.equal(
@@ -198,28 +198,28 @@ module('Acceptance | volume detail', function (hooks) {
const allocation = server.create('allocation');
assignWriteAlloc(volume, allocation);
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
await VolumeDetail.writeAllocations.objectAt(0).visit();
assert.equal(currentURL(), `/allocations/${allocation.id}`);
});
test('when there are no write allocations, the table presents an empty state', async function (assert) {
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
assert.ok(VolumeDetail.writeTableIsEmpty);
assert.equal(VolumeDetail.writeEmptyState.headline, 'No Write Allocations');
});
test('when there are no read allocations, the table presents an empty state', async function (assert) {
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
assert.ok(VolumeDetail.readTableIsEmpty);
assert.equal(VolumeDetail.readEmptyState.headline, 'No Read Allocations');
});
test('the constraints table shows access mode and attachment mode', async function (assert) {
- await VolumeDetail.visit({ id: volume.id });
+ await VolumeDetail.visit({ id: `${volume.id}@default` });
assert.equal(VolumeDetail.constraints.accessMode, volume.accessMode);
assert.equal(
@@ -244,7 +244,7 @@ module('Acceptance | volume detail (with namespaces)', function (hooks) {
});
test('/csi/volumes/:id detail ribbon includes the namespace of the volume', async function (assert) {
- await VolumeDetail.visit({ id: volume.id, namespace: volume.namespaceId });
+ await VolumeDetail.visit({ id: `${volume.id}@${volume.namespaceId}` });
assert.ok(VolumeDetail.hasNamespace);
assert.ok(VolumeDetail.namespace.includes(volume.namespaceId || 'default'));
diff --git a/ui/tests/acceptance/volumes-list-test.js b/ui/tests/acceptance/volumes-list-test.js
index 0876aa36a1b..c7a3fee9b21 100644
--- a/ui/tests/acceptance/volumes-list-test.js
+++ b/ui/tests/acceptance/volumes-list-test.js
@@ -79,7 +79,7 @@ module('Acceptance | volumes list', function (hooks) {
const isHealthy = healthy > 0;
controllerHealthStr = `${
isHealthy ? 'Healthy' : 'Unhealthy'
- } (${healthy}/${expected})`;
+ } ( ${healthy} / ${expected} )`;
}
const nodeHealthStr = volume.nodesHealthy > 0 ? 'Healthy' : 'Unhealthy';
@@ -93,7 +93,7 @@ module('Acceptance | volumes list', function (hooks) {
assert.equal(volumeRow.controllerHealth, controllerHealthStr);
assert.equal(
volumeRow.nodeHealth,
- `${nodeHealthStr} (${volume.nodesHealthy}/${volume.nodesExpected})`
+ `${nodeHealthStr} ( ${volume.nodesHealthy} / ${volume.nodesExpected} )`
);
assert.equal(volumeRow.provider, volume.provider);
assert.equal(volumeRow.allocations, readAllocs.length + writeAllocs.length);
@@ -110,7 +110,7 @@ module('Acceptance | volumes list', function (hooks) {
await VolumesList.volumes.objectAt(0).clickName();
assert.equal(
currentURL(),
- `/csi/volumes/${volume.id}?namespace=${secondNamespace.id}`
+ `/csi/volumes/${volume.id}@${secondNamespace.id}`
);
await VolumesList.visit({ namespace: '*' });
@@ -119,7 +119,7 @@ module('Acceptance | volumes list', function (hooks) {
await VolumesList.volumes.objectAt(0).clickRow();
assert.equal(
currentURL(),
- `/csi/volumes/${volume.id}?namespace=${secondNamespace.id}`
+ `/csi/volumes/${volume.id}@${secondNamespace.id}`
);
});
diff --git a/ui/tests/helpers/module-for-job.js b/ui/tests/helpers/module-for-job.js
index 53d373ae812..327481acc95 100644
--- a/ui/tests/helpers/module-for-job.js
+++ b/ui/tests/helpers/module-for-job.js
@@ -41,7 +41,7 @@ export default function moduleForJob(
if (!job.namespace || job.namespace === 'default') {
await JobDetail.visit({ id: job.id });
} else {
- await JobDetail.visit({ id: job.id, namespace: job.namespace });
+ await JobDetail.visit({ id: `${job.id}@${job.namespace}` });
}
const hasClientStatus = ['system', 'sysbatch'].includes(job.type);
@@ -51,52 +51,52 @@ export default function moduleForJob(
});
test('visiting /jobs/:job_id', async function (assert) {
- assert.equal(
- currentURL(),
- urlWithNamespace(`/jobs/${encodeURIComponent(job.id)}`, job.namespace)
- );
+ const expectedURL = job.namespace
+ ? `/jobs/${job.name}@${job.namespace}`
+ : `/jobs/${job.name}`;
+
+ assert.equal(decodeURIComponent(currentURL()), expectedURL);
assert.equal(document.title, `Job ${job.name} - Nomad`);
});
test('the subnav links to overview', async function (assert) {
await JobDetail.tabFor('overview').visit();
- assert.equal(
- currentURL(),
- urlWithNamespace(`/jobs/${encodeURIComponent(job.id)}`, job.namespace)
- );
+
+ const expectedURL = job.namespace
+ ? `/jobs/${job.name}@${job.namespace}`
+ : `/jobs/${job.name}`;
+
+ assert.equal(decodeURIComponent(currentURL()), expectedURL);
});
test('the subnav links to definition', async function (assert) {
await JobDetail.tabFor('definition').visit();
- assert.equal(
- currentURL(),
- urlWithNamespace(
- `/jobs/${encodeURIComponent(job.id)}/definition`,
- job.namespace
- )
- );
+
+ const expectedURL = job.namespace
+ ? `/jobs/${job.name}@${job.namespace}/definition`
+ : `/jobs/${job.name}/definition`;
+
+ assert.equal(decodeURIComponent(currentURL()), expectedURL);
});
test('the subnav links to versions', async function (assert) {
await JobDetail.tabFor('versions').visit();
- assert.equal(
- currentURL(),
- urlWithNamespace(
- `/jobs/${encodeURIComponent(job.id)}/versions`,
- job.namespace
- )
- );
+
+ const expectedURL = job.namespace
+ ? `/jobs/${job.name}@${job.namespace}/versions`
+ : `/jobs/${job.name}/versions`;
+
+ assert.equal(decodeURIComponent(currentURL()), expectedURL);
});
test('the subnav links to evaluations', async function (assert) {
await JobDetail.tabFor('evaluations').visit();
- assert.equal(
- currentURL(),
- urlWithNamespace(
- `/jobs/${encodeURIComponent(job.id)}/evaluations`,
- job.namespace
- )
- );
+
+ const expectedURL = job.namespace
+ ? `/jobs/${job.name}@${job.namespace}/evaluations`
+ : `/jobs/${job.name}/evaluations`;
+
+ assert.equal(decodeURIComponent(currentURL()), expectedURL);
});
test('the title buttons are dependent on job status', async function (assert) {
@@ -145,7 +145,7 @@ export default function moduleForJob(
const encodedStatus = encodeURIComponent(JSON.stringify([status]));
const expectedURL = new URL(
urlWithNamespace(
- `/jobs/${job.name}/clients?status=${encodedStatus}`,
+ `/jobs/${job.name}@default/clients?status=${encodedStatus}`,
job.namespace
),
window.location
@@ -248,13 +248,12 @@ export function moduleForJobWithClientStatus(
test('the subnav links to clients', async function (assert) {
await JobDetail.tabFor('clients').visit();
- assert.equal(
- currentURL(),
- urlWithNamespace(
- `/jobs/${encodeURIComponent(job.id)}/clients`,
- job.namespace
- )
- );
+
+ const expectedURL = job.namespace
+ ? `/jobs/${job.id}@${job.namespace}/clients`
+ : `/jobs/${job.id}/clients`;
+
+ assert.equal(currentURL(), expectedURL);
});
test('job status summary is shown in the overview', async function (assert) {
@@ -289,23 +288,12 @@ export function moduleForJobWithClientStatus(
await slice.click();
const encodedStatus = encodeURIComponent(JSON.stringify([status]));
- const expectedURL = new URL(
- urlWithNamespace(
- `/jobs/${job.name}/clients?status=${encodedStatus}`,
- job.namespace
- ),
- window.location
- );
- const gotURL = new URL(currentURL(), window.location);
- assert.deepEqual(gotURL.pathname, expectedURL.pathname);
- // Sort and compare URL query params.
- gotURL.searchParams.sort();
- expectedURL.searchParams.sort();
- assert.equal(
- gotURL.searchParams.toString(),
- expectedURL.searchParams.toString()
- );
+ const expectedURL = job.namespace
+ ? `/jobs/${job.name}@${job.namespace}/clients?status=${encodedStatus}`
+ : `/jobs/${job.name}/clients?status=${encodedStatus}`;
+
+ assert.deepEqual(currentURL(), expectedURL, 'url is correct');
});
for (var testName in additionalTests) {
@@ -368,6 +356,6 @@ async function visitJobDetailPage({ id, namespace }) {
if (!namespace || namespace === 'default') {
await JobDetail.visit({ id });
} else {
- await JobDetail.visit({ id, namespace });
+ await JobDetail.visit({ id: `${id}@${namespace}` });
}
}