mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Replace static application window with ability to create many (#5979)
* Replace static application window with ability to create as many as you wish Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Adapt tests for replacing static application window with ability to create as many as you wish and separate starting of main and window in behaviours Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make first render of application smaller in test that proves to be hard for CI Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove redundant code Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Simplify code Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
299922c8a7
commit
63d5a34379
98 files changed
+3283
-2743
No files matched your search
+30
-28
@@ -29,17 +29,17 @@ describe("cluster/namespaces - edit namespaces from previously opened tab", () =
|
||||
|
||||
callForNamespaceMock = asyncFn();
|
||||
|
||||
builder.beforeApplicationStart(({ rendererDi }) => {
|
||||
rendererDi.override(
|
||||
builder.beforeWindowStart((windowDi) => {
|
||||
windowDi.override(
|
||||
directoryForLensLocalStorageInjectable,
|
||||
() => "/some-directory-for-lens-local-storage",
|
||||
);
|
||||
|
||||
rendererDi.override(hostedClusterIdInjectable, () => "some-cluster-id");
|
||||
windowDi.override(hostedClusterIdInjectable, () => "some-cluster-id");
|
||||
|
||||
storagesAreReady = controlWhenStoragesAreReady(rendererDi);
|
||||
storagesAreReady = controlWhenStoragesAreReady(windowDi);
|
||||
|
||||
rendererDi.override(callForResourceInjectable, () => callForNamespaceMock);
|
||||
windowDi.override(callForResourceInjectable, () => callForNamespaceMock);
|
||||
});
|
||||
|
||||
builder.allowKubeResource("namespaces");
|
||||
@@ -49,33 +49,35 @@ describe("cluster/namespaces - edit namespaces from previously opened tab", () =
|
||||
let rendered: RenderResult;
|
||||
|
||||
beforeEach(async () => {
|
||||
const writeJsonFile = builder.dis.rendererDi.inject(writeJsonFileInjectable);
|
||||
builder.beforeWindowStart(async (windowDi) => {
|
||||
const writeJsonFile = windowDi.inject(writeJsonFileInjectable);
|
||||
|
||||
await writeJsonFile(
|
||||
"/some-directory-for-lens-local-storage/some-cluster-id.json",
|
||||
{
|
||||
dock: {
|
||||
height: 300,
|
||||
tabs: [
|
||||
{
|
||||
id: "some-first-tab-id",
|
||||
kind: TabKind.EDIT_RESOURCE,
|
||||
title: "Namespace: some-namespace",
|
||||
pinned: false,
|
||||
await writeJsonFile(
|
||||
"/some-directory-for-lens-local-storage/some-cluster-id.json",
|
||||
{
|
||||
dock: {
|
||||
height: 300,
|
||||
tabs: [
|
||||
{
|
||||
id: "some-first-tab-id",
|
||||
kind: TabKind.EDIT_RESOURCE,
|
||||
title: "Namespace: some-namespace",
|
||||
pinned: false,
|
||||
},
|
||||
],
|
||||
|
||||
isOpen: true,
|
||||
},
|
||||
|
||||
edit_resource_store: {
|
||||
"some-first-tab-id": {
|
||||
resource: "/apis/some-api-version/namespaces/some-uid",
|
||||
draft: "some-saved-configuration",
|
||||
},
|
||||
],
|
||||
|
||||
isOpen: true,
|
||||
},
|
||||
|
||||
edit_resource_store: {
|
||||
"some-first-tab-id": {
|
||||
resource: "/apis/some-api-version/namespaces/some-uid",
|
||||
draft: "some-saved-configuration",
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
);
|
||||
});
|
||||
|
||||
rendered = await builder.render();
|
||||
|
||||
|
||||
Reference in new issue
Block a user