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:
Janne Savolainen authored and GitHub committed 2022-08-16 15:55:42 +03:00
1 parent 299922c8a7
commit 63d5a34379
98 files changed
+3283 -2743

No files matched your search

@@ -12,28 +12,28 @@ import resolveSystemProxyFromElectronInjectable from "../../main/utils/resolve-s
import { getPromiseStatus } from "../../common/test-utils/get-promise-status";
describe("resolve-system-proxy", () => {
let applicationBuilder: ApplicationBuilder;
let builder: ApplicationBuilder;
let actualPromise: Promise<string>;
let resolveSystemProxyFromElectronMock: AsyncFnMock<ResolveSystemProxy>;
beforeEach(async () => {
applicationBuilder = getApplicationBuilder();
builder = getApplicationBuilder();
resolveSystemProxyFromElectronMock = asyncFn();
applicationBuilder.beforeApplicationStart(({ mainDi }) => {
builder.beforeApplicationStart((mainDi) => {
mainDi.override(
resolveSystemProxyFromElectronInjectable,
() => resolveSystemProxyFromElectronMock,
);
});
await applicationBuilder.render();
await builder.render();
});
describe("given in main, when called with URL", () => {
beforeEach(async () => {
const resolveSystemProxyInMain = applicationBuilder.dis.mainDi.inject(
const resolveSystemProxyInMain = builder.mainDi.inject(
resolveSystemProxyInjectionToken,
);
@@ -59,7 +59,9 @@ describe("resolve-system-proxy", () => {
describe("given in renderer, when called with URL", () => {
beforeEach(async () => {
const resolveSystemProxyInRenderer = applicationBuilder.dis.rendererDi.inject(
const windowDi = builder.applicationWindow.only.di;
const resolveSystemProxyInRenderer = windowDi.inject(
resolveSystemProxyInjectionToken,
);