mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Lint fixes
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
f698a792e0
commit
27ca597f3a
@ -32,6 +32,7 @@ import type remote from "@electron/remote";
|
||||
|
||||
const electronRemote = (() => {
|
||||
if (ipcRenderer) {
|
||||
/* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
|
||||
try {
|
||||
return require("@electron/remote");
|
||||
} catch {}
|
||||
|
||||
@ -40,8 +40,8 @@ const url = extensionSettingsURL({
|
||||
const routeMatch: match<{ extensionId: string }> = {
|
||||
isExact: true,
|
||||
path: extensionSettingsRoute.path as string,
|
||||
url: url,
|
||||
params: { extensionId: "@k8slens/crd-example" }
|
||||
url,
|
||||
params: { extensionId: "@k8slens/crd-example" },
|
||||
};
|
||||
const location = createLocation(routeMatch.url);
|
||||
|
||||
@ -56,7 +56,7 @@ const crdExtension = {
|
||||
isBundled: false,
|
||||
isEnabled: true,
|
||||
isCompatible: true,
|
||||
}
|
||||
};
|
||||
|
||||
const sampleExtension = {
|
||||
id: "/absolute/path/sample",
|
||||
@ -69,7 +69,7 @@ const sampleExtension = {
|
||||
isBundled: false,
|
||||
isEnabled: true,
|
||||
isCompatible: true,
|
||||
}
|
||||
};
|
||||
|
||||
describe("<ExtensionSettingsPage/>", () => {
|
||||
let di: ConfigurableDependencyInjectionContainer;
|
||||
@ -84,7 +84,7 @@ describe("<ExtensionSettingsPage/>", () => {
|
||||
{
|
||||
components: {
|
||||
Input: () => <input data-testid="crd-name"/>,
|
||||
Hint: () => <div>choose crd name</div>
|
||||
Hint: () => <div>choose crd name</div>,
|
||||
},
|
||||
extensionId: "@k8slens/crd-example",
|
||||
title: "CRD Preferences",
|
||||
@ -92,7 +92,7 @@ describe("<ExtensionSettingsPage/>", () => {
|
||||
{
|
||||
components: {
|
||||
Input: () => <input type="checkbox" data-testid="save-to-file"/>,
|
||||
Hint: () => <div>save to file</div>
|
||||
Hint: () => <div>save to file</div>,
|
||||
},
|
||||
extensionId: "@k8slens/crd-example",
|
||||
title: "Filesystem",
|
||||
@ -102,11 +102,11 @@ describe("<ExtensionSettingsPage/>", () => {
|
||||
{
|
||||
components: {
|
||||
Input: () => <input data-testid="sample-entity-name"/>,
|
||||
Hint: () => <div>sample hint</div>
|
||||
Hint: () => <div>sample hint</div>,
|
||||
},
|
||||
extensionId: "@k8slens/sample",
|
||||
title: "Sample preferences",
|
||||
}
|
||||
},
|
||||
], new LensExtension(sampleExtension));
|
||||
});
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ const extension = {
|
||||
isBundled: false,
|
||||
isEnabled: true,
|
||||
isCompatible: true,
|
||||
}
|
||||
};
|
||||
|
||||
const crdExtension = {
|
||||
id: "/absolute/path/crd",
|
||||
@ -55,7 +55,7 @@ const crdExtension = {
|
||||
isBundled: false,
|
||||
isEnabled: true,
|
||||
isCompatible: true,
|
||||
}
|
||||
};
|
||||
|
||||
const sampleExtension = {
|
||||
id: "/absolute/path/sample",
|
||||
@ -68,7 +68,7 @@ const sampleExtension = {
|
||||
isBundled: false,
|
||||
isEnabled: true,
|
||||
isCompatible: true,
|
||||
}
|
||||
};
|
||||
|
||||
describe("Preferences", () => {
|
||||
let di: ConfigurableDependencyInjectionContainer;
|
||||
@ -83,33 +83,33 @@ describe("Preferences", () => {
|
||||
{
|
||||
components: {
|
||||
Input: () => <div>input</div>,
|
||||
Hint: () => <div>hint</div>
|
||||
Hint: () => <div>hint</div>,
|
||||
},
|
||||
extensionId: "@k8slens/test",
|
||||
id: "example-preferences",
|
||||
title: "Example Preferences",
|
||||
}
|
||||
},
|
||||
], new LensExtension(extension));
|
||||
AppPreferenceRegistry.getInstance().add([
|
||||
{
|
||||
components: {
|
||||
Input: () => <div>crd input</div>,
|
||||
Hint: () => <div>crd hint</div>
|
||||
Hint: () => <div>crd hint</div>,
|
||||
},
|
||||
extensionId: "@k8slens/crd-example",
|
||||
title: "Example Preferences",
|
||||
}
|
||||
},
|
||||
], new LensExtension(crdExtension));
|
||||
AppPreferenceRegistry.getInstance().add([
|
||||
{
|
||||
components: {
|
||||
Input: () => <div>sample input</div>,
|
||||
Hint: () => <div>sample hint</div>
|
||||
Hint: () => <div>sample hint</div>,
|
||||
},
|
||||
extensionId: "@k8slens/crd-example",
|
||||
title: "Extension with duplicated name",
|
||||
}
|
||||
], new LensExtension(crdExtension))
|
||||
},
|
||||
], new LensExtension(crdExtension));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@ -137,7 +137,7 @@ describe("Preferences", () => {
|
||||
const { getByTestId } = render(<MemoryRouter><Preferences /></MemoryRouter>);
|
||||
|
||||
expect(getByTestId("custom-settings")).toBeInTheDocument();
|
||||
})
|
||||
});
|
||||
|
||||
it("renders tabs for each extension having custom settings", () => {
|
||||
di.override(userExtensionsInjectable, () => {
|
||||
@ -159,6 +159,6 @@ describe("Preferences", () => {
|
||||
const { getAllByText } = render(<MemoryRouter><Preferences /></MemoryRouter>);
|
||||
|
||||
expect(getAllByText("@k8slens/crd-example").length).toBe(1);
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2021 OpenLens Authors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
export * from "./preferences";
|
||||
Loading…
Reference in New Issue
Block a user