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

fix navigation-to-telemetry-preferences.test.tsx

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-04-21 13:24:07 -04:00
parent d3723af27a
commit 9815f80041
2 changed files with 21 additions and 32 deletions

View File

@ -119,7 +119,7 @@ exports[`preferences - navigation to telemetry preferences given URL for Sentry
class="SubTitle" class="SubTitle"
> >
Automatic Error Reporting Automatic Error Reporting
</div> </div>
<label <label
class="Checkbox flex align-center" class="Checkbox flex align-center"
@ -293,7 +293,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Theme Theme
</div> </div>
<div <div
class="Select theme-lens css-b62m3t-container" class="Select theme-lens css-b62m3t-container"
@ -378,7 +378,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Extension Install Registry Extension Install Registry
</div> </div>
<div <div
class="Select theme-lens css-b62m3t-container" class="Select theme-lens css-b62m3t-container"
@ -458,16 +458,11 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="mt-4 mb-5 leading-relaxed" class="mt-4 mb-5 leading-relaxed"
> >
This setting is to change the registry URL for installing extensions by name. This setting is to change the registry URL for installing extensions by name.
If you are unable to access the default registry (https://registry.npmjs.org) you can change it in your
If you are unable to access the default registry (
https://registry.npmjs.org
)
you can change it in your
<b> <b>
.npmrc .npmrc
</b> </b>
 file or in the input below. file or in the input below.
</p> </p>
<div <div
class="Input theme round black disabled invalid" class="Input theme round black disabled invalid"
@ -497,7 +492,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Start-up Start-up
</div> </div>
<label <label
class="Switch" class="Switch"
@ -518,7 +513,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Update Channel Update Channel
</div> </div>
<div <div
class="Select theme-lens css-b62m3t-container" class="Select theme-lens css-b62m3t-container"
@ -603,7 +598,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Locale Timezone Locale Timezone
</div> </div>
<div <div
class="Select theme-lens css-b62m3t-container" class="Select theme-lens css-b62m3t-container"
@ -838,7 +833,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Theme Theme
</div> </div>
<div <div
class="Select theme-lens css-b62m3t-container" class="Select theme-lens css-b62m3t-container"
@ -923,7 +918,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Extension Install Registry Extension Install Registry
</div> </div>
<div <div
class="Select theme-lens css-b62m3t-container" class="Select theme-lens css-b62m3t-container"
@ -1003,16 +998,11 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="mt-4 mb-5 leading-relaxed" class="mt-4 mb-5 leading-relaxed"
> >
This setting is to change the registry URL for installing extensions by name. This setting is to change the registry URL for installing extensions by name.
If you are unable to access the default registry (https://registry.npmjs.org) you can change it in your
If you are unable to access the default registry (
https://registry.npmjs.org
)
you can change it in your
<b> <b>
.npmrc .npmrc
</b> </b>
 file or in the input below. file or in the input below.
</p> </p>
<div <div
class="Input theme round black disabled invalid" class="Input theme round black disabled invalid"
@ -1042,7 +1032,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Start-up Start-up
</div> </div>
<label <label
class="Switch" class="Switch"
@ -1063,7 +1053,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Update Channel Update Channel
</div> </div>
<div <div
class="Select theme-lens css-b62m3t-container" class="Select theme-lens css-b62m3t-container"
@ -1148,7 +1138,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Locale Timezone Locale Timezone
</div> </div>
<div <div
class="Select theme-lens css-b62m3t-container" class="Select theme-lens css-b62m3t-container"
@ -1385,7 +1375,7 @@ exports[`preferences - navigation to telemetry preferences given in preferences,
class="SubTitle" class="SubTitle"
> >
Some telemetry-preference item Some telemetry-preference item
</div> </div>
<div <div
data-testid="some-preference-item-input" data-testid="some-preference-item-input"

View File

@ -9,10 +9,9 @@ import { getApplicationBuilder } from "../../renderer/components/test-utils/get-
import { getRendererExtensionFake } from "../../renderer/components/test-utils/get-renderer-extension-fake"; import { getRendererExtensionFake } from "../../renderer/components/test-utils/get-renderer-extension-fake";
import type { UserStore } from "../../common/user-store"; import type { UserStore } from "../../common/user-store";
import userStoreInjectable from "../../common/user-store/user-store.injectable"; import userStoreInjectable from "../../common/user-store/user-store.injectable";
import type { ThemeStore } from "../../renderer/themes/store";
import themeStoreInjectable from "../../renderer/themes/store.injectable";
import navigateToTelemetryPreferencesInjectable from "../../common/front-end-routing/routes/preferences/telemetry/navigate-to-telemetry-preferences.injectable"; import navigateToTelemetryPreferencesInjectable from "../../common/front-end-routing/routes/preferences/telemetry/navigate-to-telemetry-preferences.injectable";
import sentryDnsUrlInjectable from "../../renderer/components/+preferences/sentry-dns-url.injectable"; import sentryDnsUrlInjectable from "../../renderer/components/+preferences/sentry-dns-url.injectable";
import ipcRendererInjectable from "../../renderer/app-paths/get-value-from-registered-channel/ipc-renderer/ipc-renderer.injectable";
describe("preferences - navigation to telemetry preferences", () => { describe("preferences - navigation to telemetry preferences", () => {
let applicationBuilder: ApplicationBuilder; let applicationBuilder: ApplicationBuilder;
@ -26,10 +25,10 @@ describe("preferences - navigation to telemetry preferences", () => {
} as unknown as UserStore; } as unknown as UserStore;
rendererDi.override(userStoreInjectable, () => userStoreStub); rendererDi.override(userStoreInjectable, () => userStoreStub);
rendererDi.override(ipcRendererInjectable, () => ({
const themeStoreStub = { themeOptions: [] } as unknown as ThemeStore; on: jest.fn(),
invoke: jest.fn(), // TODO: replace with proper mocking via the IPC bridge
rendererDi.override(themeStoreInjectable, () => themeStoreStub); } as never));
}); });
}); });