mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge branch 'master' into compare-update-and-release-dates
This commit is contained in:
commit
28174f0ad1
18
.swcrc
Normal file
18
.swcrc
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"module": {
|
||||
"type": "commonjs"
|
||||
},
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true,
|
||||
"decorators": true,
|
||||
"dynamicImport": false
|
||||
},
|
||||
"transform": {
|
||||
"legacyDecorator": true,
|
||||
"decoratorMetadata": true
|
||||
},
|
||||
"target": "es2019"
|
||||
}
|
||||
}
|
||||
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2021 OpenLens Authors.
|
||||
Copyright (c) 2022 OpenLens Authors.
|
||||
|
||||
Portions of this software are licensed as follows:
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ Lens IDE a standalone application for MacOS, Windows and Linux operating systems
|
||||
|
||||
## Installation
|
||||
|
||||
See [Getting Started](https://docs.k8slens.dev/latest/getting-started/) page.
|
||||
See [Getting Started](https://docs.k8slens.dev/main/getting-started/install-lens/) page.
|
||||
|
||||
## Development
|
||||
|
||||
|
||||
88
package.json
88
package.json
@ -3,9 +3,9 @@
|
||||
"productName": "OpenLens",
|
||||
"description": "OpenLens - Open Source IDE for Kubernetes",
|
||||
"homepage": "https://github.com/lensapp/lens",
|
||||
"version": "5.6.0-alpha.0",
|
||||
"version": "5.6.0-alpha.3",
|
||||
"main": "static/build/main.js",
|
||||
"copyright": "© 2021 OpenLens Authors",
|
||||
"copyright": "© 2022 OpenLens Authors",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "OpenLens Authors",
|
||||
@ -49,7 +49,8 @@
|
||||
"k8sProxyVersion": "0.2.1",
|
||||
"bundledKubectlVersion": "1.23.3",
|
||||
"bundledHelmVersion": "3.7.2",
|
||||
"sentryDsn": ""
|
||||
"sentryDsn": "",
|
||||
"contentSecurityPolicy": "script-src 'unsafe-eval' 'self'; frame-src http://*.localhost:*/; img-src * data:"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 <17"
|
||||
@ -58,8 +59,12 @@
|
||||
"collectCoverage": false,
|
||||
"verbose": true,
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
"^.+\\.(t|j)sx?$": [
|
||||
"@swc/jest"
|
||||
]
|
||||
},
|
||||
"testEnvironment": "jsdom",
|
||||
"resolver": "<rootDir>/src/jest-28-resolver.js",
|
||||
"moduleNameMapper": {
|
||||
"\\.(css|scss)$": "identity-obj-proxy",
|
||||
"\\.(svg|png|jpg|eot|woff2?|ttf)$": "<rootDir>/__mocks__/assetMock.ts"
|
||||
@ -75,12 +80,7 @@
|
||||
"setupFilesAfterEnv": [
|
||||
"<rootDir>/src/jest-after-env.setup.ts"
|
||||
],
|
||||
"globals": {
|
||||
"ts-jest": {
|
||||
"isolatedModules": true
|
||||
}
|
||||
},
|
||||
"globalSetup": "<rootDir>/src/jest.timezone.ts"
|
||||
"runtime": "@side/jest-runtime"
|
||||
},
|
||||
"build": {
|
||||
"generateUpdatesFilesForAllChannels": true,
|
||||
@ -204,16 +204,18 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@astronautlabs/jsonpath": "^1.1.0",
|
||||
"@hapi/call": "^8.0.1",
|
||||
"@hapi/subtext": "^7.0.3",
|
||||
"@hapi/call": "^9.0.0",
|
||||
"@hapi/subtext": "^7.0.4",
|
||||
"@kubernetes/client-node": "^0.16.3",
|
||||
"@material-ui/styles": "^4.11.5",
|
||||
"@ogre-tools/injectable": "7.0.0",
|
||||
"@ogre-tools/injectable-react": "7.0.0",
|
||||
"@ogre-tools/fp": "7.0.0",
|
||||
"@ogre-tools/injectable-extension-for-auto-registration": "7.0.0",
|
||||
"@ogre-tools/fp": "9.0.0",
|
||||
"@ogre-tools/injectable": "9.0.0",
|
||||
"@ogre-tools/injectable-extension-for-auto-registration": "9.0.0",
|
||||
"@ogre-tools/injectable-extension-for-mobx": "9.0.0",
|
||||
"@ogre-tools/injectable-react": "9.0.0",
|
||||
"@sentry/electron": "^3.0.7",
|
||||
"@sentry/integrations": "^6.19.3",
|
||||
"@side/jest-runtime": "^1.0.1",
|
||||
"@types/circular-dependency-plugin": "5.0.5",
|
||||
"abort-controller": "^3.0.0",
|
||||
"auto-bind": "^4.0.0",
|
||||
@ -233,15 +235,15 @@
|
||||
"handlebars": "^4.7.7",
|
||||
"history": "^4.10.1",
|
||||
"http-proxy": "^1.18.1",
|
||||
"immer": "^9.0.14",
|
||||
"immer": "^9.0.15",
|
||||
"joi": "^17.6.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"jsdom": "^16.7.0",
|
||||
"lodash": "^4.17.15",
|
||||
"mac-ca": "^1.0.6",
|
||||
"marked": "^4.0.16",
|
||||
"marked": "^4.0.17",
|
||||
"md5-file": "^5.0.0",
|
||||
"mobx": "^6.5.0",
|
||||
"mobx": "^6.6.0",
|
||||
"mobx-observable-history": "^2.0.3",
|
||||
"mobx-react": "^7.5.0",
|
||||
"mobx-utils": "^6.0.4",
|
||||
@ -279,7 +281,7 @@
|
||||
"winston": "^3.7.2",
|
||||
"winston-console-format": "^1.0.8",
|
||||
"winston-transport-browserconsole": "^1.0.5",
|
||||
"ws": "^8.7.0"
|
||||
"ws": "^8.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@async-fn/jest": "1.6.1",
|
||||
@ -288,6 +290,8 @@
|
||||
"@material-ui/lab": "^4.0.0-alpha.60",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
|
||||
"@sentry/types": "^6.19.7",
|
||||
"@swc/core": "^1.2.197",
|
||||
"@swc/jest": "^0.2.21",
|
||||
"@testing-library/dom": "^7.31.2",
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"@testing-library/react": "^12.1.5",
|
||||
@ -304,9 +308,11 @@
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/glob-to-regexp": "^0.4.1",
|
||||
"@types/gunzip-maybe": "^1.4.0",
|
||||
"@types/hapi__call": "^9.0.0",
|
||||
"@types/hapi__subtext": "^7.0.0",
|
||||
"@types/html-webpack-plugin": "^3.2.6",
|
||||
"@types/http-proxy": "^1.17.9",
|
||||
"@types/jest": "^26.0.24",
|
||||
"@types/jest": "^28.1.1",
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"@types/jsdom": "^16.2.14",
|
||||
"@types/lodash": "^4.14.181",
|
||||
@ -314,8 +320,8 @@
|
||||
"@types/md5-file": "^4.0.2",
|
||||
"@types/mini-css-extract-plugin": "^2.4.0",
|
||||
"@types/mock-fs": "^4.13.1",
|
||||
"@types/node": "^16.11.39",
|
||||
"@types/node-fetch": "^2.6.1",
|
||||
"@types/node": "^16.11.41",
|
||||
"@types/node-fetch": "^2.6.2",
|
||||
"@types/npm": "^2.0.32",
|
||||
"@types/proper-lockfile": "^4.1.2",
|
||||
"@types/randomcolor": "^0.5.6",
|
||||
@ -330,8 +336,8 @@
|
||||
"@types/readable-stream": "^2.3.13",
|
||||
"@types/request": "^2.48.7",
|
||||
"@types/request-promise-native": "^1.0.18",
|
||||
"@types/semver": "^7.3.9",
|
||||
"@types/sharp": "^0.30.2",
|
||||
"@types/semver": "^7.3.10",
|
||||
"@types/sharp": "^0.30.4",
|
||||
"@types/spdy": "^3.4.5",
|
||||
"@types/tar": "^4.0.5",
|
||||
"@types/tar-stream": "^2.2.2",
|
||||
@ -344,28 +350,28 @@
|
||||
"@types/webpack-dev-server": "^4.7.2",
|
||||
"@types/webpack-env": "^1.17.0",
|
||||
"@types/webpack-node-externals": "^2.5.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
||||
"@typescript-eslint/parser": "^5.27.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
||||
"@typescript-eslint/parser": "^5.28.0",
|
||||
"ansi_up": "^5.1.0",
|
||||
"chart.js": "^2.9.4",
|
||||
"circular-dependency-plugin": "^5.2.2",
|
||||
"cli-progress": "^3.11.1",
|
||||
"color": "^3.2.1",
|
||||
"command-line-args": "^5.2.1",
|
||||
"concurrently": "^7.2.1",
|
||||
"concurrently": "^7.2.2",
|
||||
"css-loader": "^6.7.1",
|
||||
"deepdash": "^5.3.9",
|
||||
"dompurify": "^2.3.8",
|
||||
"electron": "^15.5.7",
|
||||
"electron-builder": "^23.0.3",
|
||||
"electron-notarize": "^0.3.0",
|
||||
"esbuild": "^0.14.38",
|
||||
"esbuild": "^0.14.43",
|
||||
"esbuild-loader": "^2.19.0",
|
||||
"eslint": "^8.16.0",
|
||||
"eslint": "^8.18.0",
|
||||
"eslint-plugin-header": "^3.1.1",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-react": "^7.30.0",
|
||||
"eslint-plugin-react-hooks": "^4.5.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
"flex.box": "^3.4.4",
|
||||
"fork-ts-checker-webpack-plugin": "^6.5.2",
|
||||
@ -374,12 +380,13 @@
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"ignore-loader": "^0.1.2",
|
||||
"include-media": "^1.4.9",
|
||||
"jest": "26.6.3",
|
||||
"jest": "^28.1.1",
|
||||
"jest-canvas-mock": "^2.3.1",
|
||||
"jest-environment-jsdom": "^28.1.1",
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
"jest-mock-extended": "^1.0.18",
|
||||
"jest-mock-extended": "^2.0.6",
|
||||
"make-plural": "^6.2.2",
|
||||
"mini-css-extract-plugin": "^2.6.0",
|
||||
"mini-css-extract-plugin": "^2.6.1",
|
||||
"mock-http": "^1.1.0",
|
||||
"node-gyp": "7.1.2",
|
||||
"node-loader": "^2.0.0",
|
||||
@ -396,24 +403,23 @@
|
||||
"react-select-event": "^5.5.0",
|
||||
"react-table": "^7.8.0",
|
||||
"react-window": "^1.8.7",
|
||||
"sass": "^1.52.2",
|
||||
"sass": "^1.52.3",
|
||||
"sass-loader": "^12.6.0",
|
||||
"sharp": "^0.30.6",
|
||||
"style-loader": "^3.3.1",
|
||||
"tailwindcss": "^3.0.23",
|
||||
"tailwindcss": "^3.1.4",
|
||||
"tar-stream": "^2.2.0",
|
||||
"ts-jest": "26.5.6",
|
||||
"ts-loader": "^9.2.8",
|
||||
"ts-node": "^10.7.0",
|
||||
"type-fest": "^2.13.0",
|
||||
"ts-node": "^10.8.1",
|
||||
"type-fest": "^2.13.1",
|
||||
"typed-emitter": "^1.4.0",
|
||||
"typedoc": "0.22.17",
|
||||
"typedoc-plugin-markdown": "^3.11.12",
|
||||
"typescript": "^4.5.5",
|
||||
"typescript": "^4.7.4",
|
||||
"typescript-plugin-css-modules": "^3.4.0",
|
||||
"webpack": "^5.73.0",
|
||||
"webpack-cli": "^4.9.2",
|
||||
"webpack-dev-server": "^4.9.1",
|
||||
"webpack-dev-server": "^4.9.2",
|
||||
"webpack-node-externals": "^3.0.0",
|
||||
"xterm": "^4.18.0",
|
||||
"xterm-addon-fit": "^0.5.0"
|
||||
|
||||
@ -133,7 +133,8 @@ const relaventPrsQuery = await Promise.all(
|
||||
);
|
||||
const relaventPrs = relaventPrsQuery
|
||||
.filter(query => query.stdout)
|
||||
.map(query => query.pr);
|
||||
.map(query => query.pr)
|
||||
.filter(pr => pr.labels.every(label => label.name !== "skip-changelog"));
|
||||
|
||||
const enhancementPrLabelName = "enhancement";
|
||||
const bugfixPrLabelName = "bug";
|
||||
@ -152,11 +153,15 @@ const prBodyLines = [
|
||||
"",
|
||||
];
|
||||
|
||||
function getPrEntry(pr) {
|
||||
return `- ${pr.title} (**[#${pr.number}](https://github.com/lensapp/lens/pull/${pr.number})**) https://github.com/${pr.author.login}`;
|
||||
}
|
||||
|
||||
if (enhancementPrs.length > 0) {
|
||||
prBodyLines.push(
|
||||
"## 🚀 Features",
|
||||
"",
|
||||
...enhancementPrs.map(pr => `- ${pr.title} (**#${pr.number}**) https://github.com/${pr.author.login}`),
|
||||
...enhancementPrs.map(getPrEntry),
|
||||
"",
|
||||
);
|
||||
}
|
||||
@ -165,7 +170,7 @@ if (bugfixPrs.length > 0) {
|
||||
prBodyLines.push(
|
||||
"## 🐛 Bug Fixes",
|
||||
"",
|
||||
...bugfixPrs.map(pr => `- ${pr.title} (**#${pr.number}**) https://github.com/${pr.author.login}`),
|
||||
...bugfixPrs.map(getPrEntry),
|
||||
"",
|
||||
);
|
||||
}
|
||||
@ -174,7 +179,7 @@ if (maintenencePrs.length > 0) {
|
||||
prBodyLines.push(
|
||||
"## 🧰 Maintenance",
|
||||
"",
|
||||
...maintenencePrs.map(pr => `- ${pr.title} (**#${pr.number}**) https://github.com/${pr.author.login}`),
|
||||
...maintenencePrs.map(getPrEntry),
|
||||
"",
|
||||
);
|
||||
}
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`extension special characters in page registrations renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -10,6 +20,16 @@ exports[`extension special characters in page registrations renders 1`] = `
|
||||
|
||||
exports[`extension special characters in page registrations when navigating to route with ID having special characters renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
Some page
|
||||
</div>
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`navigate to extension page renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -10,6 +20,16 @@ exports[`navigate to extension page renders 1`] = `
|
||||
|
||||
exports[`navigate to extension page when extension navigates to child route renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
Child page
|
||||
</div>
|
||||
@ -21,6 +41,16 @@ exports[`navigate to extension page when extension navigates to child route rend
|
||||
|
||||
exports[`navigate to extension page when extension navigates to route with parameters renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<ul>
|
||||
<li>
|
||||
@ -48,6 +78,16 @@ exports[`navigate to extension page when extension navigates to route with param
|
||||
|
||||
exports[`navigate to extension page when extension navigates to route without parameters renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<ul>
|
||||
<li>
|
||||
@ -75,6 +115,16 @@ exports[`navigate to extension page when extension navigates to route without pa
|
||||
|
||||
exports[`navigate to extension page when extension navigates to route without parameters when changing page parameters renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`navigating between routes given route with optional path parameters when navigating to route with path parameters renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<pre>
|
||||
{
|
||||
"someParameter": "some-value",
|
||||
@ -16,6 +26,16 @@ exports[`navigating between routes given route with optional path parameters whe
|
||||
|
||||
exports[`navigating between routes given route without path parameters when navigating to route renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
Some component
|
||||
</div>
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`add-cluster - navigation using application menu renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -10,6 +20,16 @@ exports[`add-cluster - navigation using application menu renders 1`] = `
|
||||
|
||||
exports[`add-cluster - navigation using application menu when navigating to add cluster using application menu renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout AddClusters"
|
||||
data-testid="add-cluster-page"
|
||||
|
||||
@ -3,6 +3,16 @@
|
||||
exports[`installing update using tray when started renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -13,6 +23,16 @@ exports[`installing update using tray when started renders 1`] = `
|
||||
exports[`installing update using tray when started when user checks for updates using tray renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
>
|
||||
@ -64,6 +84,16 @@ exports[`installing update using tray when started when user checks for updates
|
||||
exports[`installing update using tray when started when user checks for updates using tray when new update is discovered renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
>
|
||||
@ -155,6 +185,16 @@ exports[`installing update using tray when started when user checks for updates
|
||||
exports[`installing update using tray when started when user checks for updates using tray when new update is discovered when download fails renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
>
|
||||
@ -286,6 +326,16 @@ exports[`installing update using tray when started when user checks for updates
|
||||
exports[`installing update using tray when started when user checks for updates using tray when new update is discovered when download succeeds renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
>
|
||||
@ -447,6 +497,16 @@ Lens should restart automatically, if it doesn't please restart manually. Instal
|
||||
exports[`installing update using tray when started when user checks for updates using tray when no new update is discovered renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
>
|
||||
|
||||
@ -3,6 +3,16 @@
|
||||
exports[`installing update when started renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -13,6 +23,16 @@ exports[`installing update when started renders 1`] = `
|
||||
exports[`installing update when started when user checks for updates renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -23,6 +43,16 @@ exports[`installing update when started when user checks for updates renders 1`]
|
||||
exports[`installing update when started when user checks for updates when new update is discovered renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -33,6 +63,16 @@ exports[`installing update when started when user checks for updates when new up
|
||||
exports[`installing update when started when user checks for updates when new update is discovered when download fails renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -43,6 +83,16 @@ exports[`installing update when started when user checks for updates when new up
|
||||
exports[`installing update when started when user checks for updates when new update is discovered when download succeeds renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -53,6 +103,16 @@ exports[`installing update when started when user checks for updates when new up
|
||||
exports[`installing update when started when user checks for updates when new update is discovered when download succeeds when user answers not to install the update renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -63,6 +123,16 @@ exports[`installing update when started when user checks for updates when new up
|
||||
exports[`installing update when started when user checks for updates when new update is discovered when download succeeds when user answers to install the update renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -73,6 +143,16 @@ exports[`installing update when started when user checks for updates when new up
|
||||
exports[`installing update when started when user checks for updates when no new update is discovered renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
|
||||
@ -3,6 +3,16 @@
|
||||
exports[`periodical checking of updates given updater is enabled and configuration exists, when started renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
|
||||
@ -3,6 +3,16 @@
|
||||
exports[`selection of update stability when started renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
|
||||
@ -0,0 +1,225 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable";
|
||||
import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import type { CheckForPlatformUpdates } from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable";
|
||||
import checkForPlatformUpdatesInjectable from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable";
|
||||
import appEventBusInjectable from "../../common/app-event-bus/app-event-bus.injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable";
|
||||
import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable";
|
||||
import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable";
|
||||
import quitAndInstallUpdateInjectable from "../../main/application-update/quit-and-install-update.injectable";
|
||||
import appVersionInjectable from "../../common/get-configuration-file-model/app-version/app-version.injectable";
|
||||
import periodicalCheckForUpdatesInjectable from "../../main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable";
|
||||
|
||||
describe("analytics for installing update", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
let checkForPlatformUpdatesMock: AsyncFnMock<CheckForPlatformUpdates>;
|
||||
let downloadPlatformUpdateMock: AsyncFnMock<DownloadPlatformUpdate>;
|
||||
let analyticsListenerMock: jest.Mock;
|
||||
let mainDi: DiContainer;
|
||||
|
||||
beforeEach(async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
global.Date.now = () => new Date("2015-10-21T07:28:00Z").getTime();
|
||||
|
||||
applicationBuilder = getApplicationBuilder();
|
||||
|
||||
analyticsListenerMock = jest.fn();
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ mainDi }) => {
|
||||
mainDi.override(appVersionInjectable, () => "42.0.0");
|
||||
|
||||
checkForPlatformUpdatesMock = asyncFn();
|
||||
|
||||
mainDi.override(
|
||||
checkForPlatformUpdatesInjectable,
|
||||
() => checkForPlatformUpdatesMock,
|
||||
);
|
||||
|
||||
downloadPlatformUpdateMock = asyncFn();
|
||||
|
||||
mainDi.override(downloadPlatformUpdateInjectable, () => downloadPlatformUpdateMock);
|
||||
mainDi.override(electronUpdaterIsActiveInjectable, () => true);
|
||||
|
||||
mainDi.override(publishIsConfiguredInjectable, () => true);
|
||||
|
||||
const eventBus = mainDi.inject(appEventBusInjectable);
|
||||
|
||||
eventBus.addListener(analyticsListenerMock);
|
||||
});
|
||||
|
||||
mainDi = applicationBuilder.dis.mainDi;
|
||||
});
|
||||
|
||||
describe("given application is started and checking updates periodically", () => {
|
||||
beforeEach(async () => {
|
||||
mainDi.unoverride(periodicalCheckForUpdatesInjectable);
|
||||
mainDi.permitSideEffects(periodicalCheckForUpdatesInjectable);
|
||||
|
||||
await applicationBuilder.render();
|
||||
|
||||
});
|
||||
|
||||
it("sends event to analytics for being checked periodically", () => {
|
||||
expect(analyticsListenerMock).toHaveBeenCalledWith({
|
||||
name: "app",
|
||||
action: "checking-for-updates",
|
||||
|
||||
params: {
|
||||
currentDateTime: "2015-10-21T07:28:00Z",
|
||||
source: "periodic",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("when enough time passes to check for updates again, sends event to analytics for being checked periodically", () => {
|
||||
analyticsListenerMock.mockClear();
|
||||
|
||||
jest.advanceTimersByTime(1000 * 60 * 60 * 2);
|
||||
|
||||
expect(analyticsListenerMock).toHaveBeenCalledWith({
|
||||
name: "app",
|
||||
action: "checking-for-updates",
|
||||
|
||||
params: {
|
||||
currentDateTime: "2015-10-21T07:28:00Z",
|
||||
source: "periodic",
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("when application is started", () => {
|
||||
beforeEach(async () => {
|
||||
analyticsListenerMock.mockClear();
|
||||
|
||||
await applicationBuilder.render();
|
||||
});
|
||||
|
||||
it("sends event to analytics about the current version", () => {
|
||||
expect(analyticsListenerMock).toHaveBeenCalledWith({
|
||||
name: "app",
|
||||
action: "current-version",
|
||||
|
||||
params: {
|
||||
version: "42.0.0",
|
||||
currentDateTime: "2015-10-21T07:28:00Z",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("when checking for updates using tray, sends event to analytics for being checked from tray", async () => {
|
||||
analyticsListenerMock.mockClear();
|
||||
|
||||
applicationBuilder.tray.click("check-for-updates");
|
||||
|
||||
expect(analyticsListenerMock.mock.calls).toEqual([
|
||||
[
|
||||
{
|
||||
name: "app",
|
||||
action: "checking-for-updates",
|
||||
|
||||
params: {
|
||||
currentDateTime: "2015-10-21T07:28:00Z",
|
||||
source: "tray",
|
||||
},
|
||||
},
|
||||
],
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
it("when checking for updates using application menu, sends event to analytics for being checked from application menu", async () => {
|
||||
analyticsListenerMock.mockClear();
|
||||
|
||||
applicationBuilder.applicationMenu.click("root.check-for-updates");
|
||||
|
||||
expect(analyticsListenerMock.mock.calls).toEqual([
|
||||
[
|
||||
{
|
||||
name: "app",
|
||||
action: "checking-for-updates",
|
||||
|
||||
params: {
|
||||
currentDateTime: "2015-10-21T07:28:00Z",
|
||||
source: "application-menu",
|
||||
},
|
||||
},
|
||||
],
|
||||
]);
|
||||
});
|
||||
|
||||
describe("given checking for updates, when check for updates resolves with new update being available", () => {
|
||||
beforeEach(async () => {
|
||||
const processCheckingForUpdates = mainDi.inject(processCheckingForUpdatesInjectable);
|
||||
|
||||
processCheckingForUpdates("irrelevant");
|
||||
|
||||
analyticsListenerMock.mockClear();
|
||||
|
||||
await checkForPlatformUpdatesMock.resolve({
|
||||
updateWasDiscovered: true,
|
||||
version: "43.0.0",
|
||||
});
|
||||
});
|
||||
|
||||
it("sends event to analytics about new update being available", () => {
|
||||
expect(analyticsListenerMock.mock.calls).toEqual([
|
||||
[
|
||||
{
|
||||
name: "app",
|
||||
action: "update-was-discovered",
|
||||
|
||||
params: {
|
||||
version: "43.0.0",
|
||||
currentDateTime: "2015-10-21T07:28:00Z",
|
||||
},
|
||||
},
|
||||
],
|
||||
]);
|
||||
});
|
||||
|
||||
describe("given update is downloaded", () => {
|
||||
beforeEach(async () => {
|
||||
analyticsListenerMock.mockClear();
|
||||
|
||||
await downloadPlatformUpdateMock.resolve({ downloadWasSuccessful: true });
|
||||
});
|
||||
|
||||
it("does not send event to analytics about update downloaded being successful", () => {
|
||||
expect(analyticsListenerMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("when installing the update, sends event to analytics about installing the update", () => {
|
||||
const quitAndInstallUpdate = mainDi.inject(quitAndInstallUpdateInjectable);
|
||||
|
||||
quitAndInstallUpdate();
|
||||
|
||||
expect(analyticsListenerMock.mock.calls).toEqual([
|
||||
[
|
||||
{
|
||||
name: "app",
|
||||
action: "start-installing-update",
|
||||
|
||||
params: {
|
||||
version: "43.0.0",
|
||||
currentDateTime: "2015-10-21T07:28:00Z",
|
||||
updateChannel: "latest",
|
||||
},
|
||||
},
|
||||
],
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -22,8 +22,6 @@ describe("downgrading version update", () => {
|
||||
let mainDi: DiContainer;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
applicationBuilder = getApplicationBuilder();
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ mainDi }) => {
|
||||
@ -79,7 +77,7 @@ describe("downgrading version update", () => {
|
||||
|
||||
const processCheckingForUpdates = mainDi.inject(processCheckingForUpdatesInjectable);
|
||||
|
||||
processCheckingForUpdates();
|
||||
processCheckingForUpdates("irrelevant");
|
||||
|
||||
expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith(expect.any(Object), { allowDowngrade: downgradeIsAllowed });
|
||||
});
|
||||
|
||||
@ -14,7 +14,6 @@ import asyncFn from "@async-fn/jest";
|
||||
import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable";
|
||||
import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable";
|
||||
import showApplicationWindowInjectable from "../../main/start-main-application/lens-window/show-application-window.injectable";
|
||||
import progressOfUpdateDownloadInjectable from "../../common/application-update/progress-of-update-download/progress-of-update-download.injectable";
|
||||
import type { TrayIconPaths } from "../../main/tray/tray-icon-path.injectable";
|
||||
import trayIconPathsInjectable from "../../main/tray/tray-icon-path.injectable";
|
||||
|
||||
@ -87,13 +86,13 @@ describe("installing update using tray", () => {
|
||||
|
||||
it("user cannot check for updates again", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("name of tray item for checking updates indicates that checking is happening", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.label?.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.label,
|
||||
).toBe("Checking for updates...");
|
||||
});
|
||||
|
||||
@ -128,13 +127,13 @@ describe("installing update using tray", () => {
|
||||
|
||||
it("user can check for updates again", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("name of tray item for checking updates no longer indicates that checking is happening", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.label?.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.label,
|
||||
).toBe("Check for updates");
|
||||
});
|
||||
|
||||
@ -163,25 +162,21 @@ describe("installing update using tray", () => {
|
||||
|
||||
it("user cannot check for updates again yet", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("name of tray item for checking updates indicates that downloading is happening", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.label?.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.label,
|
||||
).toBe("Downloading update some-version (0%)...");
|
||||
});
|
||||
|
||||
it("when download progresses with decimals, percentage increases as integers", () => {
|
||||
const progressOfUpdateDownload = applicationBuilder.dis.mainDi.inject(
|
||||
progressOfUpdateDownloadInjectable,
|
||||
);
|
||||
|
||||
progressOfUpdateDownload.set({ percentage: 42.424242 });
|
||||
downloadPlatformUpdateMock.mock.calls[0][0]({ percentage: 42.424242 });
|
||||
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.label?.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.label,
|
||||
).toBe("Downloading update some-version (42%)...");
|
||||
});
|
||||
|
||||
@ -210,13 +205,13 @@ describe("installing update using tray", () => {
|
||||
|
||||
it("user can check for updates again", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("name of tray item for checking updates no longer indicates that downloading is happening", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.label?.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.label,
|
||||
).toBe("Check for updates");
|
||||
});
|
||||
|
||||
@ -232,7 +227,7 @@ describe("installing update using tray", () => {
|
||||
|
||||
it("user can install update", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("install-update")?.label?.get(),
|
||||
applicationBuilder.tray.get("install-update")?.label,
|
||||
).toBe("Install update some-version");
|
||||
});
|
||||
|
||||
@ -242,13 +237,13 @@ describe("installing update using tray", () => {
|
||||
|
||||
it("user can check for updates again", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.enabled,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("name of tray item for checking updates no longer indicates that downloading is happening", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get("check-for-updates")?.label?.get(),
|
||||
applicationBuilder.tray.get("check-for-updates")?.label,
|
||||
).toBe("Check for updates");
|
||||
});
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import quitAndInstallUpdateInjectable from "../../main/electron-app/features/quit-and-install-update.injectable";
|
||||
import quitAndInstallUpdateInjectable from "../../main/application-update/quit-and-install-update.injectable";
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable";
|
||||
import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable";
|
||||
@ -67,7 +67,7 @@ describe("installing update", () => {
|
||||
|
||||
describe("when started", () => {
|
||||
let rendered: RenderResult;
|
||||
let processCheckingForUpdates: () => Promise<void>;
|
||||
let processCheckingForUpdates: (source: string) => Promise<void>;
|
||||
|
||||
beforeEach(async () => {
|
||||
rendered = await applicationBuilder.render();
|
||||
@ -83,7 +83,7 @@ describe("installing update", () => {
|
||||
let processCheckingForUpdatesPromise: Promise<void>;
|
||||
|
||||
beforeEach(async () => {
|
||||
processCheckingForUpdatesPromise = processCheckingForUpdates();
|
||||
processCheckingForUpdatesPromise = processCheckingForUpdates("irrelevant");
|
||||
});
|
||||
|
||||
it("checks for updates", () => {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import quitAndInstallUpdateInjectable from "../../main/electron-app/features/quit-and-install-update.injectable";
|
||||
import quitAndInstallUpdateInjectable from "../../main/application-update/quit-and-install-update.injectable";
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable";
|
||||
import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable";
|
||||
@ -72,7 +72,7 @@ describe("selection of update stability", () => {
|
||||
|
||||
describe("when started", () => {
|
||||
let rendered: RenderResult;
|
||||
let processCheckingForUpdates: () => Promise<void>;
|
||||
let processCheckingForUpdates: (source: string) => Promise<void>;
|
||||
|
||||
beforeEach(async () => {
|
||||
rendered = await applicationBuilder.render();
|
||||
@ -97,7 +97,7 @@ describe("selection of update stability", () => {
|
||||
|
||||
selectedUpdateChannel.setValue(updateChannels.alpha.id);
|
||||
|
||||
processCheckingForUpdates();
|
||||
processCheckingForUpdates("irrelevant");
|
||||
});
|
||||
|
||||
it('checks updates from update channel "alpha"', () => {
|
||||
@ -191,7 +191,7 @@ describe("selection of update stability", () => {
|
||||
|
||||
describe("when checking for updates", () => {
|
||||
beforeEach(() => {
|
||||
processCheckingForUpdates();
|
||||
processCheckingForUpdates("irrelevant");
|
||||
});
|
||||
|
||||
describe('when update from "beta" channel is discovered', () => {
|
||||
@ -241,7 +241,7 @@ describe("selection of update stability", () => {
|
||||
|
||||
const processCheckingForUpdates = applicationBuilder.dis.mainDi.inject(processCheckingForUpdatesInjectable);
|
||||
|
||||
processCheckingForUpdates();
|
||||
processCheckingForUpdates("irrelevant");
|
||||
|
||||
expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith(updateChannels.beta, expect.any(Object));
|
||||
});
|
||||
@ -259,7 +259,7 @@ describe("selection of update stability", () => {
|
||||
|
||||
const processCheckingForUpdates = applicationBuilder.dis.mainDi.inject(processCheckingForUpdatesInjectable);
|
||||
|
||||
processCheckingForUpdates();
|
||||
processCheckingForUpdates("irrelevant");
|
||||
|
||||
expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith(updateChannels.latest, expect.any(Object));
|
||||
});
|
||||
@ -273,7 +273,7 @@ describe("selection of update stability", () => {
|
||||
|
||||
const processCheckingForUpdates = applicationBuilder.dis.mainDi.inject(processCheckingForUpdatesInjectable);
|
||||
|
||||
processCheckingForUpdates();
|
||||
processCheckingForUpdates("irrelevant");
|
||||
|
||||
expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith(
|
||||
updateChannels.latest,
|
||||
@ -290,7 +290,7 @@ describe("selection of update stability", () => {
|
||||
|
||||
const processCheckingForUpdates = applicationBuilder.dis.mainDi.inject(processCheckingForUpdatesInjectable);
|
||||
|
||||
processCheckingForUpdates();
|
||||
processCheckingForUpdates("irrelevant");
|
||||
|
||||
expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith(updateChannels.alpha, expect.any(Object));
|
||||
});
|
||||
@ -304,7 +304,7 @@ describe("selection of update stability", () => {
|
||||
|
||||
const processCheckingForUpdates = applicationBuilder.dis.mainDi.inject(processCheckingForUpdatesInjectable);
|
||||
|
||||
processCheckingForUpdates();
|
||||
processCheckingForUpdates("irrelevant");
|
||||
|
||||
expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith(updateChannels.beta, expect.any(Object));
|
||||
});
|
||||
@ -324,7 +324,7 @@ describe("selection of update stability", () => {
|
||||
|
||||
const processCheckingForUpdates = applicationBuilder.dis.mainDi.inject(processCheckingForUpdatesInjectable);
|
||||
|
||||
processCheckingForUpdates();
|
||||
processCheckingForUpdates("irrelevant");
|
||||
|
||||
expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith(updateChannels.beta, expect.any(Object));
|
||||
});
|
||||
|
||||
@ -24,10 +24,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -60,10 +58,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -89,10 +85,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -118,10 +112,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -157,10 +149,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -186,10 +176,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-another-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-another-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-another-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -205,10 +193,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -241,10 +227,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -270,10 +254,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -309,10 +291,8 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-other-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-other-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-other-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -358,10 +338,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -394,10 +372,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -423,10 +399,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -454,11 +428,9 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-parent-id"
|
||||
data-test-id="some-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -474,11 +446,9 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-another-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-parent-id"
|
||||
data-test-id="some-another-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-another-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -494,11 +464,9 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-other-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-parent-id"
|
||||
data-test-id="some-other-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-other-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -516,10 +484,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -555,10 +521,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -584,10 +548,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-another-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-another-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-another-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -603,10 +565,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -639,10 +599,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -668,10 +626,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -707,10 +663,8 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-other-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-other-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-other-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
|
||||
@ -24,10 +24,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -60,10 +58,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -89,10 +85,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -121,10 +115,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -160,10 +152,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -189,10 +179,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -225,10 +213,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -254,10 +240,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -323,10 +307,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -359,10 +341,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -388,10 +368,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -420,10 +398,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -459,10 +435,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -488,10 +462,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -524,10 +496,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -553,10 +523,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -622,10 +590,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -658,10 +624,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -687,10 +651,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -721,11 +683,9 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-parent-id"
|
||||
data-test-id="some-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -743,10 +703,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -782,10 +740,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -811,10 +767,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -847,10 +801,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -876,10 +828,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -945,10 +895,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -981,10 +929,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1010,10 +956,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-parent-id"
|
||||
data-is-active-test="true"
|
||||
data-test-id="some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-parent-id"
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
@ -1045,11 +989,9 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-child-id"
|
||||
data-is-active-test="true"
|
||||
data-parent-id-test="some-parent-id"
|
||||
data-test-id="some-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-child-id"
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
@ -1068,10 +1010,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1107,10 +1047,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1136,10 +1074,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1172,10 +1108,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1201,10 +1135,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1273,10 +1205,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1309,10 +1239,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1338,10 +1266,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-parent-id"
|
||||
data-is-active-test="true"
|
||||
data-test-id="some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-parent-id"
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
@ -1371,10 +1297,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1410,10 +1334,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1439,10 +1361,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1475,10 +1395,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1504,10 +1422,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1576,10 +1492,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1612,10 +1526,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1641,10 +1553,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1675,11 +1585,9 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-parent-id"
|
||||
data-test-id="some-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1697,10 +1605,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1736,10 +1642,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1765,10 +1669,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1801,10 +1703,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1830,10 +1730,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1899,10 +1797,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1935,10 +1831,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1964,10 +1858,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1996,10 +1888,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2035,10 +1925,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2064,10 +1952,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2100,10 +1986,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2129,10 +2013,8 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
|
||||
@ -24,10 +24,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -60,10 +58,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -89,10 +85,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -128,10 +122,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -157,10 +149,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -193,10 +183,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -222,10 +210,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -261,10 +247,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-extension-name-some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -323,10 +307,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -359,10 +341,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -388,10 +368,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -427,10 +405,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -456,10 +432,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -492,10 +466,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -521,10 +493,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -560,10 +530,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-extension-name-some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -622,10 +590,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -658,10 +624,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -687,10 +651,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -726,10 +688,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -755,10 +715,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -791,10 +749,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -820,10 +776,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -859,10 +813,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-extension-name-some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -893,11 +845,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-extension-name-some-parent-id"
|
||||
data-test-id="some-extension-name-some-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -913,11 +863,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-other-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-extension-name-some-parent-id"
|
||||
data-test-id="some-extension-name-some-other-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-other-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -965,10 +913,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1001,10 +947,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1030,10 +974,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1069,10 +1011,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1098,10 +1038,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1134,10 +1072,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1163,10 +1099,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1202,10 +1136,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-parent-id"
|
||||
data-is-active-test="true"
|
||||
data-test-id="some-extension-name-some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-parent-id"
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
@ -1237,11 +1169,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-child-id"
|
||||
data-is-active-test="true"
|
||||
data-parent-id-test="some-extension-name-some-parent-id"
|
||||
data-test-id="some-extension-name-some-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-child-id"
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
@ -1258,11 +1188,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-other-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-extension-name-some-parent-id"
|
||||
data-test-id="some-extension-name-some-other-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-other-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1352,10 +1280,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1388,10 +1314,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1417,10 +1341,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1456,10 +1378,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1485,10 +1405,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1521,10 +1439,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1550,10 +1466,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1589,10 +1503,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-parent-id"
|
||||
data-is-active-test="true"
|
||||
data-test-id="some-extension-name-some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-parent-id"
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
@ -1624,11 +1536,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-extension-name-some-parent-id"
|
||||
data-test-id="some-extension-name-some-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1644,11 +1554,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-other-child-id"
|
||||
data-is-active-test="true"
|
||||
data-parent-id-test="some-extension-name-some-parent-id"
|
||||
data-test-id="some-extension-name-some-other-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-other-child-id"
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
@ -1739,10 +1647,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1775,10 +1681,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1804,10 +1708,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1843,10 +1745,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1872,10 +1772,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1908,10 +1806,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -1937,10 +1833,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -1976,10 +1870,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-parent-id"
|
||||
data-is-active-test="true"
|
||||
data-test-id="some-extension-name-some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-parent-id"
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
@ -2081,10 +1973,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2117,10 +2007,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2146,10 +2034,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2185,10 +2071,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2214,10 +2098,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2250,10 +2132,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2279,10 +2159,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2318,10 +2196,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-extension-name-some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2352,11 +2228,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-extension-name-some-parent-id"
|
||||
data-test-id="some-extension-name-some-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2372,11 +2246,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-other-child-id"
|
||||
data-is-active-test="false"
|
||||
data-parent-id-test="some-extension-name-some-parent-id"
|
||||
data-test-id="some-extension-name-some-other-child-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-other-child-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2424,10 +2296,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2460,10 +2330,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2489,10 +2357,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2528,10 +2394,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2557,10 +2421,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2593,10 +2455,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -2622,10 +2482,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -2661,10 +2519,8 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-extension-name-some-parent-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-extension-name-some-parent-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-extension-name-some-parent-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
|
||||
@ -24,10 +24,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -60,10 +58,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -89,10 +85,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -128,10 +122,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -157,10 +149,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -193,10 +183,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -222,10 +210,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -291,10 +277,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -327,10 +311,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -356,10 +338,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="some-item-id"
|
||||
data-is-active-test="false"
|
||||
data-test-id="some-item-id"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-some-item-id"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -375,10 +355,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -414,10 +392,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -443,10 +419,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="namespaces"
|
||||
data-is-active-test="false"
|
||||
data-test-id="namespaces"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-namespaces"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -472,10 +446,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="false"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -508,10 +480,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -537,10 +507,8 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
|
||||
@ -8,7 +8,7 @@ import { fireEvent } from "@testing-library/react";
|
||||
import type { SidebarItemRegistration } from "../../renderer/components/layout/sidebar-items.injectable";
|
||||
import { sidebarItemsInjectionToken } from "../../renderer/components/layout/sidebar-items.injectable";
|
||||
import { computed } from "mobx";
|
||||
import { get, includes, noop } from "lodash/fp";
|
||||
import { noop } from "lodash/fp";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
|
||||
@ -35,22 +35,13 @@ describe("cluster - order of sidebar items", () => {
|
||||
|
||||
it("has parent items in order", () => {
|
||||
const actual = rendered
|
||||
.queryAllByTestId("sidebar-item")
|
||||
|
||||
.filter((element) =>
|
||||
includes(element.dataset.idTest)([
|
||||
"some-parent-id",
|
||||
"some-other-parent-id",
|
||||
"some-another-parent-id",
|
||||
]),
|
||||
)
|
||||
|
||||
.map(get("dataset.idTest"));
|
||||
.queryAllByTestId(/^sidebar-item-(some-parent-id|some-other-parent-id|some-another-parent-id)/)
|
||||
.map(elem => elem.dataset.testid);
|
||||
|
||||
expect(actual).toEqual([
|
||||
"some-parent-id",
|
||||
"some-another-parent-id",
|
||||
"some-other-parent-id",
|
||||
"sidebar-item-some-parent-id",
|
||||
"sidebar-item-some-another-parent-id",
|
||||
"sidebar-item-some-other-parent-id",
|
||||
]);
|
||||
});
|
||||
|
||||
@ -69,16 +60,14 @@ describe("cluster - order of sidebar items", () => {
|
||||
|
||||
it("has child items in order", () => {
|
||||
const actual = rendered
|
||||
.queryAllByTestId("sidebar-item")
|
||||
.filter(
|
||||
(element) => element.dataset.parentIdTest === "some-parent-id",
|
||||
)
|
||||
.map(get("dataset.idTest"));
|
||||
.queryAllByTestId(/^sidebar-item-*/)
|
||||
.filter((element) => element.dataset.parentIdTest === "some-parent-id")
|
||||
.map(elem => elem.dataset.testid);
|
||||
|
||||
expect(actual).toEqual([
|
||||
"some-child-id",
|
||||
"some-another-child-id",
|
||||
"some-other-child-id",
|
||||
"sidebar-item-some-child-id",
|
||||
"sidebar-item-some-another-child-id",
|
||||
"sidebar-item-some-other-child-id",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@ -14,14 +14,13 @@ import { sidebarItemsInjectionToken } from "../../renderer/components/layout/sid
|
||||
import { computed } from "mobx";
|
||||
import { noop } from "lodash/fp";
|
||||
import routeIsActiveInjectable from "../../renderer/routes/route-is-active.injectable";
|
||||
import { routeInjectionToken } from "../../common/front-end-routing/route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../common/front-end-routing/front-end-route-injection-token";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import writeJsonFileInjectable from "../../common/fs/write-json-file.injectable";
|
||||
import pathExistsInjectable from "../../common/fs/path-exists.injectable";
|
||||
import readJsonFileInjectable from "../../common/fs/read-json-file.injectable";
|
||||
import { navigateToRouteInjectionToken } from "../../common/front-end-routing/navigate-to-route-injection-token";
|
||||
import { getSidebarItem } from "../utils";
|
||||
import sidebarStorageInjectable from "../../renderer/components/layout/sidebar-storage/sidebar-storage.injectable";
|
||||
|
||||
describe("cluster - sidebar and tab navigation for core", () => {
|
||||
@ -72,15 +71,15 @@ describe("cluster - sidebar and tab navigation for core", () => {
|
||||
});
|
||||
|
||||
it("parent is highlighted", () => {
|
||||
const parent = getSidebarItem(rendered, "some-parent-id");
|
||||
const parent = rendered.queryByTestId("sidebar-item-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("true");
|
||||
});
|
||||
|
||||
it("parent sidebar item is not expanded", () => {
|
||||
const child = getSidebarItem(rendered, "some-child-id");
|
||||
const child = rendered.queryByTestId("sidebar-item-some-child-id");
|
||||
|
||||
expect(child).toBeUndefined();
|
||||
expect(child).toBeNull();
|
||||
});
|
||||
|
||||
it("child page is shown", () => {
|
||||
@ -118,15 +117,15 @@ describe("cluster - sidebar and tab navigation for core", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not highlighted", () => {
|
||||
const parent = getSidebarItem(rendered, "some-parent-id");
|
||||
const parent = rendered.queryByTestId("sidebar-item-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("false");
|
||||
});
|
||||
|
||||
it("parent sidebar item is expanded", () => {
|
||||
const child = getSidebarItem(rendered, "some-child-id");
|
||||
const child = rendered.queryByTestId("sidebar-item-some-child-id");
|
||||
|
||||
expect(child).not.toBeUndefined();
|
||||
expect(child).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@ -154,9 +153,9 @@ describe("cluster - sidebar and tab navigation for core", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not expanded", () => {
|
||||
const child = getSidebarItem(rendered, "some-child-id");
|
||||
const child = rendered.queryByTestId("sidebar-item-some-child-id");
|
||||
|
||||
expect(child).toBeUndefined();
|
||||
expect(child).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@ -181,9 +180,9 @@ describe("cluster - sidebar and tab navigation for core", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not expanded", () => {
|
||||
const child = getSidebarItem(rendered, "some-child-id");
|
||||
const child = rendered.queryByTestId("sidebar-item-some-child-id");
|
||||
|
||||
expect(child).toBeUndefined();
|
||||
expect(child).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@ -197,15 +196,15 @@ describe("cluster - sidebar and tab navigation for core", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not highlighted", () => {
|
||||
const parent = getSidebarItem(rendered, "some-parent-id");
|
||||
const parent = rendered.queryByTestId("sidebar-item-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("false");
|
||||
});
|
||||
|
||||
it("parent sidebar item is not expanded", () => {
|
||||
const child = getSidebarItem(rendered, "some-child-id");
|
||||
const child = rendered.queryByTestId("sidebar-item-some-child-id");
|
||||
|
||||
expect(child).toBeUndefined();
|
||||
expect(child).toBeNull();
|
||||
});
|
||||
|
||||
describe("when a parent sidebar item is expanded", () => {
|
||||
@ -222,15 +221,15 @@ describe("cluster - sidebar and tab navigation for core", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not highlighted", () => {
|
||||
const parent = getSidebarItem(rendered, "some-parent-id");
|
||||
const parent = rendered.queryByTestId("sidebar-item-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("false");
|
||||
});
|
||||
|
||||
it("parent sidebar item is expanded", () => {
|
||||
const child = getSidebarItem(rendered, "some-child-id");
|
||||
const child = rendered.queryByTestId("sidebar-item-some-child-id");
|
||||
|
||||
expect(child).not.toBeUndefined();
|
||||
expect(child).not.toBeNull();
|
||||
});
|
||||
|
||||
describe("when a child of the parent is selected", () => {
|
||||
@ -247,13 +246,13 @@ describe("cluster - sidebar and tab navigation for core", () => {
|
||||
});
|
||||
|
||||
it("parent is highlighted", () => {
|
||||
const parent = getSidebarItem(rendered, "some-parent-id");
|
||||
const parent = rendered.queryByTestId("sidebar-item-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("true");
|
||||
});
|
||||
|
||||
it("child is highlighted", () => {
|
||||
const child = getSidebarItem(rendered, "some-child-id");
|
||||
const child = rendered.queryByTestId("sidebar-item-some-child-id");
|
||||
|
||||
expect(child?.dataset.isActiveTest).toBe("true");
|
||||
});
|
||||
@ -337,7 +336,7 @@ const testRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
const testRouteComponentInjectable = getInjectable({
|
||||
|
||||
@ -16,7 +16,6 @@ import readJsonFileInjectable from "../../common/fs/read-json-file.injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import { navigateToRouteInjectionToken } from "../../common/front-end-routing/navigate-to-route-injection-token";
|
||||
import assert from "assert";
|
||||
import { getSidebarItem } from "../utils";
|
||||
import type { FakeExtensionData } from "../../renderer/components/test-utils/get-renderer-extension-fake";
|
||||
import { getRendererExtensionFakeFor } from "../../renderer/components/test-utils/get-renderer-extension-fake";
|
||||
|
||||
@ -42,11 +41,11 @@ describe("cluster - sidebar and tab navigation for extensions", () => {
|
||||
});
|
||||
|
||||
describe("given extension with cluster pages and cluster page menus", () => {
|
||||
beforeEach(async () => {
|
||||
beforeEach(() => {
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const testExtension = getRendererExtensionFake(extensionStubWithSidebarItems);
|
||||
|
||||
await applicationBuilder.addExtensions(testExtension);
|
||||
applicationBuilder.extensions.renderer.enable(testExtension);
|
||||
});
|
||||
|
||||
describe("given no state for expanded sidebar items exists, and navigated to child sidebar item, when rendered", () => {
|
||||
@ -74,21 +73,15 @@ describe("cluster - sidebar and tab navigation for extensions", () => {
|
||||
});
|
||||
|
||||
it("parent is highlighted", () => {
|
||||
const parent = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-parent-id",
|
||||
);
|
||||
const parent = rendered.getByTestId("sidebar-item-some-extension-name-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("true");
|
||||
});
|
||||
|
||||
it("parent sidebar item is not expanded", () => {
|
||||
const child = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-child-id",
|
||||
);
|
||||
const child = rendered.queryByTestId("sidebar-item-some-extension-name-some-child-id");
|
||||
|
||||
expect(child).toBeUndefined();
|
||||
expect(child).toBeNull();
|
||||
});
|
||||
|
||||
it("child page is shown", () => {
|
||||
@ -120,21 +113,15 @@ describe("cluster - sidebar and tab navigation for extensions", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not highlighted", () => {
|
||||
const parent = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-parent-id",
|
||||
);
|
||||
const parent = rendered.getByTestId("sidebar-item-some-extension-name-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("false");
|
||||
});
|
||||
|
||||
it("parent sidebar item is expanded", () => {
|
||||
const child = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-child-id",
|
||||
);
|
||||
const child = rendered.queryByTestId("sidebar-item-some-extension-name-some-child-id");
|
||||
|
||||
expect(child).not.toBeUndefined();
|
||||
expect(child).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@ -162,12 +149,9 @@ describe("cluster - sidebar and tab navigation for extensions", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not expanded", () => {
|
||||
const child = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-child-id",
|
||||
);
|
||||
const child = rendered.queryByTestId("sidebar-item-some-extension-name-some-child-id");
|
||||
|
||||
expect(child).toBeUndefined();
|
||||
expect(child).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@ -192,12 +176,9 @@ describe("cluster - sidebar and tab navigation for extensions", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not expanded", () => {
|
||||
const child = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-child-id",
|
||||
);
|
||||
const child = rendered.queryByTestId("sidebar-item-some-extension-name-some-child-id");
|
||||
|
||||
expect(child).toBeUndefined();
|
||||
expect(child).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@ -211,21 +192,15 @@ describe("cluster - sidebar and tab navigation for extensions", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not highlighted", () => {
|
||||
const parent = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-parent-id",
|
||||
);
|
||||
const parent = rendered.getByTestId("sidebar-item-some-extension-name-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("false");
|
||||
});
|
||||
|
||||
it("parent sidebar item is not expanded", () => {
|
||||
const child = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-child-id",
|
||||
);
|
||||
const child = rendered.queryByTestId("sidebar-item-some-extension-name-some-child-id");
|
||||
|
||||
expect(child).toBeUndefined();
|
||||
expect(child).toBeNull();
|
||||
});
|
||||
|
||||
describe("when a parent sidebar item is expanded", () => {
|
||||
@ -242,21 +217,15 @@ describe("cluster - sidebar and tab navigation for extensions", () => {
|
||||
});
|
||||
|
||||
it("parent sidebar item is not highlighted", () => {
|
||||
const parent = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-parent-id",
|
||||
);
|
||||
const parent = rendered.getByTestId("sidebar-item-some-extension-name-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("false");
|
||||
});
|
||||
|
||||
it("parent sidebar item is expanded", () => {
|
||||
const child = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-child-id",
|
||||
);
|
||||
const child = rendered.queryByTestId("sidebar-item-some-extension-name-some-child-id");
|
||||
|
||||
expect(child).not.toBeUndefined();
|
||||
expect(child).not.toBeNull();
|
||||
});
|
||||
|
||||
describe("when a child of the parent is selected", () => {
|
||||
@ -273,19 +242,13 @@ describe("cluster - sidebar and tab navigation for extensions", () => {
|
||||
});
|
||||
|
||||
it("parent is highlighted", () => {
|
||||
const parent = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-parent-id",
|
||||
);
|
||||
const parent = rendered.getByTestId("sidebar-item-some-extension-name-some-parent-id");
|
||||
|
||||
expect(parent?.dataset.isActiveTest).toBe("true");
|
||||
});
|
||||
|
||||
it("child is highlighted", () => {
|
||||
const child = getSidebarItem(
|
||||
rendered,
|
||||
"some-extension-name-some-child-id",
|
||||
);
|
||||
const child = rendered.getByTestId("sidebar-item-some-extension-name-some-child-id");
|
||||
|
||||
expect(child?.dataset.isActiveTest).toBe("true");
|
||||
});
|
||||
|
||||
@ -10,11 +10,10 @@ import { computed } from "mobx";
|
||||
import { routeSpecificComponentInjectionToken } from "../../renderer/routes/route-specific-component-injection-token";
|
||||
import React from "react";
|
||||
import isAllowedResourceInjectable from "../../common/utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../common/front-end-routing/route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../common/front-end-routing/front-end-route-injection-token";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { navigateToRouteInjectionToken } from "../../common/front-end-routing/navigate-to-route-injection-token";
|
||||
import { getSidebarItem } from "../utils";
|
||||
|
||||
describe("cluster - visibility of sidebar items", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
@ -42,9 +41,9 @@ describe("cluster - visibility of sidebar items", () => {
|
||||
});
|
||||
|
||||
it("related sidebar item does not exist", () => {
|
||||
const item = getSidebarItem(rendered, "some-item-id");
|
||||
const item = rendered.queryByTestId("sidebar-item-some-item-id");
|
||||
|
||||
expect(item).toBeUndefined();
|
||||
expect(item).toBeNull();
|
||||
});
|
||||
|
||||
describe("when kube resource becomes allowed", () => {
|
||||
@ -57,9 +56,9 @@ describe("cluster - visibility of sidebar items", () => {
|
||||
});
|
||||
|
||||
it("related sidebar item exists", () => {
|
||||
const item = getSidebarItem(rendered, "some-item-id");
|
||||
const item = rendered.queryByTestId("sidebar-item-some-item-id");
|
||||
|
||||
expect(item).not.toBeUndefined();
|
||||
expect(item).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -83,7 +82,7 @@ const testRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
const testRouteComponentInjectable = getInjectable({
|
||||
|
||||
@ -23,7 +23,7 @@ describe("extension special characters in page registrations", () => {
|
||||
extensionWithPagesHavingSpecialCharacters,
|
||||
);
|
||||
|
||||
await applicationBuilder.addExtensions(testExtension);
|
||||
applicationBuilder.extensions.renderer.enable(testExtension);
|
||||
|
||||
rendered = await applicationBuilder.render();
|
||||
});
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`extensions - navigation using application menu renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -10,6 +20,16 @@ exports[`extensions - navigation using application menu renders 1`] = `
|
||||
|
||||
exports[`extensions - navigation using application menu when navigating to extensions using application menu renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout DropFileInput Extensions"
|
||||
data-testid="extensions-page"
|
||||
|
||||
@ -37,8 +37,8 @@ describe("extensions - navigation using application menu", () => {
|
||||
});
|
||||
|
||||
describe("when navigating to extensions using application menu", () => {
|
||||
beforeEach(async () => {
|
||||
await applicationBuilder.applicationMenu.click("root.extensions");
|
||||
beforeEach(() => {
|
||||
applicationBuilder.applicationMenu.click("root.extensions");
|
||||
});
|
||||
|
||||
it("focuses the window", () => {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -24,10 +24,8 @@ exports[`helm-charts - navigation to Helm charts when navigating to Helm charts
|
||||
>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="workloads"
|
||||
data-is-active-test="false"
|
||||
data-test-id="workloads"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -60,10 +58,8 @@ exports[`helm-charts - navigation to Helm charts when navigating to Helm charts
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="config"
|
||||
data-is-active-test="false"
|
||||
data-test-id="config"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -89,10 +85,8 @@ exports[`helm-charts - navigation to Helm charts when navigating to Helm charts
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="network"
|
||||
data-is-active-test="false"
|
||||
data-test-id="network"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -128,10 +122,8 @@ exports[`helm-charts - navigation to Helm charts when navigating to Helm charts
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="storage"
|
||||
data-is-active-test="false"
|
||||
data-test-id="storage"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -157,10 +149,8 @@ exports[`helm-charts - navigation to Helm charts when navigating to Helm charts
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="helm"
|
||||
data-is-active-test="true"
|
||||
data-test-id="helm"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
@ -194,10 +184,8 @@ exports[`helm-charts - navigation to Helm charts when navigating to Helm charts
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="user-management"
|
||||
data-is-active-test="false"
|
||||
data-test-id="user-management"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
@ -223,10 +211,8 @@ exports[`helm-charts - navigation to Helm charts when navigating to Helm charts
|
||||
</div>
|
||||
<div
|
||||
class="SidebarItem"
|
||||
data-id-test="custom-resources"
|
||||
data-is-active-test="false"
|
||||
data-test-id="custom-resources"
|
||||
data-testid="sidebar-item"
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
@ -444,8 +430,14 @@ exports[`helm-charts - navigation to Helm charts when navigating to Helm charts
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="Spinner singleColor center"
|
||||
/>
|
||||
class="NoItems flex box grow"
|
||||
>
|
||||
<div
|
||||
class="box center"
|
||||
>
|
||||
Item list is empty
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="AddRemoveButtons flex gaps"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,387 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import { fireEvent } from "@testing-library/react";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import execFileInjectable from "../../common/fs/exec-file.injectable";
|
||||
import helmBinaryPathInjectable from "../../main/helm/helm-binary-path.injectable";
|
||||
import getActiveHelmRepositoriesInjectable from "../../main/helm/repositories/get-active-helm-repositories/get-active-helm-repositories.injectable";
|
||||
import type { HelmRepo } from "../../common/helm/helm-repo";
|
||||
import callForPublicHelmRepositoriesInjectable from "../../renderer/components/+preferences/kubernetes/helm-charts/adding-of-public-helm-repository/public-helm-repositories/call-for-public-helm-repositories.injectable";
|
||||
import isPathInjectable from "../../renderer/components/input/validators/is-path.injectable";
|
||||
import showSuccessNotificationInjectable from "../../renderer/components/notifications/show-success-notification.injectable";
|
||||
import showErrorNotificationInjectable from "../../renderer/components/notifications/show-error-notification.injectable";
|
||||
import type { AsyncResult } from "../../common/utils/async-result";
|
||||
|
||||
// TODO: Make tooltips free of side effects by making it deterministic
|
||||
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
|
||||
withTooltip: (target: any) => target,
|
||||
}));
|
||||
|
||||
describe("add custom helm repository in preferences", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
let showSuccessNotificationMock: jest.Mock;
|
||||
let showErrorNotificationMock: jest.Mock;
|
||||
let rendered: RenderResult;
|
||||
let execFileMock: AsyncFnMock<
|
||||
ReturnType<typeof execFileInjectable["instantiate"]>
|
||||
>;
|
||||
let getActiveHelmRepositoriesMock: AsyncFnMock<() => AsyncResult<HelmRepo[]>>;
|
||||
|
||||
beforeEach(async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
applicationBuilder = getApplicationBuilder();
|
||||
|
||||
execFileMock = asyncFn();
|
||||
getActiveHelmRepositoriesMock = asyncFn();
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ mainDi, rendererDi }) => {
|
||||
rendererDi.override(callForPublicHelmRepositoriesInjectable, () => async () => []);
|
||||
|
||||
showSuccessNotificationMock = jest.fn();
|
||||
|
||||
rendererDi.override(showSuccessNotificationInjectable, () => showSuccessNotificationMock);
|
||||
|
||||
showErrorNotificationMock = jest.fn();
|
||||
|
||||
rendererDi.override(showErrorNotificationInjectable, () => showErrorNotificationMock);
|
||||
|
||||
// TODO: Figure out how to make async validators unit testable
|
||||
rendererDi.override(isPathInjectable, () => ({ debounce: 0, validate: async () => {} }));
|
||||
|
||||
mainDi.override(
|
||||
getActiveHelmRepositoriesInjectable,
|
||||
() => getActiveHelmRepositoriesMock,
|
||||
);
|
||||
|
||||
mainDi.override(execFileInjectable, () => execFileMock);
|
||||
mainDi.override(helmBinaryPathInjectable, () => "some-helm-binary-path");
|
||||
});
|
||||
|
||||
rendered = await applicationBuilder.render();
|
||||
});
|
||||
|
||||
describe("when navigating to preferences containing helm repositories", () => {
|
||||
beforeEach(async () => {
|
||||
applicationBuilder.preferences.navigate();
|
||||
applicationBuilder.preferences.navigation.click("kubernetes");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when active repositories resolve", () => {
|
||||
beforeEach(async () => {
|
||||
await Promise.all([
|
||||
getActiveHelmRepositoriesMock.resolve({
|
||||
callWasSuccessful: true,
|
||||
response: [
|
||||
{ name: "Some active repository", url: "some-url" },
|
||||
],
|
||||
}),
|
||||
]);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when selecting to add custom repository", () => {
|
||||
beforeEach(() => {
|
||||
const button = rendered.getByTestId("add-custom-helm-repo-button");
|
||||
|
||||
fireEvent.click(button);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("shows dialog", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("add-custom-helm-repository-dialog"),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
// TODO: Figure out how to close dialog by clicking outside of it
|
||||
xdescribe("when closing the dialog by clicking outside", () => {
|
||||
beforeEach(() => {});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("does not show dialog anymore", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("add-custom-helm-repository-dialog"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when closing the dialog by clicking cancel", () => {
|
||||
beforeEach(() => {
|
||||
const button = rendered.getByTestId("custom-helm-repository-cancel-button");
|
||||
|
||||
fireEvent.click(button);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("does not show dialog anymore", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("add-custom-helm-repository-dialog"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when inputted minimal options for the repository", () => {
|
||||
beforeEach(() => {
|
||||
getActiveHelmRepositoriesMock.mockClear();
|
||||
|
||||
const nameInput = rendered.getByTestId("custom-helm-repository-name-input");
|
||||
|
||||
fireEvent.change(nameInput, { target: { value: "some-custom-repository" }});
|
||||
|
||||
const urlInput = rendered.getByTestId("custom-helm-repository-url-input");
|
||||
|
||||
fireEvent.change(urlInput, { target: { value: "http://some.url" }});
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when submitted and some time passes", () => {
|
||||
beforeEach(() => {
|
||||
const submitButton = rendered.getByTestId("custom-helm-repository-submit-button");
|
||||
|
||||
fireEvent.click(submitButton);
|
||||
|
||||
// TODO: Remove when debounce is removed from WizardStep.submit
|
||||
jest.runOnlyPendingTimers();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("adds the repository", () => {
|
||||
expect(execFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
["repo", "add", "some-custom-repository", "http://some.url"],
|
||||
);
|
||||
});
|
||||
|
||||
it("does not reload active repositories yet", () => {
|
||||
expect(getActiveHelmRepositoriesMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not show notification yet", () => {
|
||||
expect(showSuccessNotificationMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("when activation rejects", () => {
|
||||
beforeEach(async () => {
|
||||
await execFileMock.reject(
|
||||
"Some error",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("shows error notification", () => {
|
||||
expect(showErrorNotificationMock).toHaveBeenCalledWith(
|
||||
"Some error",
|
||||
);
|
||||
});
|
||||
|
||||
it("does not show success notification", () => {
|
||||
expect(showSuccessNotificationMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not show dialog anymore", () => {
|
||||
expect(rendered.queryByTestId("add-custom-helm-repository-dialog")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not reload active repositories", () => {
|
||||
expect(getActiveHelmRepositoriesMock).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when activation resolves with success", () => {
|
||||
beforeEach(async () => {
|
||||
await execFileMock.resolveSpecific(
|
||||
[
|
||||
"some-helm-binary-path",
|
||||
["repo", "add", "some-custom-repository", "http://some.url"],
|
||||
],
|
||||
|
||||
"",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("does not show dialog anymore", () => {
|
||||
expect(rendered.queryByTestId("add-custom-helm-repository-dialog")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("reloads active repositories", () => {
|
||||
expect(getActiveHelmRepositoriesMock).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("shows success notification", () => {
|
||||
expect(showSuccessNotificationMock).toHaveBeenCalledWith(
|
||||
"Helm repository some-custom-repository has been added.",
|
||||
);
|
||||
});
|
||||
|
||||
describe("when adding custom repository again", () => {
|
||||
beforeEach(() => {
|
||||
const button = rendered.getByTestId("add-custom-helm-repo-button");
|
||||
|
||||
fireEvent.click(button);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("repository name is empty", () => {
|
||||
const input = rendered.getByTestId("custom-helm-repository-name-input") as HTMLInputElement;
|
||||
|
||||
expect(input.value).toBe("");
|
||||
});
|
||||
|
||||
it("repository url is empty", () => {
|
||||
const input = rendered.getByTestId("custom-helm-repository-url-input") as HTMLInputElement;
|
||||
|
||||
expect(input.value).toBe("");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("when showing the maximal options", () => {
|
||||
beforeEach(() => {
|
||||
const button = rendered.getByTestId("toggle-maximal-options-for-custom-helm-repository-button");
|
||||
|
||||
fireEvent.click(button);
|
||||
});
|
||||
|
||||
it("shows maximal options", () => {
|
||||
const maximalOptions = rendered.getByTestId("maximal-options-for-custom-helm-repository-dialog");
|
||||
|
||||
expect(maximalOptions).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("given closing the dialog, when reopening the dialog, still shows maximal options", () => {
|
||||
const cancelButton = rendered.getByTestId("custom-helm-repository-cancel-button");
|
||||
|
||||
fireEvent.click(cancelButton);
|
||||
|
||||
const openButton = rendered.getByTestId("add-custom-helm-repo-button");
|
||||
|
||||
fireEvent.click(openButton);
|
||||
|
||||
const maximalOptions = rendered.getByTestId("maximal-options-for-custom-helm-repository-dialog");
|
||||
|
||||
expect(maximalOptions).toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe("when hiding maximal options", () => {
|
||||
beforeEach(() => {
|
||||
const button = rendered.getByTestId("toggle-maximal-options-for-custom-helm-repository-button");
|
||||
|
||||
fireEvent.click(button);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("does not show maximal options anymore", () => {
|
||||
const maximalOptions = rendered.queryByTestId("maximal-options-for-custom-helm-repository-dialog");
|
||||
|
||||
expect(maximalOptions).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when inputted maximal options", () => {
|
||||
beforeEach(async () => {
|
||||
[
|
||||
{ selector: "username-input", value: "some-username" },
|
||||
{ selector: "password-input", value: "some-password" },
|
||||
{ selector: "ca-cert-file-input", value: "some-ca-cert-file" },
|
||||
{ selector: "cert-file-input", value: "some-cert-file" },
|
||||
{ selector: "key-file-input", value: "some-key-file" },
|
||||
].forEach(({ selector, value }) => {
|
||||
const input = rendered.getByTestId(`custom-helm-repository-${selector}`);
|
||||
|
||||
fireEvent.change(input, { target: { value }});
|
||||
});
|
||||
|
||||
const checkbox = rendered.getByTestId(`custom-helm-repository-verify-tls-input`);
|
||||
|
||||
fireEvent.click(checkbox);
|
||||
|
||||
jest.runOnlyPendingTimers();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("when submitted and some time passes, adds the repository with maximal options", () => {
|
||||
const submitButton = rendered.getByTestId("custom-helm-repository-submit-button");
|
||||
|
||||
fireEvent.click(submitButton);
|
||||
|
||||
// TODO: Remove when debounce is removed from WizardStep.submit
|
||||
jest.runOnlyPendingTimers();
|
||||
|
||||
expect(execFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
[
|
||||
"repo",
|
||||
"add",
|
||||
"some-custom-repository",
|
||||
"http://some.url",
|
||||
"--insecure-skip-tls-verify",
|
||||
"--username",
|
||||
"some-username",
|
||||
"--password",
|
||||
"some-password",
|
||||
"--ca-file",
|
||||
"some-ca-cert-file",
|
||||
"--key-file",
|
||||
"some-key-file",
|
||||
"--cert-file",
|
||||
"some-cert-file",
|
||||
],
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,278 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import execFileInjectable from "../../common/fs/exec-file.injectable";
|
||||
import helmBinaryPathInjectable from "../../main/helm/helm-binary-path.injectable";
|
||||
import getActiveHelmRepositoriesInjectable from "../../main/helm/repositories/get-active-helm-repositories/get-active-helm-repositories.injectable";
|
||||
import type { HelmRepo } from "../../common/helm/helm-repo";
|
||||
import callForPublicHelmRepositoriesInjectable from "../../renderer/components/+preferences/kubernetes/helm-charts/adding-of-public-helm-repository/public-helm-repositories/call-for-public-helm-repositories.injectable";
|
||||
import showSuccessNotificationInjectable from "../../renderer/components/notifications/show-success-notification.injectable";
|
||||
import showErrorNotificationInjectable from "../../renderer/components/notifications/show-error-notification.injectable";
|
||||
import type { AsyncResult } from "../../common/utils/async-result";
|
||||
|
||||
// TODO: Make tooltips free of side effects by making it deterministic
|
||||
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
|
||||
withTooltip: (target: any) => target,
|
||||
}));
|
||||
|
||||
describe("add helm repository from list in preferences", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
let showSuccessNotificationMock: jest.Mock;
|
||||
let showErrorNotificationMock: jest.Mock;
|
||||
let rendered: RenderResult;
|
||||
let execFileMock: AsyncFnMock<
|
||||
ReturnType<typeof execFileInjectable["instantiate"]>
|
||||
>;
|
||||
let getActiveHelmRepositoriesMock: AsyncFnMock<() => AsyncResult<HelmRepo[]>>;
|
||||
let callForPublicHelmRepositoriesMock: AsyncFnMock<() => Promise<HelmRepo[]>>;
|
||||
|
||||
beforeEach(async () => {
|
||||
applicationBuilder = getApplicationBuilder();
|
||||
|
||||
execFileMock = asyncFn();
|
||||
getActiveHelmRepositoriesMock = asyncFn();
|
||||
callForPublicHelmRepositoriesMock = asyncFn();
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ mainDi, rendererDi }) => {
|
||||
showSuccessNotificationMock = jest.fn();
|
||||
|
||||
rendererDi.override(showSuccessNotificationInjectable, () => showSuccessNotificationMock);
|
||||
|
||||
showErrorNotificationMock = jest.fn();
|
||||
|
||||
rendererDi.override(showErrorNotificationInjectable, () => showErrorNotificationMock);
|
||||
|
||||
rendererDi.override(
|
||||
callForPublicHelmRepositoriesInjectable,
|
||||
() => callForPublicHelmRepositoriesMock,
|
||||
);
|
||||
|
||||
mainDi.override(
|
||||
getActiveHelmRepositoriesInjectable,
|
||||
() => getActiveHelmRepositoriesMock,
|
||||
);
|
||||
mainDi.override(execFileInjectable, () => execFileMock);
|
||||
mainDi.override(helmBinaryPathInjectable, () => "some-helm-binary-path");
|
||||
});
|
||||
|
||||
rendered = await applicationBuilder.render();
|
||||
});
|
||||
|
||||
describe("when navigating to preferences containing helm repositories", () => {
|
||||
beforeEach(async () => {
|
||||
applicationBuilder.preferences.navigate();
|
||||
applicationBuilder.preferences.navigation.click("kubernetes");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("calls for public repositories", () => {
|
||||
expect(callForPublicHelmRepositoriesMock).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("calls for active repositories", () => {
|
||||
expect(getActiveHelmRepositoriesMock).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("when both active and public repositories resolve", () => {
|
||||
beforeEach(async () => {
|
||||
await Promise.all([
|
||||
callForPublicHelmRepositoriesMock.resolve([
|
||||
{ name: "Some already active repository", url: "some-url" },
|
||||
{ name: "Some to be added repository", url: "some-other-url" },
|
||||
]),
|
||||
|
||||
getActiveHelmRepositoriesMock.resolve({
|
||||
callWasSuccessful: true,
|
||||
response: [
|
||||
{ name: "Some already active repository", url: "some-url" },
|
||||
],
|
||||
}),
|
||||
]);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when select for adding public repositories is clicked", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.select.openMenu(
|
||||
"selection-of-active-public-helm-repository",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when deactive public repository is selected", () => {
|
||||
beforeEach(async () => {
|
||||
getActiveHelmRepositoriesMock.mockClear();
|
||||
|
||||
applicationBuilder.select.selectOption(
|
||||
"selection-of-active-public-helm-repository",
|
||||
"Some to be added repository",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("adds the repository", () => {
|
||||
expect(execFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
["repo", "add", "Some to be added repository", "some-other-url"],
|
||||
);
|
||||
});
|
||||
|
||||
it("does not reload active repositories yet", () => {
|
||||
expect(getActiveHelmRepositoriesMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("when adding rejects", () => {
|
||||
beforeEach(async () => {
|
||||
await execFileMock.reject(
|
||||
"Some error",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("shows error notification", () => {
|
||||
expect(showErrorNotificationMock).toHaveBeenCalledWith(
|
||||
"Some error",
|
||||
);
|
||||
});
|
||||
|
||||
it("does not show success notification", () => {
|
||||
expect(showSuccessNotificationMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not show dialog anymore", () => {
|
||||
expect(rendered.queryByTestId("add-custom-helm-repository-dialog")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not reload active repositories", () => {
|
||||
expect(getActiveHelmRepositoriesMock).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when adding resolves", () => {
|
||||
beforeEach(async () => {
|
||||
await execFileMock.resolveSpecific(
|
||||
[
|
||||
"some-helm-binary-path",
|
||||
["repo", "add", "Some to be added repository", "some-other-url"],
|
||||
],
|
||||
|
||||
"",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("reloads active repositories", () => {
|
||||
expect(getActiveHelmRepositoriesMock).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("shows success notification", () => {
|
||||
expect(showSuccessNotificationMock).toHaveBeenCalledWith(
|
||||
"Helm repository Some to be added repository has been added.",
|
||||
);
|
||||
});
|
||||
|
||||
describe("when active repositories resolve again", () => {
|
||||
beforeEach(async () => {
|
||||
await getActiveHelmRepositoriesMock.resolve({
|
||||
callWasSuccessful: true,
|
||||
response: [
|
||||
{ name: "Some already active repository", url: "some-url" },
|
||||
{ name: "Some to be added repository", url: "some-other-url" },
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when select for selecting active repositories is clicked", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.select.openMenu(
|
||||
"selection-of-active-public-helm-repository",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when active repository is selected", () => {
|
||||
beforeEach(() => {
|
||||
execFileMock.mockClear();
|
||||
getActiveHelmRepositoriesMock.mockClear();
|
||||
|
||||
applicationBuilder.select.selectOption(
|
||||
"selection-of-active-public-helm-repository",
|
||||
"Some already active repository",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("removes the repository", () => {
|
||||
expect(execFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
["repo", "remove", "Some already active repository"],
|
||||
);
|
||||
});
|
||||
|
||||
it("does not reload active repositories yet", () => {
|
||||
expect(getActiveHelmRepositoriesMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("when removing resolves", () => {
|
||||
beforeEach(async () => {
|
||||
await execFileMock.resolveSpecific(
|
||||
[
|
||||
"some-helm-binary-path",
|
||||
["repo", "remove", "Some already active repository"],
|
||||
],
|
||||
|
||||
"",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("reloads active repositories", () => {
|
||||
expect(getActiveHelmRepositoriesMock).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,458 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import type { ReadYamlFile } from "../../common/fs/read-yaml-file.injectable";
|
||||
import readYamlFileInjectable from "../../common/fs/read-yaml-file.injectable";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import type { HelmRepositoriesFromYaml } from "../../main/helm/repositories/get-active-helm-repositories/get-active-helm-repositories.injectable";
|
||||
import execFileInjectable from "../../common/fs/exec-file.injectable";
|
||||
import helmBinaryPathInjectable from "../../main/helm/helm-binary-path.injectable";
|
||||
import loggerInjectable from "../../common/logger.injectable";
|
||||
import type { Logger } from "../../common/logger";
|
||||
import callForPublicHelmRepositoriesInjectable from "../../renderer/components/+preferences/kubernetes/helm-charts/adding-of-public-helm-repository/public-helm-repositories/call-for-public-helm-repositories.injectable";
|
||||
import showErrorNotificationInjectable from "../../renderer/components/notifications/show-error-notification.injectable";
|
||||
|
||||
// TODO: Make tooltips free of side effects by making it deterministic
|
||||
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
|
||||
withTooltip: (target: any) => target,
|
||||
}));
|
||||
|
||||
describe("listing active helm repositories in preferences", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
let rendered: RenderResult;
|
||||
let readYamlFileMock: AsyncFnMock<ReadYamlFile>;
|
||||
let execFileMock: AsyncFnMock<ReturnType<typeof execFileInjectable["instantiate"]>>;
|
||||
let loggerStub: Logger;
|
||||
let showErrorNotificationMock: jest.Mock;
|
||||
|
||||
beforeEach(async () => {
|
||||
applicationBuilder = getApplicationBuilder();
|
||||
|
||||
readYamlFileMock = asyncFn();
|
||||
execFileMock = asyncFn();
|
||||
|
||||
loggerStub = { error: jest.fn() } as unknown as Logger;
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ mainDi, rendererDi }) => {
|
||||
showErrorNotificationMock = jest.fn();
|
||||
|
||||
rendererDi.override(showErrorNotificationInjectable, () => showErrorNotificationMock);
|
||||
rendererDi.override(callForPublicHelmRepositoriesInjectable, () => async () => []);
|
||||
mainDi.override(readYamlFileInjectable, () => readYamlFileMock);
|
||||
mainDi.override(execFileInjectable, () => execFileMock);
|
||||
mainDi.override(helmBinaryPathInjectable, () => "some-helm-binary-path");
|
||||
mainDi.override(loggerInjectable, () => loggerStub);
|
||||
});
|
||||
|
||||
rendered = await applicationBuilder.render();
|
||||
});
|
||||
|
||||
describe("when navigating to preferences containing helm repositories", () => {
|
||||
beforeEach(async () => {
|
||||
applicationBuilder.preferences.navigate();
|
||||
applicationBuilder.preferences.navigation.click("kubernetes");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("shows loader for repositories", () => {
|
||||
expect(
|
||||
rendered.getByTestId("helm-repositories-are-loading"),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("calls for helm configuration", () => {
|
||||
expect(execFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
["env"],
|
||||
);
|
||||
});
|
||||
|
||||
it("does not call for updating of repositories yet", () => {
|
||||
expect(execFileMock).not.toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
["repo", "update"],
|
||||
);
|
||||
});
|
||||
|
||||
describe("when getting configuration rejects", () => {
|
||||
beforeEach(async () => {
|
||||
await execFileMock.reject("some-error");
|
||||
});
|
||||
|
||||
it("shows error notification", () => {
|
||||
expect(showErrorNotificationMock).toHaveBeenCalledWith(
|
||||
"Error getting Helm configuration: some-error",
|
||||
);
|
||||
});
|
||||
|
||||
it("removes all helm controls", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-controls"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not show loader for repositories anymore", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-repositories-are-loading"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when configuration resolves without path to repository config file", () => {
|
||||
beforeEach(async () => {
|
||||
execFileMock.mockClear();
|
||||
|
||||
await execFileMock.resolveSpecific(
|
||||
["some-helm-binary-path", ["env"]],
|
||||
"HELM_REPOSITORY_CACHE=some-helm-repository-cache-path",
|
||||
);
|
||||
});
|
||||
|
||||
it("logs error", () => {
|
||||
expect(loggerStub.error).toHaveBeenCalledWith(
|
||||
"Tried to get Helm repositories, but HELM_REPOSITORY_CONFIG was not present in `$ helm env`.",
|
||||
);
|
||||
});
|
||||
|
||||
it("shows error notification", () => {
|
||||
expect(showErrorNotificationMock).toHaveBeenCalledWith(
|
||||
"Error getting Helm configuration: Tried to get Helm repositories, but HELM_REPOSITORY_CONFIG was not present in `$ helm env`.",
|
||||
);
|
||||
});
|
||||
|
||||
it("removes all helm controls", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-controls"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not show loader for repositories anymore", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-repositories-are-loading"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when configuration resolves without path to repository cache directory", () => {
|
||||
beforeEach(async () => {
|
||||
execFileMock.mockClear();
|
||||
|
||||
await execFileMock.resolveSpecific(
|
||||
["some-helm-binary-path", ["env"]],
|
||||
"HELM_REPOSITORY_CONFIG=some-helm-repository-config-file.yaml",
|
||||
);
|
||||
});
|
||||
|
||||
it("logs error", () => {
|
||||
expect(loggerStub.error).toHaveBeenCalledWith(
|
||||
"Tried to get Helm repositories, but HELM_REPOSITORY_CACHE was not present in `$ helm env`.",
|
||||
);
|
||||
});
|
||||
|
||||
it("shows error notification", () => {
|
||||
expect(showErrorNotificationMock).toHaveBeenCalledWith(
|
||||
"Error getting Helm configuration: Tried to get Helm repositories, but HELM_REPOSITORY_CACHE was not present in `$ helm env`.",
|
||||
);
|
||||
});
|
||||
|
||||
it("removes all helm controls", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-controls"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not show loader for repositories anymore", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-repositories-are-loading"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when configuration resolves", () => {
|
||||
beforeEach(async () => {
|
||||
execFileMock.mockClear();
|
||||
|
||||
await execFileMock.resolveSpecific(
|
||||
["some-helm-binary-path", ["env"]],
|
||||
|
||||
[
|
||||
"HELM_REPOSITORY_CONFIG=some-helm-repository-config-file.yaml",
|
||||
"HELM_REPOSITORY_CACHE=some-helm-repository-cache-path",
|
||||
].join("\n"),
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("calls for update of repositories", () => {
|
||||
expect(execFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
["repo", "update"],
|
||||
);
|
||||
});
|
||||
|
||||
it("does not call for repositories yet", () => {
|
||||
expect(readYamlFileMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("when updating repositories reject with any other error", () => {
|
||||
beforeEach(async () => {
|
||||
await execFileMock.reject("Some error");
|
||||
});
|
||||
|
||||
it("shows error notification", () => {
|
||||
expect(showErrorNotificationMock).toHaveBeenCalledWith(
|
||||
"Error updating Helm repositories: Some error",
|
||||
);
|
||||
});
|
||||
|
||||
it("removes all helm controls", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-controls"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not show loader for repositories anymore", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-repositories-are-loading"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when updating repositories reject with error about no existing repositories", () => {
|
||||
beforeEach(async () => {
|
||||
execFileMock.mockClear();
|
||||
|
||||
await execFileMock.reject(
|
||||
"Error: no repositories found. You must add one before updating",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("still shows the loader for repositories", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-repositories-are-loading"),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('adds "bitnami" as default repository', () => {
|
||||
expect(execFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
["repo", "add", "bitnami", "https://charts.bitnami.com/bitnami"],
|
||||
);
|
||||
});
|
||||
|
||||
describe("when adding default repository reject", () => {
|
||||
beforeEach(async () => {
|
||||
await execFileMock.reject("Some error");
|
||||
});
|
||||
|
||||
it("shows error notification", () => {
|
||||
expect(showErrorNotificationMock).toHaveBeenCalledWith(
|
||||
"Error when adding default Helm repository: Some error",
|
||||
);
|
||||
});
|
||||
|
||||
it("removes all helm controls", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-controls"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not show loader for repositories anymore", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-repositories-are-loading"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when adding of default repository resolves", () => {
|
||||
beforeEach(async () => {
|
||||
readYamlFileMock.mockClear();
|
||||
|
||||
await execFileMock.resolveSpecific(
|
||||
[
|
||||
"some-helm-binary-path",
|
||||
|
||||
[
|
||||
"repo",
|
||||
"add",
|
||||
"bitnami",
|
||||
"https://charts.bitnami.com/bitnami",
|
||||
],
|
||||
],
|
||||
|
||||
"",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("still shows the loader for repositories", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-repositories-are-loading"),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("calls for repositories again", () => {
|
||||
expect(readYamlFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-repository-config-file.yaml",
|
||||
);
|
||||
});
|
||||
|
||||
describe("when another call for repositories resolve", () => {
|
||||
beforeEach(async () => {
|
||||
await readYamlFileMock.resolveSpecific(
|
||||
["some-helm-repository-config-file.yaml"],
|
||||
|
||||
{
|
||||
repositories: [
|
||||
{
|
||||
name: "bitnami",
|
||||
url: "https://charts.bitnami.com/bitnami",
|
||||
caFile: "irrelevant",
|
||||
certFile: "irrelevant",
|
||||
insecure_skip_tls_verify: false,
|
||||
keyFile: "irrelevant",
|
||||
pass_credentials_all: false,
|
||||
password: "irrelevant",
|
||||
username: "irrelevant",
|
||||
},
|
||||
],
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it("does not show loader for repositories anymore", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-repositories-are-loading"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows the added repository", () => {
|
||||
const actual = rendered.getByTestId("helm-repository-bitnami");
|
||||
|
||||
expect(actual).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("when updating repositories resolve", () => {
|
||||
beforeEach(async () => {
|
||||
execFileMock.mockClear();
|
||||
|
||||
await execFileMock.resolveSpecific(
|
||||
["some-helm-binary-path", ["repo", "update"]],
|
||||
"",
|
||||
);
|
||||
});
|
||||
|
||||
it("loads repositories from file system", () => {
|
||||
expect(readYamlFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-repository-config-file.yaml",
|
||||
);
|
||||
});
|
||||
|
||||
describe("when repositories resolves", () => {
|
||||
beforeEach(async () => {
|
||||
execFileMock.mockClear();
|
||||
|
||||
await readYamlFileMock.resolveSpecific(
|
||||
["some-helm-repository-config-file.yaml"],
|
||||
repositoryConfigStub,
|
||||
);
|
||||
});
|
||||
|
||||
it("does not add default repository", () => {
|
||||
expect(execFileMock).not.toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
["repo", "add", "bitnami", "https://charts.bitnami.com/bitnami"],
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("does not show loader for repositories anymore", () => {
|
||||
expect(
|
||||
rendered.queryByTestId("helm-repositories-are-loading"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows repositories in use", () => {
|
||||
const actual = rendered.getAllByTestId(
|
||||
/^helm-repository-(some-repository|some-other-repository)$/,
|
||||
);
|
||||
|
||||
expect(actual).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const repositoryConfigStub: HelmRepositoriesFromYaml = {
|
||||
repositories: [
|
||||
{
|
||||
name: "some-repository",
|
||||
url: "some-repository-url",
|
||||
caFile: "irrelevant",
|
||||
certFile: "irrelevant",
|
||||
insecure_skip_tls_verify: false,
|
||||
keyFile: "irrelevant",
|
||||
pass_credentials_all: false,
|
||||
password: "irrelevant",
|
||||
username: "irrelevant",
|
||||
},
|
||||
|
||||
{
|
||||
name: "some-other-repository",
|
||||
url: "some-other-repository-url",
|
||||
caFile: "irrelevant",
|
||||
certFile: "irrelevant",
|
||||
insecure_skip_tls_verify: false,
|
||||
keyFile: "irrelevant",
|
||||
pass_credentials_all: false,
|
||||
password: "irrelevant",
|
||||
username: "irrelevant",
|
||||
},
|
||||
],
|
||||
};
|
||||
@ -0,0 +1,126 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import { fireEvent } from "@testing-library/react";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import execFileInjectable from "../../common/fs/exec-file.injectable";
|
||||
import helmBinaryPathInjectable from "../../main/helm/helm-binary-path.injectable";
|
||||
import getActiveHelmRepositoriesInjectable from "../../main/helm/repositories/get-active-helm-repositories/get-active-helm-repositories.injectable";
|
||||
import type { HelmRepo } from "../../common/helm/helm-repo";
|
||||
import callForPublicHelmRepositoriesInjectable from "../../renderer/components/+preferences/kubernetes/helm-charts/adding-of-public-helm-repository/public-helm-repositories/call-for-public-helm-repositories.injectable";
|
||||
import type { AsyncResult } from "../../common/utils/async-result";
|
||||
|
||||
// TODO: Make tooltips free of side effects by making it deterministic
|
||||
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
|
||||
withTooltip: (target: any) => target,
|
||||
}));
|
||||
|
||||
describe("remove helm repository from list of active repositories in preferences", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
let rendered: RenderResult;
|
||||
let getActiveHelmRepositoriesMock: AsyncFnMock<() => AsyncResult<HelmRepo[]>>;
|
||||
let execFileMock: AsyncFnMock<
|
||||
ReturnType<typeof execFileInjectable["instantiate"]>
|
||||
>;
|
||||
|
||||
beforeEach(async () => {
|
||||
applicationBuilder = getApplicationBuilder();
|
||||
|
||||
execFileMock = asyncFn();
|
||||
getActiveHelmRepositoriesMock = asyncFn();
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ mainDi, rendererDi }) => {
|
||||
rendererDi.override(callForPublicHelmRepositoriesInjectable, () => async () => []);
|
||||
|
||||
mainDi.override(
|
||||
getActiveHelmRepositoriesInjectable,
|
||||
() => getActiveHelmRepositoriesMock,
|
||||
);
|
||||
|
||||
mainDi.override(execFileInjectable, () => execFileMock);
|
||||
mainDi.override(helmBinaryPathInjectable, () => "some-helm-binary-path");
|
||||
});
|
||||
|
||||
rendered = await applicationBuilder.render();
|
||||
});
|
||||
|
||||
describe("when navigating to preferences containing helm repositories", () => {
|
||||
beforeEach(async () => {
|
||||
applicationBuilder.preferences.navigate();
|
||||
applicationBuilder.preferences.navigation.click("kubernetes");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when active repositories resolve", () => {
|
||||
beforeEach(async () => {
|
||||
getActiveHelmRepositoriesMock.resolve({
|
||||
callWasSuccessful: true,
|
||||
response: [
|
||||
{ name: "some-active-repository", url: "some-url" },
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when removing repository", () => {
|
||||
beforeEach(() => {
|
||||
execFileMock.mockClear();
|
||||
getActiveHelmRepositoriesMock.mockClear();
|
||||
|
||||
const removeButton = rendered.getByTestId(
|
||||
"remove-helm-repository-some-active-repository",
|
||||
);
|
||||
|
||||
fireEvent.click(removeButton);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("removes the repository", () => {
|
||||
expect(execFileMock).toHaveBeenCalledWith(
|
||||
"some-helm-binary-path",
|
||||
["repo", "remove", "some-active-repository"],
|
||||
);
|
||||
});
|
||||
|
||||
it("does not reload active repositories yet", () => {
|
||||
expect(getActiveHelmRepositoriesMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("when removing resolves", () => {
|
||||
beforeEach(async () => {
|
||||
await execFileMock.resolveSpecific(
|
||||
[
|
||||
"some-helm-binary-path",
|
||||
["repo", "remove", "some-active-repository"],
|
||||
],
|
||||
|
||||
"",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("reloads active repositories", () => {
|
||||
expect(getActiveHelmRepositoriesMock).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -27,7 +27,7 @@ describe("navigate to extension page", () => {
|
||||
extensionWithPagesHavingParameters,
|
||||
);
|
||||
|
||||
await applicationBuilder.addExtensions(testExtension);
|
||||
applicationBuilder.extensions.renderer.enable(testExtension);
|
||||
|
||||
rendered = await applicationBuilder.render();
|
||||
|
||||
|
||||
@ -9,15 +9,15 @@ import { computed } from "mobx";
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import { routeSpecificComponentInjectionToken } from "../renderer/routes/route-specific-component-injection-token";
|
||||
import { observer } from "mobx-react";
|
||||
import type { Route } from "../common/front-end-routing/route-injection-token";
|
||||
import { routeInjectionToken } from "../common/front-end-routing/route-injection-token";
|
||||
import type { Route } from "../common/front-end-routing/front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../common/front-end-routing/front-end-route-injection-token";
|
||||
import type { ApplicationBuilder } from "../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../renderer/components/test-utils/get-application-builder";
|
||||
import currentRouteInjectable from "../renderer/routes/current-route.injectable";
|
||||
import currentPathInjectable from "../renderer/routes/current-path.injectable";
|
||||
import queryParametersInjectable from "../renderer/routes/query-parameters.injectable";
|
||||
import currentPathParametersInjectable from "../renderer/routes/current-path-parameters.injectable";
|
||||
import { navigateToRouteInjectionToken } from "../common/front-end-routing/navigate-to-route-injection-token";
|
||||
import routePathParametersInjectable from "../renderer/routes/route-path-parameters.injectable";
|
||||
|
||||
describe("navigating between routes", () => {
|
||||
let rendererDi: DiContainer;
|
||||
@ -73,7 +73,7 @@ describe("navigating between routes", () => {
|
||||
});
|
||||
|
||||
it("does not have path parameters", () => {
|
||||
const pathParameters = rendererDi.inject(currentPathParametersInjectable);
|
||||
const pathParameters = rendererDi.inject(routePathParametersInjectable, route);
|
||||
|
||||
expect(pathParameters.get()).toEqual({});
|
||||
});
|
||||
@ -101,7 +101,6 @@ describe("navigating between routes", () => {
|
||||
|
||||
describe("given route with optional path parameters", () => {
|
||||
beforeEach(async () => {
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ rendererDi }) => {
|
||||
rendererDi.register(routeWithOptionalPathParametersInjectable);
|
||||
rendererDi.register(routeWithOptionalPathParametersComponentInjectable);
|
||||
@ -146,7 +145,7 @@ describe("navigating between routes", () => {
|
||||
});
|
||||
|
||||
it("knows path parameters", () => {
|
||||
const pathParameters = rendererDi.inject(currentPathParametersInjectable);
|
||||
const pathParameters = rendererDi.inject(routePathParametersInjectable, route);
|
||||
|
||||
expect(pathParameters.get()).toEqual({
|
||||
someParameter: "some-value",
|
||||
@ -179,7 +178,7 @@ describe("navigating between routes", () => {
|
||||
});
|
||||
|
||||
it("knows path parameters", () => {
|
||||
const pathParameters = rendererDi.inject(currentPathParametersInjectable);
|
||||
const pathParameters = rendererDi.inject(routePathParametersInjectable, route);
|
||||
|
||||
expect(pathParameters.get()).toEqual({
|
||||
someParameter: undefined,
|
||||
@ -192,7 +191,7 @@ describe("navigating between routes", () => {
|
||||
|
||||
const testRouteWithoutPathParametersInjectable = getInjectable({
|
||||
id: "some-route",
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
|
||||
instantiate: () => ({
|
||||
path: "/some-path",
|
||||
@ -214,7 +213,7 @@ const testRouteWithoutPathParametersComponentInjectable = getInjectable({
|
||||
|
||||
const routeWithOptionalPathParametersInjectable = getInjectable({
|
||||
id: "some-route",
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
|
||||
instantiate: (): Route<{ someParameter?: string; someOtherParameter?: string }> => ({
|
||||
path: "/some-path/:someParameter?/:someOtherParameter?",
|
||||
@ -227,10 +226,11 @@ const routeWithOptionalPathParametersComponentInjectable = getInjectable({
|
||||
id: "some-route-component",
|
||||
|
||||
instantiate: (di) => {
|
||||
const pathParameters = di.inject(currentPathParametersInjectable);
|
||||
const route = di.inject(routeWithOptionalPathParametersInjectable);
|
||||
const pathParameters = di.inject(routePathParametersInjectable, route);
|
||||
|
||||
return {
|
||||
route: di.inject(routeWithOptionalPathParametersInjectable),
|
||||
route,
|
||||
|
||||
Component: observer(() => (
|
||||
<pre>{JSON.stringify(pathParameters.get(), null, 2)}</pre>
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`preferences - closing-preferences given accessing preferences directly renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
@ -543,6 +553,16 @@ exports[`preferences - closing-preferences given accessing preferences directly
|
||||
|
||||
exports[`preferences - closing-preferences given accessing preferences directly when navigating to a tab in preferences renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
>
|
||||
@ -688,6 +708,16 @@ exports[`preferences - closing-preferences given accessing preferences directly
|
||||
|
||||
exports[`preferences - closing-preferences given accessing preferences directly when navigating to a tab in preferences when preferences are closed renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
Some front page
|
||||
</div>
|
||||
@ -699,6 +729,16 @@ exports[`preferences - closing-preferences given accessing preferences directly
|
||||
|
||||
exports[`preferences - closing-preferences given accessing preferences directly when preferences are closed renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
Some front page
|
||||
</div>
|
||||
@ -710,6 +750,16 @@ exports[`preferences - closing-preferences given accessing preferences directly
|
||||
|
||||
exports[`preferences - closing-preferences given already in a page and then navigated to preferences renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
@ -1251,6 +1301,16 @@ exports[`preferences - closing-preferences given already in a page and then navi
|
||||
|
||||
exports[`preferences - closing-preferences given already in a page and then navigated to preferences when navigating to a tab in preferences renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
>
|
||||
@ -1396,6 +1456,16 @@ exports[`preferences - closing-preferences given already in a page and then navi
|
||||
|
||||
exports[`preferences - closing-preferences given already in a page and then navigated to preferences when navigating to a tab in preferences when preferences are closed renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
>
|
||||
@ -1541,6 +1611,16 @@ exports[`preferences - closing-preferences given already in a page and then navi
|
||||
|
||||
exports[`preferences - closing-preferences given already in a page and then navigated to preferences when preferences are closed renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
>
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`preferences - navigation to application preferences given in some child page of preferences, when rendered renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="proxy-preferences-page"
|
||||
@ -207,6 +217,16 @@ exports[`preferences - navigation to application preferences given in some child
|
||||
|
||||
exports[`preferences - navigation to application preferences given in some child page of preferences, when rendered when navigating to application preferences using navigation renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`preferences - navigation to editor preferences given in preferences, when rendered renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
@ -531,6 +541,16 @@ exports[`preferences - navigation to editor preferences given in preferences, wh
|
||||
|
||||
exports[`preferences - navigation to editor preferences given in preferences, when rendered when navigating to editor preferences using navigation renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="editor-preferences-page"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`preferences - navigation to kubernetes preferences given in preferences, when rendered renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
@ -531,6 +541,16 @@ exports[`preferences - navigation to kubernetes preferences given in preferences
|
||||
|
||||
exports[`preferences - navigation to kubernetes preferences given in preferences, when rendered when navigating to kubernetes preferences using navigation renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="kubernetes-preferences-page"
|
||||
@ -834,114 +854,97 @@ exports[`preferences - navigation to kubernetes preferences given in preferences
|
||||
</h2>
|
||||
<div>
|
||||
<div
|
||||
class="flex gaps"
|
||||
data-testid="helm-controls"
|
||||
>
|
||||
<div
|
||||
class="Select theme-lens box grow Select--is-disabled css-3iigni-container"
|
||||
class="flex gaps"
|
||||
>
|
||||
<span
|
||||
class="css-1f43avz-a11yText-A11yText"
|
||||
id="react-select-HelmRepoSelect-live-region"
|
||||
/>
|
||||
<span
|
||||
aria-atomic="false"
|
||||
aria-live="polite"
|
||||
aria-relevant="additions text"
|
||||
class="css-1f43avz-a11yText-A11yText"
|
||||
/>
|
||||
<div
|
||||
class="Select__control Select__control--is-disabled css-1insrsq-control"
|
||||
class="Select theme-lens box grow css-b62m3t-container"
|
||||
>
|
||||
<span
|
||||
class="css-1f43avz-a11yText-A11yText"
|
||||
id="react-select-selection-of-active-public-helm-repository-live-region"
|
||||
/>
|
||||
<span
|
||||
aria-atomic="false"
|
||||
aria-live="polite"
|
||||
aria-relevant="additions text"
|
||||
class="css-1f43avz-a11yText-A11yText"
|
||||
/>
|
||||
<div
|
||||
class="Select__value-container css-319lph-ValueContainer"
|
||||
class="Select__control css-1s2u09g-control"
|
||||
>
|
||||
<div
|
||||
class="Select__placeholder css-14el2xx-placeholder"
|
||||
id="react-select-HelmRepoSelect-placeholder"
|
||||
class="Select__value-container css-319lph-ValueContainer"
|
||||
>
|
||||
Repositories
|
||||
</div>
|
||||
<div
|
||||
class="Select__input-container css-jzldcf-Input"
|
||||
data-value=""
|
||||
>
|
||||
<input
|
||||
aria-autocomplete="list"
|
||||
aria-describedby="react-select-HelmRepoSelect-placeholder"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
autocapitalize="none"
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
class="Select__input"
|
||||
disabled=""
|
||||
id="HelmRepoSelect"
|
||||
role="combobox"
|
||||
spellcheck="false"
|
||||
style="opacity: 1; width: 100%; grid-area: 1 / 2; min-width: 2px; border: 0px; margin: 0px; outline: 0; padding: 0px;"
|
||||
tabindex="0"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="Select__indicators css-1hb7zxy-IndicatorsContainer"
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="Select__indicator Select__loading-indicator css-at12u2-loadingIndicator"
|
||||
>
|
||||
<span
|
||||
class="css-1xtdfmb-LoadingDot"
|
||||
/>
|
||||
<span
|
||||
class="css-zoievk-LoadingDot"
|
||||
/>
|
||||
<span
|
||||
class="css-x748d8-LoadingDot"
|
||||
/>
|
||||
</div>
|
||||
<span
|
||||
class="Select__indicator-separator css-109onse-indicatorSeparator"
|
||||
/>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="Select__indicator Select__dropdown-indicator css-tlfecz-indicatorContainer"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="css-tj5bde-Svg"
|
||||
focusable="false"
|
||||
height="20"
|
||||
viewBox="0 0 20 20"
|
||||
width="20"
|
||||
<div
|
||||
class="Select__placeholder css-14el2xx-placeholder"
|
||||
id="react-select-selection-of-active-public-helm-repository-placeholder"
|
||||
>
|
||||
<path
|
||||
d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
|
||||
Repositories
|
||||
</div>
|
||||
<div
|
||||
class="Select__input-container css-6j8wv5-Input"
|
||||
data-value=""
|
||||
>
|
||||
<input
|
||||
aria-autocomplete="list"
|
||||
aria-describedby="react-select-selection-of-active-public-helm-repository-placeholder"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
autocapitalize="none"
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
class="Select__input"
|
||||
id="selection-of-active-public-helm-repository"
|
||||
role="combobox"
|
||||
spellcheck="false"
|
||||
style="opacity: 1; width: 100%; grid-area: 1 / 2; min-width: 2px; border: 0px; margin: 0px; outline: 0; padding: 0px;"
|
||||
tabindex="0"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="Select__indicators css-1hb7zxy-IndicatorsContainer"
|
||||
>
|
||||
<span
|
||||
class="Select__indicator-separator css-1okebmr-indicatorSeparator"
|
||||
/>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="Select__indicator Select__dropdown-indicator css-tlfecz-indicatorContainer"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="css-tj5bde-Svg"
|
||||
focusable="false"
|
||||
height="20"
|
||||
viewBox="0 0 20 20"
|
||||
width="20"
|
||||
>
|
||||
<path
|
||||
d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="Button primary"
|
||||
data-testid="add-custom-helm-repo-button"
|
||||
type="button"
|
||||
>
|
||||
Add Custom Helm Repo
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
class="Button primary"
|
||||
type="button"
|
||||
>
|
||||
Add Custom Helm Repo
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="repos"
|
||||
>
|
||||
<div
|
||||
class="pt-5 relative"
|
||||
>
|
||||
<div
|
||||
class="Spinner singleColor center"
|
||||
/>
|
||||
</div>
|
||||
class="repos"
|
||||
/>
|
||||
<div />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`preferences - navigation to proxy preferences given in preferences, when rendered renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
@ -531,6 +541,16 @@ exports[`preferences - navigation to proxy preferences given in preferences, whe
|
||||
|
||||
exports[`preferences - navigation to proxy preferences given in preferences, when rendered when navigating to proxy preferences using navigation renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="proxy-preferences-page"
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`preferences - navigation to telemetry preferences given URL for Sentry DNS, when navigating to preferences when navigating to telemetry preferences renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="telemetry-preferences-page"
|
||||
@ -193,6 +203,16 @@ exports[`preferences - navigation to telemetry preferences given URL for Sentry
|
||||
|
||||
exports[`preferences - navigation to telemetry preferences given in preferences, when rendered renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
@ -722,6 +742,16 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
|
||||
|
||||
exports[`preferences - navigation to telemetry preferences given in preferences, when rendered when extension with telemetry preference items gets enabled renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
@ -1263,6 +1293,16 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
|
||||
|
||||
exports[`preferences - navigation to telemetry preferences given in preferences, when rendered when extension with telemetry preference items gets enabled when clicking link to telemetry preferences from navigation renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="telemetry-preferences-page"
|
||||
@ -1442,6 +1482,16 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
|
||||
|
||||
exports[`preferences - navigation to telemetry preferences given no URL for Sentry DNS, when navigating to telemetry preferences renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="telemetry-preferences-page"
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`preferences - navigation to terminal preferences given in preferences, when rendered renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
@ -531,6 +541,16 @@ exports[`preferences - navigation to terminal preferences given in preferences,
|
||||
|
||||
exports[`preferences - navigation to terminal preferences given in preferences, when rendered when navigating to terminal preferences using navigation renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="terminal-preferences-page"
|
||||
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`preferences - navigation using application menu renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -10,6 +20,16 @@ exports[`preferences - navigation using application menu renders 1`] = `
|
||||
|
||||
exports[`preferences - navigation using application menu when navigating to preferences using application menu renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
|
||||
@ -3,6 +3,16 @@
|
||||
exports[`show-about-using-tray renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -13,6 +23,16 @@ exports[`show-about-using-tray renders 1`] = `
|
||||
exports[`show-about-using-tray when navigating using tray renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="SettingLayout showNavigation Preferences"
|
||||
data-testid="application-preferences-page"
|
||||
|
||||
@ -8,7 +8,7 @@ import type { RenderResult } from "@testing-library/react";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import currentPathInjectable from "../../renderer/routes/current-path.injectable";
|
||||
import { routeInjectionToken } from "../../common/front-end-routing/route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../common/front-end-routing/front-end-route-injection-token";
|
||||
import { computed } from "mobx";
|
||||
import { preferenceNavigationItemInjectionToken } from "../../renderer/components/+preferences/preferences-navigation/preference-navigation-items.injectable";
|
||||
import routeIsActiveInjectable from "../../renderer/routes/route-is-active.injectable";
|
||||
@ -202,7 +202,7 @@ const testPreferencesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
const testPreferencesRouteComponentInjectable = getInjectable({
|
||||
@ -225,7 +225,7 @@ const testFrontPageRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
const testFrontPageRouteComponentInjectable = getInjectable({
|
||||
@ -250,6 +250,7 @@ const testNavigationItemInjectable = getInjectable({
|
||||
return {
|
||||
id: "some-test-preference-navigation-item-id",
|
||||
label: "Some preference navigation item",
|
||||
parent: "general",
|
||||
isActive: routeIsActive,
|
||||
isVisible: testRoute.isEnabled,
|
||||
navigate: navigateToPreferenceTab(testRoute),
|
||||
|
||||
@ -6,8 +6,13 @@ import type { RenderResult } from "@testing-library/react";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import React from "react";
|
||||
import type { FakeExtensionData } from "../../renderer/components/test-utils/get-renderer-extension-fake";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import type { FakeExtensionData, TestExtension } from "../../renderer/components/test-utils/get-renderer-extension-fake";
|
||||
import { getRendererExtensionFakeFor } from "../../renderer/components/test-utils/get-renderer-extension-fake";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import { getDiForUnitTesting } from "../../renderer/getDiForUnitTesting";
|
||||
import extensionPreferencesRouteInjectable from "../../common/front-end-routing/routes/preferences/extension/extension-preferences-route.injectable";
|
||||
|
||||
|
||||
describe("preferences - navigation to extension specific preferences", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
@ -43,12 +48,67 @@ describe("preferences - navigation to extension specific preferences", () => {
|
||||
expect(actual).toBeNull();
|
||||
});
|
||||
|
||||
describe("given multiple extensions with specific preferences, when navigating to extension specific preferences page", () => {
|
||||
beforeEach(async () => {
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const someTestExtension = getRendererExtensionFake(extensionStubWithExtensionSpecificPreferenceItems);
|
||||
const someOtherTestExtension = getRendererExtensionFake(someOtherExtensionStubWithExtensionSpecificPreferenceItems);
|
||||
|
||||
await applicationBuilder.extensions.renderer.enable(someTestExtension, someOtherTestExtension);
|
||||
applicationBuilder.preferences.navigation.click("extension-some-test-extension-id");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("doesn't show preferences from unrelated extension", () => {
|
||||
const actual = rendered.queryByTestId("extension-preference-item-for-some-other-preference-item-id");
|
||||
|
||||
expect(actual).toBeNull();
|
||||
});
|
||||
|
||||
it("shows preferences from related extension", () => {
|
||||
const actual = rendered.getByTestId("extension-preference-item-for-some-preference-item-id");
|
||||
|
||||
expect(actual).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("given multiple extensions with and without specific preferences", () => {
|
||||
beforeEach(async () => {
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const someTestExtension = getRendererExtensionFake(extensionStubWithExtensionSpecificPreferenceItems);
|
||||
const extensionWithoutPreferences = getRendererExtensionFake(extensionStubWithoutPreferences);
|
||||
const extensionWithSpecificTab = getRendererExtensionFake(extensionStubWithShowInPreferencesTab);
|
||||
|
||||
await applicationBuilder.extensions.renderer.enable(someTestExtension, extensionWithoutPreferences, extensionWithSpecificTab);
|
||||
});
|
||||
|
||||
it("doesn't show link for extension without preferences", () => {
|
||||
const actual = rendered.queryByTestId("tab-link-for-extension-without-preferences-id");
|
||||
|
||||
expect(actual).toBeNull();
|
||||
});
|
||||
|
||||
it("doesn't show link for preferences intended for a specific tab", () => {
|
||||
const actual = rendered.queryByTestId("tab-link-for-extension-specified-preferences-page-id");
|
||||
|
||||
expect(actual).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when extension with specific preferences is enabled", () => {
|
||||
let testExtension: TestExtension;
|
||||
|
||||
beforeEach(() => {
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const testExtension = getRendererExtensionFake(extensionStubWithExtensionSpecificPreferenceItems);
|
||||
|
||||
applicationBuilder.addExtensions(testExtension);
|
||||
testExtension = getRendererExtensionFake(
|
||||
extensionStubWithExtensionSpecificPreferenceItems,
|
||||
);
|
||||
|
||||
applicationBuilder.extensions.renderer.enable(testExtension);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
@ -56,20 +116,32 @@ describe("preferences - navigation to extension specific preferences", () => {
|
||||
});
|
||||
|
||||
it("shows link for extension preferences", () => {
|
||||
const actual = rendered.getByTestId("tab-link-for-extensions");
|
||||
const actual = rendered.getByTestId("tab-link-for-extension-some-test-extension-id");
|
||||
|
||||
expect(actual).not.toBeNull();
|
||||
});
|
||||
|
||||
it("link should not be active", () => {
|
||||
const actual = rendered.getByTestId("tab-link-for-extension-some-test-extension-id");
|
||||
|
||||
expect(actual).not.toHaveClass("active");
|
||||
});
|
||||
|
||||
describe("when navigating to extension preferences using navigation", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.preferences.navigation.click("extensions");
|
||||
applicationBuilder.preferences.navigation.click("extension-some-test-extension-id");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("shows proper page title", () => {
|
||||
const title = rendered.getByText("some-test-extension-id preferences");
|
||||
|
||||
expect(title).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows extension specific preferences", () => {
|
||||
const page = rendered.getByTestId("extension-preferences-page");
|
||||
|
||||
@ -87,14 +159,234 @@ describe("preferences - navigation to extension specific preferences", () => {
|
||||
|
||||
expect(actual).toBeNull();
|
||||
});
|
||||
|
||||
it("link is active", () => {
|
||||
const actual = rendered.getByTestId("tab-link-for-extension-some-test-extension-id");
|
||||
|
||||
expect(actual).toHaveClass("active");
|
||||
});
|
||||
|
||||
describe("when extension is disabled", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.extensions.renderer.disable(testExtension);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("shows the error message about extension not being present", () => {
|
||||
expect(rendered.getByTestId("error-for-extension-not-being-present")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("when extension is enabled again, does not show the error message anymore", () => {
|
||||
applicationBuilder.extensions.renderer.enable(testExtension);
|
||||
|
||||
expect(rendered.queryByTestId("error-for-extension-not-being-present")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("given extension with registered tab", () => {
|
||||
beforeEach(async () => {
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const extension = getRendererExtensionFake(extensionStubWithWithRegisteredTab);
|
||||
|
||||
await applicationBuilder.extensions.renderer.enable(extension);
|
||||
});
|
||||
|
||||
it("shows extension tab in general area", () => {
|
||||
const actual = rendered.getByTestId("tab-link-for-extension-registered-tab-page-id-nav-item-metrics-extension-tab");
|
||||
|
||||
expect(actual).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("does not show custom settings block", () => {
|
||||
const actual = rendered.queryByTestId("extension-settings");
|
||||
|
||||
expect(actual).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe("when navigating to specific extension tab", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.preferences.navigation.click("extension-registered-tab-page-id-nav-item-metrics-extension-tab");
|
||||
});
|
||||
it("renders", () => {
|
||||
expect(rendered.container).toMatchSnapshot();
|
||||
});
|
||||
it("shows related preferences for this tab", () => {
|
||||
const actual = rendered.getByTestId("metrics-preference-item-hint");
|
||||
|
||||
expect(actual).toBeInTheDocument();
|
||||
});
|
||||
it("does not show unrelated preferences for this tab", () => {
|
||||
const actual = rendered.queryByTestId("survey-preference-item-hint");
|
||||
|
||||
expect(actual).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("given extension with few registered tabs", () => {
|
||||
const tabs = [
|
||||
"tab-link-for-extension-hello-world-tab-page-id-nav-item-hello-extension-tab",
|
||||
"tab-link-for-extension-hello-world-tab-page-id-nav-item-logs-extension-tab",
|
||||
];
|
||||
|
||||
beforeEach(async () => {
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const extension = getRendererExtensionFake(extensionStubWithWithRegisteredTabs);
|
||||
|
||||
await applicationBuilder.extensions.renderer.enable(extension);
|
||||
});
|
||||
|
||||
it.each(tabs)("shows '%s' tab in general area", (tab) => {
|
||||
const tabElement = rendered.getByTestId(tab);
|
||||
|
||||
expect(tabElement).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("given extensions with tabs having same id", () => {
|
||||
beforeEach(async () => {
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const extension = getRendererExtensionFake(extensionStubWithWithRegisteredTab);
|
||||
const otherExtension = getRendererExtensionFake(extensionStubWithWithSameRegisteredTab);
|
||||
|
||||
await applicationBuilder.extensions.renderer.enable(extension, otherExtension);
|
||||
});
|
||||
|
||||
it("shows tab from the first extension", () => {
|
||||
const actual = rendered.getByTestId("tab-link-for-extension-registered-tab-page-id-nav-item-metrics-extension-tab");
|
||||
|
||||
expect(actual).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows tab from the second extension", () => {
|
||||
const actual = rendered.getByTestId("tab-link-for-extension-duplicated-tab-page-id-nav-item-metrics-extension-tab");
|
||||
|
||||
expect(actual).toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe("when navigating to first extension tab", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.preferences.navigation.click("extension-registered-tab-page-id-nav-item-metrics-extension-tab");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("shows related preferences for this tab", () => {
|
||||
const actual = rendered.getByTestId("metrics-preference-item-hint");
|
||||
|
||||
expect(actual).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not show unrelated preferences for this tab", () => {
|
||||
const actual = rendered.queryByTestId("another-metrics-preference-item-hint");
|
||||
|
||||
expect(actual).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when navigating to second extension tab", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.preferences.navigation.click("extension-duplicated-tab-page-id-nav-item-metrics-extension-tab");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("shows related preferences for this tab", () => {
|
||||
const actual = rendered.getByTestId("another-metrics-preference-item-hint");
|
||||
|
||||
expect(actual).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not show unrelated preferences for this tab", () => {
|
||||
const actual = rendered.queryByTestId("metrics-preference-item-hint");
|
||||
|
||||
expect(actual).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("when navigating to extension specific tab", () => {
|
||||
let rendered: RenderResult;
|
||||
let di: DiContainer;
|
||||
|
||||
beforeEach(async () => {
|
||||
di = getDiForUnitTesting({ doGeneralOverrides: true });
|
||||
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const extension = getRendererExtensionFake(extensionStubWithWithSameRegisteredTab);
|
||||
const otherExtension = getRendererExtensionFake(extensionUsingSomeoneElseTab);
|
||||
|
||||
applicationBuilder.beforeRender(() => {
|
||||
const extensionRoute = di.inject(extensionPreferencesRouteInjectable);
|
||||
const params = { parameters: {
|
||||
extensionId: "duplicated-tab-page-id",
|
||||
tabId: "metrics-extension-tab",
|
||||
}};
|
||||
|
||||
applicationBuilder.preferences.navigateTo(extensionRoute, params);
|
||||
});
|
||||
|
||||
await applicationBuilder.extensions.renderer.enable(extension, otherExtension);
|
||||
rendered = await applicationBuilder.render();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("does render related preferences for specific tab", () => {
|
||||
expect(rendered.getByTestId("another-metrics-preference-item-hint")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not render related preferences for specific tab", () => {
|
||||
expect(rendered.queryByTestId("my-preferences-item-hint")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when navigating to someone else extension specific tab", () => {
|
||||
let rendered: RenderResult;
|
||||
let di: DiContainer;
|
||||
|
||||
beforeEach(async () => {
|
||||
di = getDiForUnitTesting({ doGeneralOverrides: true });
|
||||
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const extension = getRendererExtensionFake(extensionStubWithWithSameRegisteredTab);
|
||||
const extensionUsingOtherTab = getRendererExtensionFake(extensionUsingSomeoneElseTab);
|
||||
|
||||
applicationBuilder.beforeRender(() => {
|
||||
const extensionRoute = di.inject(extensionPreferencesRouteInjectable);
|
||||
const params = { parameters: {
|
||||
extensionId: "extension-using-someone-else-tab-id",
|
||||
tabId: "metrics-extension-tab",
|
||||
}};
|
||||
|
||||
applicationBuilder.preferences.navigateTo(extensionRoute, params);
|
||||
});
|
||||
|
||||
await applicationBuilder.extensions.renderer.enable(extension, extensionUsingOtherTab);
|
||||
rendered = await applicationBuilder.render();
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
expect(rendered.container).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const extensionStubWithExtensionSpecificPreferenceItems: FakeExtensionData = {
|
||||
id: "some-extension-id",
|
||||
name: "some-extension-name",
|
||||
id: "some-test-extension-id",
|
||||
name: "some-test-extension-id",
|
||||
appPreferences: [
|
||||
{
|
||||
title: "Some preference item",
|
||||
@ -119,3 +411,166 @@ const extensionStubWithExtensionSpecificPreferenceItems: FakeExtensionData = {
|
||||
],
|
||||
};
|
||||
|
||||
const someOtherExtensionStubWithExtensionSpecificPreferenceItems: FakeExtensionData = {
|
||||
id: "some-other-test-extension-id",
|
||||
name: "some-other-test-extension-id",
|
||||
|
||||
appPreferences: [
|
||||
{
|
||||
title: "Test preference item",
|
||||
id: "some-other-preference-item-id",
|
||||
|
||||
components: {
|
||||
Hint: () => <div data-testid="some-other-preference-item-hint" />,
|
||||
Input: () => <div data-testid="some-other-preference-item-input" />,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const extensionStubWithoutPreferences: FakeExtensionData = {
|
||||
id: "without-preferences-id",
|
||||
name: "without-preferences-id",
|
||||
};
|
||||
|
||||
const extensionStubWithShowInPreferencesTab: FakeExtensionData = {
|
||||
id: "specified-preferences-page-id",
|
||||
name: "specified-preferences-page-name",
|
||||
|
||||
appPreferences: [
|
||||
{
|
||||
title: "Test preference item",
|
||||
id: "very-other-preference-item-id",
|
||||
showInPreferencesTab: "some-tab",
|
||||
|
||||
components: {
|
||||
Hint: () => <div data-testid="very-other-preference-item-hint" />,
|
||||
Input: () => <div data-testid="very-other-preference-item-input" />,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const extensionStubWithWithRegisteredTab: FakeExtensionData = {
|
||||
id: "registered-tab-page-id",
|
||||
name: "registered-tab-page-id",
|
||||
|
||||
appPreferences: [
|
||||
{
|
||||
title: "License item",
|
||||
id: "metrics-preference-item-id",
|
||||
showInPreferencesTab: "metrics-extension-tab",
|
||||
|
||||
components: {
|
||||
Hint: () => <div data-testid="metrics-preference-item-hint" />,
|
||||
Input: () => <div data-testid="metrics-preference-item-input" />,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Menu item",
|
||||
id: "menu-preference-item-id",
|
||||
showInPreferencesTab: "menu-extension-tab",
|
||||
|
||||
components: {
|
||||
Hint: () => <div data-testid="menu-preference-item-hint" />,
|
||||
Input: () => <div data-testid="menu-preference-item-input" />,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Survey item",
|
||||
id: "survey-preference-item-id",
|
||||
showInPreferencesTab: "survey-extension-tab",
|
||||
|
||||
components: {
|
||||
Hint: () => <div data-testid="survey-preference-item-hint" />,
|
||||
Input: () => <div data-testid="survey-preference-item-input" />,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
appPreferenceTabs: [{
|
||||
title: "Metrics tab",
|
||||
id: "metrics-extension-tab",
|
||||
orderNumber: 100,
|
||||
}],
|
||||
};
|
||||
|
||||
const extensionStubWithWithRegisteredTabs: FakeExtensionData = {
|
||||
id: "hello-world-tab-page-id",
|
||||
name: "hello-world-tab-page-id",
|
||||
|
||||
appPreferences: [
|
||||
{
|
||||
title: "Hello world",
|
||||
id: "hello-preference-item-id",
|
||||
showInPreferencesTab: "hello-extension-tab",
|
||||
|
||||
components: {
|
||||
Hint: () => <div data-testid="hello-preference-item-hint" />,
|
||||
Input: () => <div data-testid="hello-preference-item-input" />,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Logs",
|
||||
id: "logs-preference-item-id",
|
||||
showInPreferencesTab: "logs-extension-tab",
|
||||
|
||||
components: {
|
||||
Hint: () => <div data-testid="logs-preference-item-hint" />,
|
||||
Input: () => <div data-testid="logs-preference-item-input" />,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
appPreferenceTabs: [{
|
||||
title: "Metrics tab",
|
||||
id: "hello-extension-tab",
|
||||
orderNumber: 100,
|
||||
}, {
|
||||
title: "Logs tab",
|
||||
id: "logs-extension-tab",
|
||||
orderNumber: 200,
|
||||
}],
|
||||
};
|
||||
|
||||
const extensionStubWithWithSameRegisteredTab: FakeExtensionData = {
|
||||
id: "duplicated-tab-page-id",
|
||||
name: "duplicated-tab-page-id",
|
||||
|
||||
appPreferences: [
|
||||
{
|
||||
title: "Another metrics",
|
||||
id: "another-metrics-preference-item-id",
|
||||
showInPreferencesTab: "metrics-extension-tab",
|
||||
|
||||
components: {
|
||||
Hint: () => <div data-testid="another-metrics-preference-item-hint" />,
|
||||
Input: () => <div data-testid="another-metrics-preference-item-input" />,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
appPreferenceTabs: [{
|
||||
title: "Metrics tab",
|
||||
id: "metrics-extension-tab",
|
||||
orderNumber: 100,
|
||||
}],
|
||||
};
|
||||
|
||||
const extensionUsingSomeoneElseTab: FakeExtensionData = {
|
||||
id: "extension-using-someone-else-tab-id",
|
||||
name: "extension-using-someone-else-tab-id",
|
||||
|
||||
appPreferences: [
|
||||
{
|
||||
title: "My preferences",
|
||||
id: "my-preferences-item-id",
|
||||
showInPreferencesTab: "metrics-extension-tab",
|
||||
|
||||
components: {
|
||||
Hint: () => <div data-testid="my-preferences-item-hint" />,
|
||||
Input: () => <div data-testid="my-preferences-item-input" />,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import callForPublicHelmRepositoriesInjectable from "../../renderer/components/+preferences/kubernetes/helm-charts/adding-of-public-helm-repository/public-helm-repositories/call-for-public-helm-repositories.injectable";
|
||||
import getActiveHelmRepositoriesInjectable from "../../main/helm/repositories/get-active-helm-repositories/get-active-helm-repositories.injectable";
|
||||
|
||||
describe("preferences - navigation to kubernetes preferences", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
@ -17,6 +19,15 @@ describe("preferences - navigation to kubernetes preferences", () => {
|
||||
let rendered: RenderResult;
|
||||
|
||||
beforeEach(async () => {
|
||||
applicationBuilder.beforeApplicationStart(({ rendererDi, mainDi }) => {
|
||||
rendererDi.override(callForPublicHelmRepositoriesInjectable, () => async () => []);
|
||||
|
||||
mainDi.override(
|
||||
getActiveHelmRepositoriesInjectable,
|
||||
() => async () => ({ callWasSuccessful: true, response: [] }),
|
||||
);
|
||||
});
|
||||
|
||||
applicationBuilder.beforeRender(() => {
|
||||
applicationBuilder.preferences.navigate();
|
||||
});
|
||||
|
||||
@ -50,7 +50,7 @@ describe("preferences - navigation to telemetry preferences", () => {
|
||||
const getRendererExtensionFake = getRendererExtensionFakeFor(applicationBuilder);
|
||||
const testExtensionWithTelemetryPreferenceItems = getRendererExtensionFake(extensionStubWithTelemetryPreferenceItems);
|
||||
|
||||
applicationBuilder.addExtensions(
|
||||
applicationBuilder.extensions.renderer.enable(
|
||||
testExtensionWithTelemetryPreferenceItems,
|
||||
);
|
||||
});
|
||||
@ -105,7 +105,7 @@ describe("preferences - navigation to telemetry preferences", () => {
|
||||
],
|
||||
});
|
||||
|
||||
applicationBuilder.addExtensions(
|
||||
applicationBuilder.extensions.renderer.enable(
|
||||
testExtensionWithTelemetryPreferenceItems,
|
||||
);
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ describe("preferences - navigation using application menu", () => {
|
||||
});
|
||||
|
||||
describe("when navigating to preferences using application menu", () => {
|
||||
beforeEach(async () => {
|
||||
await applicationBuilder.applicationMenu.click("root.preferences");
|
||||
beforeEach(() => {
|
||||
applicationBuilder.applicationMenu.click("root.preferences");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
|
||||
@ -0,0 +1,238 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { lensWindowInjectionToken } from "../../main/start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import applicationWindowInjectable from "../../main/start-main-application/lens-window/application-window/application-window.injectable";
|
||||
import createElectronWindowForInjectable from "../../main/start-main-application/lens-window/application-window/create-electron-window.injectable";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import type { ElectronWindow, LensWindowConfiguration } from "../../main/start-main-application/lens-window/application-window/create-lens-window.injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import lensResourcesDirInjectable from "../../common/vars/lens-resources-dir.injectable";
|
||||
|
||||
describe("opening application window using tray", () => {
|
||||
describe("given application has started", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
let createElectronWindowMock: jest.Mock;
|
||||
let expectWindowsToBeOpen: (windowIds: string[]) => void;
|
||||
let callForSplashWindowHtmlMock: AsyncFnMock<() => void>;
|
||||
let callForApplicationWindowHtmlMock: AsyncFnMock<() => void>;
|
||||
|
||||
beforeEach(async () => {
|
||||
callForSplashWindowHtmlMock = asyncFn();
|
||||
callForApplicationWindowHtmlMock = asyncFn();
|
||||
|
||||
applicationBuilder = getApplicationBuilder().beforeApplicationStart(
|
||||
({ mainDi }) => {
|
||||
mainDi.override(lensResourcesDirInjectable, () => "some-lens-resources-directory");
|
||||
|
||||
const loadFileMock = jest
|
||||
.fn(callForSplashWindowHtmlMock)
|
||||
.mockImplementationOnce(() => Promise.resolve());
|
||||
|
||||
const loadUrlMock = jest
|
||||
.fn(callForApplicationWindowHtmlMock)
|
||||
.mockImplementationOnce(() => Promise.resolve());
|
||||
|
||||
createElectronWindowMock = jest.fn((configuration: LensWindowConfiguration) =>
|
||||
({
|
||||
splash: {
|
||||
send: () => {},
|
||||
close: () => {},
|
||||
show: () => {},
|
||||
loadFile: loadFileMock,
|
||||
loadUrl: () => { throw new Error("Should never come here"); },
|
||||
},
|
||||
|
||||
"only-application-window": {
|
||||
send: () => {},
|
||||
close: () => {},
|
||||
show: () => {},
|
||||
loadFile: () => { throw new Error("Should never come here"); },
|
||||
loadUrl: loadUrlMock,
|
||||
},
|
||||
}[configuration.id] as ElectronWindow));
|
||||
|
||||
mainDi.override(
|
||||
createElectronWindowForInjectable,
|
||||
|
||||
() => createElectronWindowMock,
|
||||
);
|
||||
|
||||
expectWindowsToBeOpen = expectWindowsToBeOpenFor(mainDi);
|
||||
},
|
||||
);
|
||||
|
||||
await applicationBuilder.render();
|
||||
});
|
||||
|
||||
it("only an application window is open", () => {
|
||||
expectWindowsToBeOpen(["only-application-window"]);
|
||||
});
|
||||
|
||||
describe("when an attempt to reopen the already started application is made using tray", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.tray.click("open-app");
|
||||
});
|
||||
|
||||
it("still shows only the application window", () => {
|
||||
expectWindowsToBeOpen(["only-application-window"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the application window is closed", () => {
|
||||
beforeEach(() => {
|
||||
const applicationWindow = applicationBuilder.dis.mainDi.inject(
|
||||
applicationWindowInjectable,
|
||||
);
|
||||
|
||||
applicationWindow.close();
|
||||
});
|
||||
|
||||
it("no windows are open", () => {
|
||||
expectWindowsToBeOpen([]);
|
||||
});
|
||||
|
||||
describe("when an application window is reopened using tray", () => {
|
||||
beforeEach(() => {
|
||||
callForSplashWindowHtmlMock.mockClear();
|
||||
callForApplicationWindowHtmlMock.mockClear();
|
||||
|
||||
applicationBuilder.tray.click("open-app");
|
||||
});
|
||||
|
||||
it("still no windows are open", () => {
|
||||
expectWindowsToBeOpen([]);
|
||||
});
|
||||
|
||||
it("starts loading static HTML of splash window", () => {
|
||||
expect(callForSplashWindowHtmlMock).toHaveBeenCalledWith("/some-absolute-root-directory/some-lens-resources-directory/static/splash.html");
|
||||
});
|
||||
|
||||
describe("when loading of splash window HTML resolves", () => {
|
||||
beforeEach(async () => {
|
||||
await callForSplashWindowHtmlMock.resolve();
|
||||
});
|
||||
|
||||
it("shows just the splash window", () => {
|
||||
expectWindowsToBeOpen(["splash"]);
|
||||
});
|
||||
|
||||
it("starts loading of content for the application window", () => {
|
||||
expect(callForApplicationWindowHtmlMock).toHaveBeenCalledWith("http://localhost:42");
|
||||
});
|
||||
|
||||
describe("given static HTML of application window has not resolved yet, when opening from tray again", () => {
|
||||
beforeEach(() => {
|
||||
callForApplicationWindowHtmlMock.mockClear();
|
||||
callForSplashWindowHtmlMock.mockClear();
|
||||
|
||||
applicationBuilder.tray.click("open-app");
|
||||
});
|
||||
|
||||
it("does not load contents of splash window again", () => {
|
||||
expect(callForSplashWindowHtmlMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not load contents of application window again", () => {
|
||||
expect(callForApplicationWindowHtmlMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("shows just the blank application window to permit developer tool access", () => {
|
||||
expectWindowsToBeOpen(["only-application-window"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when static HTML of application window resolves", () => {
|
||||
beforeEach(async () => {
|
||||
await callForApplicationWindowHtmlMock.resolve();
|
||||
});
|
||||
|
||||
it("shows just the application window", () => {
|
||||
expectWindowsToBeOpen(["only-application-window"]);
|
||||
});
|
||||
|
||||
describe("when reopening the application using tray", () => {
|
||||
beforeEach(() => {
|
||||
callForSplashWindowHtmlMock.mockClear();
|
||||
callForApplicationWindowHtmlMock.mockClear();
|
||||
|
||||
applicationBuilder.tray.click("open-app");
|
||||
});
|
||||
|
||||
it("still shows just the application window", () => {
|
||||
expectWindowsToBeOpen(["only-application-window"]);
|
||||
});
|
||||
|
||||
it("does not load HTML for splash window again", () => {
|
||||
expect(callForSplashWindowHtmlMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not load HTML for application window again", () => {
|
||||
expect(callForApplicationWindowHtmlMock).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("given opening of splash window has not finished yet, but another attempt to open the application is made", () => {
|
||||
beforeEach(() => {
|
||||
createElectronWindowMock.mockClear();
|
||||
|
||||
applicationBuilder.tray.click("open-app");
|
||||
});
|
||||
|
||||
it("does not open any new windows", () => {
|
||||
expect(createElectronWindowMock).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when opening of splash window resolves", () => {
|
||||
beforeEach(async () => {
|
||||
await callForSplashWindowHtmlMock.resolve();
|
||||
});
|
||||
|
||||
it("still only splash window is open", () => {
|
||||
expectWindowsToBeOpen(["splash"]);
|
||||
});
|
||||
|
||||
it("when opening of application window finishes, only an application window is open", async () => {
|
||||
await callForApplicationWindowHtmlMock.resolve();
|
||||
|
||||
expectWindowsToBeOpen(["only-application-window"]);
|
||||
});
|
||||
|
||||
describe("given opening of application window has not finished yet, but another attempt to open the application is made", () => {
|
||||
beforeEach(() => {
|
||||
createElectronWindowMock.mockClear();
|
||||
|
||||
applicationBuilder.tray.click("open-app");
|
||||
});
|
||||
|
||||
it("does not open any new windows", () => {
|
||||
expect(createElectronWindowMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("when opening finishes, only an application window is open", async () => {
|
||||
await callForApplicationWindowHtmlMock.resolve();
|
||||
|
||||
expectWindowsToBeOpen(["only-application-window"]);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const expectWindowsToBeOpenFor = (di: DiContainer) => (windowIds: string[]) => {
|
||||
const windows = di.injectMany(lensWindowInjectionToken);
|
||||
|
||||
expect(
|
||||
windows.filter((window) => window.isVisible).map((window) => window.id),
|
||||
).toEqual(windowIds);
|
||||
};
|
||||
@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import type { ClusterManager } from "../../main/cluster-manager";
|
||||
import { lensWindowInjectionToken } from "../../main/start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import exitAppInjectable from "../../main/electron-app/features/exit-app.injectable";
|
||||
import clusterManagerInjectable from "../../main/cluster-manager.injectable";
|
||||
import stopServicesAndExitAppInjectable from "../../main/stop-services-and-exit-app.injectable";
|
||||
|
||||
describe("quitting the app using application menu", () => {
|
||||
describe("given application has started", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
let clusterManagerStub: ClusterManager;
|
||||
let exitAppMock: jest.Mock;
|
||||
|
||||
beforeEach(async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
applicationBuilder = getApplicationBuilder().beforeApplicationStart(
|
||||
({ mainDi }) => {
|
||||
mainDi.unoverride(stopServicesAndExitAppInjectable);
|
||||
|
||||
clusterManagerStub = { stop: jest.fn() } as unknown as ClusterManager;
|
||||
mainDi.override(clusterManagerInjectable, () => clusterManagerStub);
|
||||
|
||||
exitAppMock = jest.fn();
|
||||
mainDi.override(exitAppInjectable, () => exitAppMock);
|
||||
},
|
||||
);
|
||||
|
||||
await applicationBuilder.render();
|
||||
});
|
||||
|
||||
it("only an application window is open", () => {
|
||||
const windows = applicationBuilder.dis.mainDi.injectMany(
|
||||
lensWindowInjectionToken,
|
||||
);
|
||||
|
||||
expect(
|
||||
windows.map((window) => ({ id: window.id, visible: window.isVisible })),
|
||||
).toEqual([
|
||||
{ id: "only-application-window", visible: true },
|
||||
{ id: "splash", visible: false },
|
||||
]);
|
||||
});
|
||||
|
||||
describe("when application is quit", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.applicationMenu.click("root.quit");
|
||||
});
|
||||
|
||||
it("closes all windows", () => {
|
||||
const windows = applicationBuilder.dis.mainDi.injectMany(
|
||||
lensWindowInjectionToken,
|
||||
);
|
||||
|
||||
expect(
|
||||
windows.map((window) => ({ id: window.id, visible: window.isVisible })),
|
||||
).toEqual([
|
||||
{ id: "only-application-window", visible: false },
|
||||
{ id: "splash", visible: false },
|
||||
]);
|
||||
});
|
||||
|
||||
it("disconnects all clusters", () => {
|
||||
expect(clusterManagerStub.stop).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("after insufficient time passes, does not terminate application yet", () => {
|
||||
jest.advanceTimersByTime(999);
|
||||
|
||||
expect(exitAppMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("after sufficient time passes", () => {
|
||||
beforeEach(() => {
|
||||
jest.advanceTimersByTime(1000);
|
||||
});
|
||||
|
||||
it("terminates application", () => {
|
||||
expect(exitAppMock).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,85 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import type { ResolveSystemProxy } from "../../common/utils/resolve-system-proxy/resolve-system-proxy-injection-token";
|
||||
import { resolveSystemProxyInjectionToken } from "../../common/utils/resolve-system-proxy/resolve-system-proxy-injection-token";
|
||||
import resolveSystemProxyFromElectronInjectable from "../../main/utils/resolve-system-proxy/resolve-system-proxy-from-electron.injectable";
|
||||
import { getPromiseStatus } from "../../common/test-utils/get-promise-status";
|
||||
|
||||
describe("resolve-system-proxy", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
let actualPromise: Promise<string>;
|
||||
let resolveSystemProxyFromElectronMock: AsyncFnMock<ResolveSystemProxy>;
|
||||
|
||||
beforeEach(async () => {
|
||||
applicationBuilder = getApplicationBuilder();
|
||||
|
||||
resolveSystemProxyFromElectronMock = asyncFn();
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ mainDi }) => {
|
||||
mainDi.override(
|
||||
resolveSystemProxyFromElectronInjectable,
|
||||
() => resolveSystemProxyFromElectronMock,
|
||||
);
|
||||
});
|
||||
|
||||
await applicationBuilder.render();
|
||||
});
|
||||
|
||||
describe("given in main, when called with URL", () => {
|
||||
beforeEach(async () => {
|
||||
const resolveSystemProxyInMain = applicationBuilder.dis.mainDi.inject(
|
||||
resolveSystemProxyInjectionToken,
|
||||
);
|
||||
|
||||
actualPromise = resolveSystemProxyInMain("some-url");
|
||||
});
|
||||
|
||||
it("calls for proxy of the URL from Electron", () => {
|
||||
expect(resolveSystemProxyFromElectronMock).toHaveBeenCalledWith("some-url");
|
||||
});
|
||||
|
||||
it("does not resolve yet", async () => {
|
||||
const promiseStatus = await getPromiseStatus(actualPromise);
|
||||
|
||||
expect(promiseStatus.fulfilled).toBe(false);
|
||||
});
|
||||
|
||||
it("when the call for proxy resolves, resolves with the proxy", async () => {
|
||||
resolveSystemProxyFromElectronMock.resolve("some-proxy");
|
||||
|
||||
expect(await actualPromise).toBe("some-proxy");
|
||||
});
|
||||
});
|
||||
|
||||
describe("given in renderer, when called with URL", () => {
|
||||
beforeEach(async () => {
|
||||
const resolveSystemProxyInRenderer = applicationBuilder.dis.rendererDi.inject(
|
||||
resolveSystemProxyInjectionToken,
|
||||
);
|
||||
|
||||
actualPromise = resolveSystemProxyInRenderer("some-url");
|
||||
});
|
||||
|
||||
it("calls for proxy of the URL from Electron", () => {
|
||||
expect(resolveSystemProxyFromElectronMock).toHaveBeenCalledWith("some-url");
|
||||
});
|
||||
|
||||
it("does not resolve yet", async () => {
|
||||
const promiseStatus = await getPromiseStatus(actualPromise);
|
||||
|
||||
expect(promiseStatus.fulfilled).toBe(false);
|
||||
});
|
||||
|
||||
it("when the call for proxy resolves, resolves with the proxy", async () => {
|
||||
resolveSystemProxyFromElectronMock.resolve("some-proxy");
|
||||
|
||||
expect(await actualPromise).toBe("some-proxy");
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,132 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { LensMainExtension } from "../../extensions/lens-main-extension";
|
||||
import type { TrayMenuRegistration } from "../../main/tray/tray-menu-registration";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import loggerInjectable from "../../common/logger.injectable";
|
||||
import type { Logger } from "../../common/logger";
|
||||
|
||||
describe("clicking tray menu item originating from extension", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
let logErrorMock: jest.Mock;
|
||||
|
||||
beforeEach(async () => {
|
||||
applicationBuilder = getApplicationBuilder();
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ mainDi }) => {
|
||||
logErrorMock = jest.fn();
|
||||
|
||||
mainDi.override(loggerInjectable, () => ({ error: logErrorMock }) as unknown as Logger);
|
||||
});
|
||||
|
||||
await applicationBuilder.render();
|
||||
});
|
||||
|
||||
describe("when extension is enabled", () => {
|
||||
let someExtension: SomeTestExtension;
|
||||
let clickMock: jest.Mock;
|
||||
|
||||
beforeEach(() => {
|
||||
clickMock = jest.fn();
|
||||
|
||||
someExtension = new SomeTestExtension({
|
||||
id: "some-extension-id",
|
||||
trayMenus: [{ label: "some-label", click: clickMock }],
|
||||
});
|
||||
|
||||
applicationBuilder.extensions.main.enable(someExtension);
|
||||
});
|
||||
|
||||
it("when item is clicked, triggers the click handler", () => {
|
||||
applicationBuilder.tray.click(
|
||||
"some-label-tray-menu-item-for-extension-some-extension-id",
|
||||
);
|
||||
|
||||
expect(clickMock).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("given click handler throws synchronously, when item is clicked", () => {
|
||||
beforeEach(() => {
|
||||
clickMock.mockImplementation(() => {
|
||||
throw new Error("some-error");
|
||||
});
|
||||
|
||||
applicationBuilder.tray.click(
|
||||
"some-label-tray-menu-item-for-extension-some-extension-id",
|
||||
);
|
||||
});
|
||||
|
||||
it("logs the error", () => {
|
||||
expect(logErrorMock).toHaveBeenCalledWith(
|
||||
'[TRAY]: Clicking of tray item "some-label" from extension "some-extension-id" failed.',
|
||||
expect.any(Error),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("given click handler rejects asynchronously, when item is clicked", () => {
|
||||
beforeEach(() => {
|
||||
clickMock.mockImplementation(() => Promise.reject("some-rejection"));
|
||||
|
||||
applicationBuilder.tray.click(
|
||||
"some-label-tray-menu-item-for-extension-some-extension-id",
|
||||
);
|
||||
});
|
||||
|
||||
it("logs the error", () => {
|
||||
expect(logErrorMock).toHaveBeenCalledWith(
|
||||
'[TRAY]: Clicking of tray item "some-label" from extension "some-extension-id" failed.',
|
||||
"some-rejection",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when extension is disabled", () => {
|
||||
beforeEach(() => {
|
||||
applicationBuilder.extensions.main.disable(someExtension);
|
||||
});
|
||||
|
||||
it("does not have the tray menu item from extension", () => {
|
||||
expect(
|
||||
applicationBuilder.tray.get(
|
||||
"some-label-tray-menu-item-for-extension-some-extension-id",
|
||||
),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
// Note: Motivation here is to make sure that enabling same extension does not throw
|
||||
it("when extension is re-enabled, has the tray menu item from extension", async () => {
|
||||
await applicationBuilder.extensions.main.enable(someExtension);
|
||||
|
||||
expect(
|
||||
applicationBuilder.tray.get(
|
||||
"some-label-tray-menu-item-for-extension-some-extension-id",
|
||||
),
|
||||
).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
class SomeTestExtension extends LensMainExtension {
|
||||
constructor({ id, trayMenus }: {
|
||||
id: string;
|
||||
trayMenus: TrayMenuRegistration[];
|
||||
}) {
|
||||
super({
|
||||
id,
|
||||
absolutePath: "irrelevant",
|
||||
isBundled: false,
|
||||
isCompatible: false,
|
||||
isEnabled: false,
|
||||
manifest: { name: id, version: "some-version", engines: { lens: "^5.5.0" }},
|
||||
manifestPath: "irrelevant",
|
||||
});
|
||||
|
||||
this.trayMenus = trayMenus;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { LensMainExtension } from "../../extensions/lens-main-extension";
|
||||
import type { TrayMenuRegistration } from "../../main/tray/tray-menu-registration";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import getRandomIdInjectable from "../../common/utils/get-random-id.injectable";
|
||||
|
||||
describe("multiple separators originating from extension", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
|
||||
beforeEach(async () => {
|
||||
applicationBuilder = getApplicationBuilder();
|
||||
|
||||
applicationBuilder.beforeApplicationStart(({ mainDi }) => {
|
||||
mainDi.unoverride(getRandomIdInjectable);
|
||||
mainDi.permitSideEffects(getRandomIdInjectable);
|
||||
});
|
||||
|
||||
await applicationBuilder.render();
|
||||
});
|
||||
|
||||
it("given extension with multiple separators, when extension is enabled, does not throw", () => {
|
||||
const someExtension = new SomeTestExtension({
|
||||
id: "some-extension-id",
|
||||
trayMenus: [{ type: "separator" }, { type: "separator" } ],
|
||||
});
|
||||
|
||||
expect(() => {
|
||||
applicationBuilder.extensions.main.enable(someExtension);
|
||||
}).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
class SomeTestExtension extends LensMainExtension {
|
||||
constructor({ id, trayMenus }: {
|
||||
id: string;
|
||||
trayMenus: TrayMenuRegistration[];
|
||||
}) {
|
||||
super({
|
||||
id,
|
||||
absolutePath: "irrelevant",
|
||||
isBundled: false,
|
||||
isCompatible: false,
|
||||
isEnabled: false,
|
||||
manifest: { name: id, version: "some-version", engines: { lens: "^5.5.0" }},
|
||||
manifestPath: "irrelevant",
|
||||
});
|
||||
|
||||
this.trayMenus = trayMenus;
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
|
||||
export function getSidebarItem(rendered: RenderResult, itemId: string) {
|
||||
return rendered
|
||||
.queryAllByTestId("sidebar-item")
|
||||
.find((x) => x.dataset.idTest === itemId);
|
||||
}
|
||||
@ -2,6 +2,16 @@
|
||||
|
||||
exports[`welcome - navigation using application menu renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="Notifications flex column align-flex-end"
|
||||
/>
|
||||
@ -10,6 +20,16 @@ exports[`welcome - navigation using application menu renders 1`] = `
|
||||
|
||||
exports[`welcome - navigation using application menu when navigating to welcome using application menu renders 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="StatusBar"
|
||||
>
|
||||
<div
|
||||
class="leftSide"
|
||||
/>
|
||||
<div
|
||||
class="rightSide"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="flex justify-center Welcome align-center"
|
||||
data-testid="welcome-page"
|
||||
|
||||
@ -28,8 +28,8 @@ describe("welcome - navigation using application menu", () => {
|
||||
});
|
||||
|
||||
describe("when navigating to welcome using application menu", () => {
|
||||
beforeEach(async () => {
|
||||
await applicationBuilder.applicationMenu.click("help.welcome");
|
||||
beforeEach(() => {
|
||||
applicationBuilder.applicationMenu.click("help.welcome");
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
|
||||
@ -7,14 +7,13 @@ import fs from "fs";
|
||||
import mockFs from "mock-fs";
|
||||
import path from "path";
|
||||
import fse from "fs-extra";
|
||||
import type { Cluster } from "../cluster/cluster";
|
||||
import type { ClusterStore } from "../cluster-store/cluster-store";
|
||||
import { Console } from "console";
|
||||
import { stdout, stderr } from "process";
|
||||
import getCustomKubeConfigDirectoryInjectable from "../app-paths/get-custom-kube-config-directory/get-custom-kube-config-directory.injectable";
|
||||
import clusterStoreInjectable from "../cluster-store/cluster-store.injectable";
|
||||
import type { ClusterModel } from "../cluster-types";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import type { CreateCluster } from "../cluster/create-cluster-injection-token";
|
||||
import { createClusterInjectionToken } from "../cluster/create-cluster-injection-token";
|
||||
import directoryForUserDataInjectable from "../app-paths/directory-for-user-data/directory-for-user-data.injectable";
|
||||
import { getDiForUnitTesting } from "../../main/getDiForUnitTesting";
|
||||
@ -25,17 +24,19 @@ import directoryForTempInjectable from "../app-paths/directory-for-temp/director
|
||||
import kubectlBinaryNameInjectable from "../../main/kubectl/binary-name.injectable";
|
||||
import kubectlDownloadingNormalizedArchInjectable from "../../main/kubectl/normalized-arch.injectable";
|
||||
import normalizedPlatformInjectable from "../vars/normalized-platform.injectable";
|
||||
import fsInjectable from "../fs/fs.injectable";
|
||||
|
||||
console = new Console(stdout, stderr);
|
||||
|
||||
const testDataIcon = fs.readFileSync(
|
||||
"test-data/cluster-store-migration-icon.png",
|
||||
);
|
||||
const clusterServerUrl = "https://localhost";
|
||||
const kubeconfig = `
|
||||
apiVersion: v1
|
||||
clusters:
|
||||
- cluster:
|
||||
server: https://localhost
|
||||
server: ${clusterServerUrl}
|
||||
name: test
|
||||
contexts:
|
||||
- context:
|
||||
@ -78,7 +79,7 @@ jest.mock("electron", () => ({
|
||||
describe("cluster-store", () => {
|
||||
let mainDi: DiContainer;
|
||||
let clusterStore: ClusterStore;
|
||||
let createCluster: (model: ClusterModel) => Cluster;
|
||||
let createCluster: CreateCluster;
|
||||
|
||||
beforeEach(async () => {
|
||||
mainDi = getDiForUnitTesting({ doGeneralOverrides: true });
|
||||
@ -94,6 +95,7 @@ describe("cluster-store", () => {
|
||||
mainDi.permitSideEffects(getConfigurationFileModelInjectable);
|
||||
mainDi.permitSideEffects(appVersionInjectable);
|
||||
mainDi.permitSideEffects(clusterStoreInjectable);
|
||||
mainDi.permitSideEffects(fsInjectable);
|
||||
|
||||
mainDi.unoverride(clusterStoreInjectable);
|
||||
});
|
||||
@ -143,6 +145,8 @@ describe("cluster-store", () => {
|
||||
getCustomKubeConfigDirectory("foo"),
|
||||
kubeconfig,
|
||||
),
|
||||
}, {
|
||||
clusterServerUrl,
|
||||
});
|
||||
|
||||
clusterStore.addCluster(cluster);
|
||||
|
||||
@ -78,12 +78,12 @@ describe("kube helpers", () => {
|
||||
describe("with default validation options", () => {
|
||||
describe("with valid kubeconfig", () => {
|
||||
it("does not return an error", () => {
|
||||
expect(validateKubeConfig(kc, "valid")).toBeUndefined();
|
||||
expect(validateKubeConfig(kc, "valid")).toBeDefined();
|
||||
});
|
||||
});
|
||||
describe("with invalid context object", () => {
|
||||
it("returns an error", () => {
|
||||
expect(String(validateKubeConfig(kc, "invalid"))).toEqual(
|
||||
expect(validateKubeConfig(kc, "invalid").error?.toString()).toEqual(
|
||||
expect.stringContaining("No valid context object provided in kubeconfig for context 'invalid'"),
|
||||
);
|
||||
});
|
||||
@ -91,7 +91,7 @@ describe("kube helpers", () => {
|
||||
|
||||
describe("with invalid cluster object", () => {
|
||||
it("returns an error", () => {
|
||||
expect(String(validateKubeConfig(kc, "invalidCluster"))).toEqual(
|
||||
expect(validateKubeConfig(kc, "invalidCluster").error?.toString()).toEqual(
|
||||
expect.stringContaining("No valid cluster object provided in kubeconfig for context 'invalidCluster'"),
|
||||
);
|
||||
});
|
||||
@ -99,7 +99,7 @@ describe("kube helpers", () => {
|
||||
|
||||
describe("with invalid user object", () => {
|
||||
it("returns an error", () => {
|
||||
expect(String(validateKubeConfig(kc, "invalidUser"))).toEqual(
|
||||
expect(validateKubeConfig(kc, "invalidUser").error?.toString()).toEqual(
|
||||
expect.stringContaining("No valid user object provided in kubeconfig for context 'invalidUser'"),
|
||||
);
|
||||
});
|
||||
|
||||
13
src/common/app-event-bus/emit-event.injectable.ts
Normal file
13
src/common/app-event-bus/emit-event.injectable.ts
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import appEventBusInjectable from "./app-event-bus.injectable";
|
||||
|
||||
const emitEventInjectable = getInjectable({
|
||||
id: "emit-event",
|
||||
instantiate: (di) => di.inject(appEventBusInjectable).emit,
|
||||
});
|
||||
|
||||
export default emitEventInjectable;
|
||||
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { IComputedValue } from "mobx";
|
||||
|
||||
export const allowedResourcesInjectionToken = getInjectionToken<
|
||||
IComputedValue<Set<string>>
|
||||
>({
|
||||
id: "allowed-resources",
|
||||
});
|
||||
@ -5,6 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { ClusterStore } from "./cluster-store";
|
||||
import { createClusterInjectionToken } from "../cluster/create-cluster-injection-token";
|
||||
import readClusterConfigSyncInjectable from "./read-cluster-config.injectable";
|
||||
|
||||
const clusterStoreInjectable = getInjectable({
|
||||
id: "cluster-store",
|
||||
@ -14,6 +15,7 @@ const clusterStoreInjectable = getInjectable({
|
||||
|
||||
return ClusterStore.createInstance({
|
||||
createCluster: di.inject(createClusterInjectionToken),
|
||||
readClusterConfigSync: di.inject(readClusterConfigSyncInjectable),
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -16,13 +16,16 @@ import { disposer, toJS } from "../utils";
|
||||
import type { ClusterModel, ClusterId, ClusterState } from "../cluster-types";
|
||||
import { requestInitialClusterStates } from "../../renderer/ipc";
|
||||
import { clusterStates } from "../ipc/cluster";
|
||||
import type { CreateCluster } from "../cluster/create-cluster-injection-token";
|
||||
import type { ReadClusterConfigSync } from "./read-cluster-config.injectable";
|
||||
|
||||
export interface ClusterStoreModel {
|
||||
clusters?: ClusterModel[];
|
||||
}
|
||||
|
||||
interface Dependencies {
|
||||
createCluster: (model: ClusterModel) => Cluster;
|
||||
createCluster: CreateCluster;
|
||||
readClusterConfigSync: ReadClusterConfigSync;
|
||||
}
|
||||
|
||||
export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
||||
@ -116,7 +119,10 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
||||
|
||||
const cluster = clusterOrModel instanceof Cluster
|
||||
? clusterOrModel
|
||||
: this.dependencies.createCluster(clusterOrModel);
|
||||
: this.dependencies.createCluster(
|
||||
clusterOrModel,
|
||||
this.dependencies.readClusterConfigSync(clusterOrModel),
|
||||
);
|
||||
|
||||
this.clusters.set(cluster.id, cluster);
|
||||
|
||||
@ -136,7 +142,10 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
||||
if (cluster) {
|
||||
cluster.updateModel(clusterModel);
|
||||
} else {
|
||||
cluster = this.dependencies.createCluster(clusterModel);
|
||||
cluster = this.dependencies.createCluster(
|
||||
clusterModel,
|
||||
this.dependencies.readClusterConfigSync(clusterModel),
|
||||
);
|
||||
}
|
||||
newClusters.set(clusterModel.id, cluster);
|
||||
} catch (error) {
|
||||
|
||||
31
src/common/cluster-store/read-cluster-config.injectable.ts
Normal file
31
src/common/cluster-store/read-cluster-config.injectable.ts
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { ClusterConfigData, ClusterModel } from "../cluster-types";
|
||||
import readFileSyncInjectable from "../fs/read-file-sync.injectable";
|
||||
import { loadConfigFromString, validateKubeConfig } from "../kube-helpers";
|
||||
|
||||
export type ReadClusterConfigSync = (model: ClusterModel) => ClusterConfigData;
|
||||
|
||||
const readClusterConfigSyncInjectable = getInjectable({
|
||||
id: "read-cluster-config-sync",
|
||||
instantiate: (di): ReadClusterConfigSync => {
|
||||
const readFileSync = di.inject(readFileSyncInjectable);
|
||||
|
||||
return ({ kubeConfigPath, contextName }) => {
|
||||
const kubeConfigData = readFileSync(kubeConfigPath);
|
||||
const { config } = loadConfigFromString(kubeConfigData);
|
||||
const result = validateKubeConfig(config, contextName);
|
||||
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
}
|
||||
|
||||
return { clusterServerUrl: result.cluster.server };
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export default readClusterConfigSyncInjectable;
|
||||
@ -67,6 +67,15 @@ export interface ClusterModel {
|
||||
labels?: Record<string, string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* This data is retreived from the kubeconfig file before calling the cluster constructor.
|
||||
*
|
||||
* That is done to remove the external dependency on the construction of Cluster instances.
|
||||
*/
|
||||
export interface ClusterConfigData {
|
||||
clusterServerUrl: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The complete set of cluster settings or preferences
|
||||
*/
|
||||
|
||||
@ -10,13 +10,13 @@ import type { KubeConfig } from "@kubernetes/client-node";
|
||||
import { HttpError } from "@kubernetes/client-node";
|
||||
import type { Kubectl } from "../../main/kubectl/kubectl";
|
||||
import type { KubeconfigManager } from "../../main/kubeconfig-manager/kubeconfig-manager";
|
||||
import { loadConfigFromFile, loadConfigFromFileSync, validateKubeConfig } from "../kube-helpers";
|
||||
import { loadConfigFromFile } from "../kube-helpers";
|
||||
import type { KubeApiResource, KubeResource } from "../rbac";
|
||||
import { apiResourceRecord, apiResources } from "../rbac";
|
||||
import type { VersionDetector } from "../../main/cluster-detectors/version-detector";
|
||||
import type { DetectorRegistry } from "../../main/cluster-detectors/detector-registry";
|
||||
import plimit from "p-limit";
|
||||
import type { ClusterState, ClusterRefreshOptions, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel, KubeAuthUpdate } from "../cluster-types";
|
||||
import type { ClusterState, ClusterRefreshOptions, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel, KubeAuthUpdate, ClusterConfigData } from "../cluster-types";
|
||||
import { ClusterMetadataKey, initialNodeShellImage, ClusterStatus } from "../cluster-types";
|
||||
import { disposer, isDefined, isRequestError, toJS } from "../utils";
|
||||
import type { Response } from "request";
|
||||
@ -236,27 +236,11 @@ export class Cluster implements ClusterModel, ClusterState {
|
||||
return this.preferences.defaultNamespace;
|
||||
}
|
||||
|
||||
constructor(private readonly dependencies: ClusterDependencies, model: ClusterModel) {
|
||||
constructor(private readonly dependencies: ClusterDependencies, model: ClusterModel, configData: ClusterConfigData) {
|
||||
makeObservable(this);
|
||||
this.id = model.id;
|
||||
this.updateModel(model);
|
||||
|
||||
const { config } = loadConfigFromFileSync(this.kubeConfigPath);
|
||||
const validationError = validateKubeConfig(config, this.contextName);
|
||||
|
||||
if (validationError) {
|
||||
throw validationError;
|
||||
}
|
||||
|
||||
const context = config.getContextObject(this.contextName);
|
||||
|
||||
assert(context);
|
||||
|
||||
const cluster = config.getCluster(context.cluster);
|
||||
|
||||
assert(cluster);
|
||||
|
||||
this.apiUrl = cluster.server;
|
||||
this.apiUrl = configData.clusterServerUrl;
|
||||
|
||||
// for the time being, until renderer gets its own cluster type
|
||||
this._contextHandler = this.dependencies.createContextHandler(this);
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { ClusterModel } from "../cluster-types";
|
||||
import type { ClusterConfigData, ClusterModel } from "../cluster-types";
|
||||
import type { Cluster } from "./cluster";
|
||||
|
||||
export type CreateCluster = (model: ClusterModel) => Cluster;
|
||||
export type CreateCluster = (model: ClusterModel, configData: ClusterConfigData) => Cluster;
|
||||
|
||||
export const createClusterInjectionToken = getInjectionToken<CreateCluster>({
|
||||
id: "create-cluster-token",
|
||||
|
||||
@ -6,8 +6,8 @@ import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { IComputedValue } from "mobx";
|
||||
import type { LensRendererExtension } from "../../extensions/lens-renderer-extension";
|
||||
|
||||
export const routeInjectionToken = getInjectionToken<Route<unknown>>({
|
||||
id: "route-injection-token",
|
||||
export const frontEndRouteInjectionToken = getInjectionToken<Route<unknown>>({
|
||||
id: "front-end-route-injection-token",
|
||||
});
|
||||
|
||||
export interface Route<TParameter = void> {
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { Route } from "./route-injection-token";
|
||||
import type { Route } from "./front-end-route-injection-token";
|
||||
|
||||
type InferParametersFrom<TRoute> = TRoute extends Route<infer TParameters>
|
||||
? TParameters
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
|
||||
|
||||
const addClusterRouteInjectable = getInjectable({
|
||||
id: "add-cluster-route",
|
||||
@ -15,7 +15,7 @@ const addClusterRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default addClusterRouteInjectable;
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../route-injection-token";
|
||||
import type { Route } from "../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
|
||||
|
||||
export interface CatalogPathParameters {
|
||||
group?: string;
|
||||
@ -21,7 +21,7 @@ const catalogRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default catalogRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
|
||||
|
||||
const clusterViewRouteInjectable = getInjectable({
|
||||
id: "cluster-view-route",
|
||||
@ -15,7 +15,7 @@ const clusterViewRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterViewRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const configMapsRouteInjectable = getInjectable({
|
||||
id: "config-maps-route",
|
||||
@ -19,7 +19,7 @@ const configMapsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default configMapsRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const horizontalPodAutoscalersRouteInjectable = getInjectable({
|
||||
id: "horizontal-pod-autoscalers-route",
|
||||
@ -19,7 +19,7 @@ const horizontalPodAutoscalersRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default horizontalPodAutoscalersRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const limitRangesRouteInjectable = getInjectable({
|
||||
id: "limit-ranges-route",
|
||||
@ -22,7 +22,7 @@ const limitRangesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default limitRangesRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const podDisruptionBudgetsRouteInjectable = getInjectable({
|
||||
id: "pod-disruption-budgets-route",
|
||||
@ -19,7 +19,7 @@ const podDisruptionBudgetsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default podDisruptionBudgetsRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const resourceQuotasRouteInjectable = getInjectable({
|
||||
id: "resource-quotas-route",
|
||||
@ -19,7 +19,7 @@ const resourceQuotasRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default resourceQuotasRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const secretsRouteInjectable = getInjectable({
|
||||
id: "secrets-route",
|
||||
@ -19,7 +19,7 @@ const secretsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default secretsRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const crdListRouteInjectable = getInjectable({
|
||||
id: "crd-list-route",
|
||||
@ -15,7 +15,7 @@ const crdListRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default crdListRouteInjectable;
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import type { Route } from "../../../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
export interface CustomResourcesPathParameters {
|
||||
group?: string;
|
||||
@ -21,7 +21,7 @@ const customResourcesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default customResourcesRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const eventsRouteInjectable = getInjectable({
|
||||
id: "events-route",
|
||||
@ -19,7 +19,7 @@ const eventsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default eventsRouteInjectable;
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import type { Route } from "../../../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
export interface HelmChartsPathParameters {
|
||||
repo?: string;
|
||||
@ -21,7 +21,7 @@ const helmChartsRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default helmChartsRouteInjectable;
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import type { Route } from "../../../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
export interface HelmReleasesPathParameters {
|
||||
namespace?: string;
|
||||
@ -21,7 +21,7 @@ const helmReleasesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default helmReleasesRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const namespacesRouteInjectable = getInjectable({
|
||||
id: "namespaces-route",
|
||||
@ -19,7 +19,7 @@ const namespacesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default namespacesRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const endpointsRouteInjectable = getInjectable({
|
||||
id: "endpoints-route",
|
||||
@ -19,7 +19,7 @@ const endpointsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default endpointsRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const ingressesRouteInjectable = getInjectable({
|
||||
id: "ingresses-route",
|
||||
@ -19,7 +19,7 @@ const ingressesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default ingressesRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const networkPoliciesRouteInjectable = getInjectable({
|
||||
id: "network-policies-route",
|
||||
@ -19,7 +19,7 @@ const networkPoliciesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default networkPoliciesRouteInjectable;
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import type { Route } from "../../../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
export interface PortForwardsPathParameters {
|
||||
forwardport?: string;
|
||||
@ -20,7 +20,7 @@ const portForwardsRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default portForwardsRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const servicesRouteInjectable = getInjectable({
|
||||
id: "services-route",
|
||||
@ -19,7 +19,7 @@ const servicesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default servicesRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const nodesRouteInjectable = getInjectable({
|
||||
id: "nodes-route",
|
||||
@ -19,7 +19,7 @@ const nodesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default nodesRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const clusterOverviewRouteInjectable = getInjectable({
|
||||
id: "cluster-overview-route",
|
||||
@ -19,7 +19,7 @@ const clusterOverviewRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterOverviewRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const persistentVolumeClaimsRouteInjectable = getInjectable({
|
||||
id: "persistent-volume-claims-route",
|
||||
@ -19,7 +19,7 @@ const persistentVolumeClaimsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default persistentVolumeClaimsRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const persistentVolumesRouteInjectable = getInjectable({
|
||||
id: "persistent-volumes-route",
|
||||
@ -19,7 +19,7 @@ const persistentVolumesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default persistentVolumesRouteInjectable;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const storageClassesRouteInjectable = getInjectable({
|
||||
id: "storage-classes-route",
|
||||
@ -19,7 +19,7 @@ const storageClassesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default storageClassesRouteInjectable;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user