Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get tests passing in Keynav: remove math helpers and a few other defensive moves #13761

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions ui/app/services/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,16 @@ export default class KeyboardService extends Service {
@action
registerNav(element, _, args) {
const { type } = args;
const links = Array.from(element.querySelectorAll('a:not(.loading)')).map(
(link) => {
return {
route: this.router.recognize(link.getAttribute('href'))?.name,
parent: guidFor(element),
};
}
);
const links = Array.from(element.querySelectorAll('a:not(.loading)'))
.map((link) => {
if (link.getAttribute('href')) {
return {
route: this.router.recognize(link.getAttribute('href'))?.name,
parent: guidFor(element),
};
}
})
.compact();

if (type === 'main') {
this.navLinks = links;
Expand Down
3 changes: 1 addition & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
"ember-inflector": "^4.0.2",
"ember-inline-svg": "^1.0.1",
"ember-load-initializers": "^2.1.2",
"ember-math-helpers": "^2.18.1",
"ember-maybe-import-regenerator": "^1.0.0",
"ember-modifier": "3.2.7",
"ember-moment": "^9.0.1",
Expand Down Expand Up @@ -174,7 +173,7 @@
},
"dependencies": {
"@hashicorp/ember-flight-icons": "^2.0.5",
"@percy/cli": "^1.1.0",
"@percy/cli": "^1.6.1",
"@percy/ember": "^3.0.0",
"curved-arrows": "^0.1.0",
"d3": "^7.3.0",
Expand Down
6 changes: 2 additions & 4 deletions ui/tests/integration/components/job-page/parts/body-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ module('Integration | Component | job-page/parts/body', function (hooks) {
<div class="inner-content">Inner content</div>
</JobPage::Parts::Body>
`);

assert.ok(find('[data-test-subnav="job"]'), 'Job subnav is rendered');
});

Expand All @@ -36,7 +35,7 @@ module('Integration | Component | job-page/parts/body', function (hooks) {

const store = this.owner.lookup('service:store');
const job = await store.createRecord('job', {
id: 'service-job',
id: '["service-job","default"]',
type: 'service',
});

Expand All @@ -51,7 +50,6 @@ module('Integration | Component | job-page/parts/body', function (hooks) {
const subnavLabels = findAll('[data-test-tab]').map((anchor) =>
anchor.textContent.trim()
);

assert.ok(
subnavLabels.some((label) => label === 'Definition'),
'Definition link'
Expand All @@ -72,7 +70,7 @@ module('Integration | Component | job-page/parts/body', function (hooks) {
test('the subnav does not include the deployments link when the job is not a service', async function (assert) {
const store = this.owner.lookup('service:store');
const job = await store.createRecord('job', {
id: 'batch-job',
id: '["batch-job","default"]',
type: 'batch',
});

Expand Down
17 changes: 0 additions & 17 deletions ui/tests/integration/helpers/keyboard-commands-test.js

This file was deleted.

160 changes: 78 additions & 82 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3221,96 +3221,96 @@
mkdirp "^1.0.4"
rimraf "^3.0.2"

"@percy/cli-build@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/cli-build/-/cli-build-1.1.0.tgz#0b154f482506f1abae4684758fd5f50447eb6dd8"
integrity sha512-99LDYYE5LPyRH6TL5mYapb0dNIQZkSrLq2I4ZyfTIUueoZ598QW1hg9IHo+URawFtjdFoMhaLlFGydMnizxCTw==
"@percy/cli-build@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/cli-build/-/cli-build-1.6.1.tgz#f49e6df1ca3b2f548c853c66f75ebb407e2302ea"
integrity sha512-YP4+uLfT14zI1bfjU+VE8fhu6RkwuhRK1AHIFcbonj/HlIhCdFWqyrWcmLp6HYU06JoiNtbI4QQNM3spxWrolg==
dependencies:
"@percy/cli-command" "1.1.0"
"@percy/cli-command" "1.6.1"

"@percy/cli-command@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/cli-command/-/cli-command-1.1.0.tgz#820e3c1fc1a403a6887861e9c8e6584fcb0cfe63"
integrity sha512-SMU/gVqXLm5GlThadby0uP8psDOsrUfNUIaFPtiPDSm0dT2dAyN1CAyvioEPQ2znPPMQSVegCvH23lfcYM4RXA==
"@percy/cli-command@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/cli-command/-/cli-command-1.6.1.tgz#e41b47d038e9ce52ffeeabba19d707468670829d"
integrity sha512-5jeKsKM+it3gh93vV48dBi725ewVGOfxUsjZU8slKcK9IaohXkjr0/aWor9LWgQcug87sLS9VjNlc+UyhTW0KA==
dependencies:
"@percy/config" "1.1.0"
"@percy/core" "1.1.0"
"@percy/logger" "1.1.0"
"@percy/config" "1.6.1"
"@percy/core" "1.6.1"
"@percy/logger" "1.6.1"

"@percy/cli-config@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/cli-config/-/cli-config-1.1.0.tgz#65d0f6e4ba68a4fbf37fd0b6d5b2c8e20a5a6b5e"
integrity sha512-zLtyippRN402sNIDVJw1ZYPEXj5zWZgOJMUWfBq8NUbfxRzYYGCz0opMKGocx1fV8VfaFs2DywewRWKlhPM/Aw==
"@percy/cli-config@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/cli-config/-/cli-config-1.6.1.tgz#f34c72fda6f9903770bb725693b8c7dbbad21150"
integrity sha512-fUO14gra2EdvY0RT5eSxH8QhammDtclcb2vjTwMG6QUW+sGDQQCu8M8s7YBxRKo/aTq+tJy1hfqd6W/rsx0mWQ==
dependencies:
"@percy/cli-command" "1.1.0"
"@percy/cli-command" "1.6.1"

"@percy/cli-exec@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/cli-exec/-/cli-exec-1.1.0.tgz#377670c92200b1963d4dc3b71001c01d2f524947"
integrity sha512-7c3mePcW1ZJnsv+BAaA6YzZcTM55Eaa4WFoBEMrPWvHGLHZe3O+gehbEFyooIsDJ1I/SplDNarH3j1L5m4GQFg==
"@percy/cli-exec@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/cli-exec/-/cli-exec-1.6.1.tgz#736e5f2c09080e19ebbcf84c1ded13c5e7db2b0b"
integrity sha512-F8j+reJWPu0s+zQuEU2Gm8SZ1QP7cf04MS5hmL1CaE7G7O88ec+yrS6eiSlNrY1+D45B7NYy7l6zWzsP+nQ3TA==
dependencies:
"@percy/cli-command" "1.1.0"
"@percy/cli-command" "1.6.1"
cross-spawn "^7.0.3"
which "^2.0.2"

"@percy/cli-snapshot@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/cli-snapshot/-/cli-snapshot-1.1.0.tgz#e418488967a5d30de047f8aceeb11e117dc386db"
integrity sha512-6MQhUGrRFl2g9PfqLXfTL1CVoBmamWu2fCjzfgmb9E/HHKIDzE07PrwszNzEXHhdzBHG9gRZ0Bt6kzZ/Fta5UQ==
"@percy/cli-snapshot@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/cli-snapshot/-/cli-snapshot-1.6.1.tgz#0da90a1cf6f7e79898f4f68f1e180c8c7c8f2894"
integrity sha512-lrZR/CIL1zkZdeOPmnidkVtWY6foOq3ekWbaoMgDu0agMjf2lxEX2DvkCS/WwdmF/JvDcquLKO6gS5EHE6mbBQ==
dependencies:
"@percy/cli-command" "1.1.0"
"@percy/cli-command" "1.6.1"
yaml "^2.0.0"

"@percy/cli-upload@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/cli-upload/-/cli-upload-1.1.0.tgz#99f8ee0a13c0e4cd80aa815adcb75d626846192e"
integrity sha512-P1GC3g0wYjy88h4zFBkInUcGWM8i99cJLyhKWg5WAK+bU5ot/Hc/4KgmNayHVxNJ/orcr1eHaP9pANbw82+igA==
"@percy/cli-upload@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/cli-upload/-/cli-upload-1.6.1.tgz#ffd95ca03d15081a77d9090d1c33b32044db849e"
integrity sha512-F+n7gy5CTfR0BUSsFdxEpfb9CNDnnhnFO0AN9v2FfyiSEei3CXrS2Te6DJS/YXnVI58YeFRbiW6G1LKhP+Vi4g==
dependencies:
"@percy/cli-command" "1.1.0"
"@percy/cli-command" "1.6.1"
fast-glob "^3.2.11"
image-size "^1.0.0"

"@percy/cli@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/cli/-/cli-1.1.0.tgz#587ac4c9553e9d72fff7b5310a168b7ea61b5763"
integrity sha512-3GSXhYEr3FA3xJnYsSMbP+GGnV/JSTcPjCVdS/yYq+PUSZlc9/36z6OE55mj/GBbskwlZ0B4xEsKTccpDtZngw==
dependencies:
"@percy/cli-build" "1.1.0"
"@percy/cli-command" "1.1.0"
"@percy/cli-config" "1.1.0"
"@percy/cli-exec" "1.1.0"
"@percy/cli-snapshot" "1.1.0"
"@percy/cli-upload" "1.1.0"
"@percy/client" "1.1.0"
"@percy/logger" "1.1.0"

"@percy/client@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/client/-/client-1.1.0.tgz#2f6f63d901604548c8df868fcf561e5896809601"
integrity sha512-AHbOlz/sAgTJeyMuDedW9+y/hYdKLneYEoE0kFTFQMelDzCn+CD7sW58tLLnBG8+wpjCAz65WGeK+3WNJ+R3IA==
"@percy/cli@^1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/cli/-/cli-1.6.1.tgz#d3910dd63d2b2b67e57e4c9c675eafb4d471322a"
integrity sha512-BwCcigFixUhi2Wn6X+oucJrqnk/6e4FOsYQI4+lDzZU416+WpsYF0CjmhQVpa9Us278L+qc7eIsDHJwuJeurFw==
dependencies:
"@percy/cli-build" "1.6.1"
"@percy/cli-command" "1.6.1"
"@percy/cli-config" "1.6.1"
"@percy/cli-exec" "1.6.1"
"@percy/cli-snapshot" "1.6.1"
"@percy/cli-upload" "1.6.1"
"@percy/client" "1.6.1"
"@percy/logger" "1.6.1"

"@percy/client@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/client/-/client-1.6.1.tgz#6bb136c2fe0ab0490acc898de21f8ab3508420a5"
integrity sha512-e5ToG88O1gDDOuQ+i4989vKCfF+CsPSGG9VA06IKSYNP4QBATe9/RYERZ5jk118uEutjxi8lIjzet0eg8rv7BA==
dependencies:
"@percy/env" "1.1.0"
"@percy/logger" "1.1.0"
"@percy/env" "1.6.1"
"@percy/logger" "1.6.1"

"@percy/config@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/config/-/config-1.1.0.tgz#3b15f2f342c5f05690be26a92b04320ff95e3441"
integrity sha512-Lsbyf81B6T9qfUYZnPzKplnScY8NBOXtXwd+r7oYLpMny80c4hKQ1zi9W1aOfpoWIq7j5L7N68exEQjE465LLQ==
"@percy/config@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/config/-/config-1.6.1.tgz#11fb960dca4ecc0575349382a973b6c5c941363a"
integrity sha512-UiB4gpt01VgPUF4ObZBixR1Wwi/ZUaMXBUxmE3wOa3zZrtZXOzbZwQGcntw5ToEq6OQBP100q1vetnP8xhFQtQ==
dependencies:
"@percy/logger" "1.1.0"
"@percy/logger" "1.6.1"
ajv "^8.6.2"
cosmiconfig "^7.0.0"
yaml "^2.0.0"

"@percy/core@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/core/-/core-1.1.0.tgz#485911e3fbbe4cec1d3fc2fb74ee8df06565341c"
integrity sha512-k7uBp4vXSwICM9n0sRgQiPXkiUbjNbTY3wPDVGY0h/lQwKL2CESt2G+pVl5h7I7OHmNHDZEDgrqpGuq/kDkxvQ==
"@percy/core@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/core/-/core-1.6.1.tgz#f18681ba4ba1d8f25cfe2c624424749ae0b2590a"
integrity sha512-a4EeoynE4pU7qExfLr56nmZNu3ozeCNFk6rCBQqoXbSJy6UVG8nj7U8AWEPeBHqtdk2M+30YAVr6mJCQjkZZ7w==
dependencies:
"@percy/client" "1.1.0"
"@percy/config" "1.1.0"
"@percy/dom" "1.1.0"
"@percy/logger" "1.1.0"
"@percy/client" "1.6.1"
"@percy/config" "1.6.1"
"@percy/dom" "1.6.1"
"@percy/logger" "1.6.1"
content-disposition "^0.5.4"
cross-spawn "^7.0.3"
extract-zip "^2.0.1"
Expand All @@ -3321,10 +3321,10 @@
rimraf "^3.0.2"
ws "^8.0.0"

"@percy/dom@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/dom/-/dom-1.1.0.tgz#743f46eaf298dd501c38739f1d5c35020ab78112"
integrity sha512-6doaOh81Guv+aPMayMCTA3O1Pa/YwH2uwT5NGo5dNjCdeomk/BnA+ZhtTRiarW0ymF7q+z6paGhq3R+717YuUQ==
"@percy/dom@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/dom/-/dom-1.6.1.tgz#8b8e82817dd88f8497ffce2d8fc5480466cbfef3"
integrity sha512-TAVGiE/7imR3Q6z1ogZFufX+SsPrElBOYNmj+MOFVJyzJ/cTjA9B510Blx1nXTu2VNdK2GAmRGQPbZDty34YMg==

"@percy/ember@^3.0.0":
version "3.0.0"
Expand All @@ -3334,16 +3334,21 @@
"@percy/sdk-utils" "^1.0.0-beta.46"
ember-cli-babel "^7.26.3"

"@percy/env@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/env/-/env-1.1.0.tgz#b04e769db0b6b71136b3112555727920302b2f77"
integrity sha512-Y2lSuiP+zyLSYf7IV/95MgNqiL6nRDYk9Ji8CMZPKuvPIrnCDExZ7nqszCli3hJ4qi6U4m1NykJWPDei4GjZNw==
"@percy/env@1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/env/-/env-1.6.1.tgz#5119de7526e006242b76688c24e94822113af139"
integrity sha512-AguYuqRcKHkCnWndvq1pTrxeUXT0mNULSi9p7D0nN1744036RcdVrE/EhZbgK2fshSHxIrnfPSj0Lnt4Of46lg==

"@percy/[email protected]":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/logger/-/logger-1.1.0.tgz#6bb5df0563d3566071f8b718e61f11a04c5a2722"
integrity sha512-bAlxBcdnViTpGQZtjs361vXSlaxEj6Zt4Wt1Mo7EdPwv/zya2cBpLFNNcRycWto4mdb5Qnpht+IPXf7RFXJ/nw==

"@percy/[email protected]":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@percy/logger/-/logger-1.6.1.tgz#754e3bdaa4419aadc2d7fa95b63f4ef757483cd4"
integrity sha512-cOMzDbg6Or1SnyzT9xCnwIiMDQ4sUR7Ha91CE6NWpV273Ef5PtvBA0joIB7wWSe7t2/a8hQrYJ6eGU4rUcsuTw==

"@percy/sdk-utils@^1.0.0-beta.46":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@percy/sdk-utils/-/sdk-utils-1.1.0.tgz#2e69b228e0fffbceaccea3cbf8585dbb7a3ef5a4"
Expand Down Expand Up @@ -10162,15 +10167,6 @@ ember-load-initializers@^2.1.2:
ember-cli-babel "^7.13.0"
ember-cli-typescript "^2.0.2"

ember-math-helpers@^2.18.1:
version "2.18.1"
resolved "https://registry.yarnpkg.com/ember-math-helpers/-/ember-math-helpers-2.18.1.tgz#7e64a0ac4ab604e2c7b88c77c7751be2e5e24aa8"
integrity sha512-CWLnGHqxDW++l7dvZXDs7gq9CL6XL6tXIQC8nurxyeFbrm0BQ9kWxd3sLVyhGoRUMjrPTHisbD75xj191U/yRw==
dependencies:
broccoli-funnel "^3.0.8"
ember-cli-babel "^7.26.11"
ember-cli-htmlbars "^6.0.1"

ember-maybe-import-regenerator@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ember-maybe-import-regenerator/-/ember-maybe-import-regenerator-1.0.0.tgz#c05453dfd3b65dbec2b569612b01ae70b672dd7e"
Expand Down