1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix unit tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-12-22 15:22:41 -05:00
parent 8c82cbde79
commit c95d2cec18

View File

@ -244,29 +244,33 @@ export const getApplicationBuilder = () => {
return {
show: () => {},
close: () => {},
loadFile: async () => {},
loadFile: async (filePath) => {
if (filePath === "/some-static-directory/build/some-product-name.html") {
for (const callback of beforeWindowStartCallbacks) {
await callback(windowDi);
}
const startFrame = windowDi.inject(startFrameInjectable);
await startFrame();
for (const callback of afterWindowStartCallbacks) {
await callback(windowDi);
}
const history = windowDi.inject(historyInjectable);
const render = renderFor(windowDi);
rendered = render(
<Router history={history}>
<environment.RootComponent />
</Router>,
);
}
},
loadUrl: async () => {
for (const callback of beforeWindowStartCallbacks) {
await callback(windowDi);
}
const startFrame = windowDi.inject(startFrameInjectable);
await startFrame();
for (const callback of afterWindowStartCallbacks) {
await callback(windowDi);
}
const history = windowDi.inject(historyInjectable);
const render = renderFor(windowDi);
rendered = render(
<Router history={history}>
<environment.RootComponent />
</Router>,
);
throw new Error("Loading from URL is no longer supported");
},
send: (arg) => {