Skip to content

Commit

Permalink
Management token for variables to appear in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Jul 21, 2023
1 parent ef9afc9 commit fb97568
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui/mirage/scenarios/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ function mediumCluster(server) {

function variableTestCluster(server) {
faker.seed(1);
createTokens(server);
server.create('token', {
name: 'Novars Murphy',
id: 'n0-v4r5-4cc355',
type: 'client',
});
createTokens(server);
createNamespaces(server);
server.createList('agent', 3, 'withConsulLink', 'withVaultLink');
server.createList('node-pool', 3);
Expand Down
4 changes: 4 additions & 0 deletions ui/tests/acceptance/keyboard-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ module('Acceptance | keyboard', function (hooks) {
});

test('Dynamic nav arrows and looping', async function (assert) {
// Make sure user is a management token so Variables appears, etc.
let token = server.create('token', { type: 'management' });
window.localStorage.nomadTokenSecret = token.secretId;
server.createList('job', 3, { createAllocations: true, type: 'system' });
const jobID = server.db.jobs.sortBy('modifyIndex').reverse()[0].id;
await visit(`/jobs/${jobID}@default`);
Expand Down Expand Up @@ -370,6 +373,7 @@ module('Acceptance | keyboard', function (hooks) {
`/jobs/${jobID}@default`,
'Shift+ArrowRight takes you to the first tab in the loop'
);
window.localStorage.nomadTokenSecret = null; // Reset Token
});

test('Region switching', async function (assert) {
Expand Down

0 comments on commit fb97568

Please sign in to comment.