Skip to content

Commit

Permalink
Update ember-a11y-testing (#9912)
Browse files Browse the repository at this point in the history
This includes seemingly-unrelated changes because of dependency updates.
  • Loading branch information
backspace committed Feb 2, 2021
1 parent 14344f4 commit 2103e55
Show file tree
Hide file tree
Showing 5 changed files with 4,544 additions and 7,286 deletions.
4 changes: 2 additions & 2 deletions ui/app/adapters/watchable.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class Watchable extends ApplicationAdapter {
signal,
data: params,
}).catch(error => {
if (error instanceof AbortError) {
if (error instanceof AbortError || error.name == 'AbortError') {
return;
}
throw error;
Expand Down Expand Up @@ -149,7 +149,7 @@ export default class Watchable extends ApplicationAdapter {
store.push(normalizedData);
},
error => {
if (error instanceof AbortError) {
if (error instanceof AbortError || error.name === 'AbortError') {
return relationship.kind === 'belongsTo' ? {} : [];
}
throw error;
Expand Down
6 changes: 3 additions & 3 deletions ui/mirage/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export default function() {
});

this.get('/acl/token/self', function({ tokens }, req) {
const secret = req.requestHeaders['x-nomad-token'];
const secret = req.requestHeaders['X-Nomad-Token'];
const tokenForSecret = tokens.findBy({ secretId: secret });

// Return the token if it exists
Expand All @@ -366,7 +366,7 @@ export default function() {

this.get('/acl/token/:id', function({ tokens }, req) {
const token = tokens.find(req.params.id);
const secret = req.requestHeaders['x-nomad-token'];
const secret = req.requestHeaders['X-Nomad-Token'];
const tokenForSecret = tokens.findBy({ secretId: secret });

// Return the token only if the request header matches the token
Expand All @@ -381,7 +381,7 @@ export default function() {

this.get('/acl/policy/:id', function({ policies, tokens }, req) {
const policy = policies.find(req.params.id);
const secret = req.requestHeaders['x-nomad-token'];
const secret = req.requestHeaders['X-Nomad-Token'];
const tokenForSecret = tokens.findBy({ secretId: secret });

if (req.params.id === 'anonymous') {
Expand Down
5 changes: 3 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"devDependencies": {
"@babel/plugin-proposal-object-rest-spread": "^7.4.3",
"@ember/optional-features": "^1.3.0",
"@ember/test-helpers": "^2.0.0",
"@glimmer/component": "^1.0.0",
"@glimmer/tracking": "^1.0.0",
"@hashicorp/structure-icons": "^1.3.0",
Expand All @@ -52,7 +53,7 @@
"d3-time-format": "^2.1.0",
"d3-transition": "^1.1.0",
"duration-js": "^4.0.0",
"ember-a11y-testing": "^3.0.2",
"ember-a11y-testing": "^4.0.0",
"ember-auto-import": "^1.5.3",
"ember-can": "^2.0.0",
"ember-classic-decorator": "^1.0.8",
Expand All @@ -79,7 +80,7 @@
"ember-data-model-fragments": "4.0.0",
"ember-decorators": "^6.1.1",
"ember-export-application-global": "^2.0.1",
"ember-fetch": "^7.0.0",
"ember-fetch": "^8.0.2",
"ember-inflector": "^3.0.0",
"ember-inline-svg": "^0.3.0",
"ember-load-initializers": "^2.1.1",
Expand Down
8 changes: 4 additions & 4 deletions ui/tests/unit/adapters/job-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ module('Unit | Adapter | Job', function(hooks) {
);
});

test('When there is no token set in the token service, no x-nomad-token header is set', async function(assert) {
test('When there is no token set in the token service, no X-Nomad-Token header is set', async function(assert) {
await this.initializeUI();

const { pretender } = this.server;
Expand All @@ -143,12 +143,12 @@ module('Unit | Adapter | Job', function(hooks) {
await settled();

assert.notOk(
pretender.handledRequests.mapBy('requestHeaders').some(headers => headers['x-nomad-token']),
pretender.handledRequests.mapBy('requestHeaders').some(headers => headers['X-Nomad-Token']),
'No token header present on either job request'
);
});

test('When a token is set in the token service, then x-nomad-token header is set', async function(assert) {
test('When a token is set in the token service, then X-Nomad-Token header is set', async function(assert) {
await this.initializeUI();

const { pretender } = this.server;
Expand All @@ -162,7 +162,7 @@ module('Unit | Adapter | Job', function(hooks) {
assert.ok(
pretender.handledRequests
.mapBy('requestHeaders')
.every(headers => headers['x-nomad-token'] === secret),
.every(headers => headers['X-Nomad-Token'] === secret),
'The token header is present on both job requests'
);
});
Expand Down

0 comments on commit 2103e55

Please sign in to comment.