Skip to content

Commit

Permalink
Address comments coming from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
laisspportugal committed Dec 17, 2024
1 parent 411a252 commit 8eaa3ba
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions packages/suite-base/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,26 @@ import { render, screen } from "@testing-library/react";
import React from "react";

import MultiProvider from "@lichtblick/suite-base/components/MultiProvider";
import PlayerManager from "@lichtblick/suite-base/components/PlayerManager";
import StudioToastProvider from "@lichtblick/suite-base/components/StudioToastProvider";
import { IAppConfiguration } from "@lichtblick/suite-base/context/AppConfigurationContext";
import LayoutStorageContext from "@lichtblick/suite-base/context/LayoutStorageContext";
import { INativeAppMenu } from "@lichtblick/suite-base/context/NativeAppMenuContext";
import { INativeWindow } from "@lichtblick/suite-base/context/NativeWindowContext";
import NativeAppMenuContext, { INativeAppMenu } from "@lichtblick/suite-base/context/NativeAppMenuContext";

Check failure on line 17 in packages/suite-base/src/App.test.tsx

View workflow job for this annotation

GitHub Actions / lint (ubuntu-20.04)

Replace `·INativeAppMenu·` with `⏎··INativeAppMenu,⏎`
import NativeWindowContext, { INativeWindow } from "@lichtblick/suite-base/context/NativeWindowContext";

Check failure on line 18 in packages/suite-base/src/App.test.tsx

View workflow job for this annotation

GitHub Actions / lint (ubuntu-20.04)

Replace `·INativeWindow·` with `⏎··INativeWindow,⏎`
import { UserScriptStateProvider } from "@lichtblick/suite-base/context/UserScriptStateContext";
import CurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider";
import EventsProvider from "@lichtblick/suite-base/providers/EventsProvider";
import ExtensionCatalogProvider from "@lichtblick/suite-base/providers/ExtensionCatalogProvider";
import ExtensionMarketplaceProvider from "@lichtblick/suite-base/providers/ExtensionMarketplaceProvider";
import LayoutManagerProvider from "@lichtblick/suite-base/providers/LayoutManagerProvider";
import ProblemsContextProvider from "@lichtblick/suite-base/providers/ProblemsContextProvider";
import { StudioLogsSettingsProvider } from "@lichtblick/suite-base/providers/StudioLogsSettingsProvider";
import TimelineInteractionStateProvider from "@lichtblick/suite-base/providers/TimelineInteractionStateProvider";
import UserProfileLocalStorageProvider from "@lichtblick/suite-base/providers/UserProfileLocalStorageProvider";

import { App } from "./App";
import Workspace from "./Workspace";

beforeEach(() => {
jest.clearAllMocks();
});

function mockProvider(testId: string) {
return jest.fn(({ children }) => <div data-testid={testId}>{children}</div>);
}
Expand Down Expand Up @@ -148,6 +150,12 @@ describe("App Component", () => {

describe("App Component MultiProvider Tests", () => {
const expectedProviders = [
TimelineInteractionStateProvider,
UserScriptStateProvider,
ExtensionMarketplaceProvider,
ExtensionCatalogProvider,
PlayerManager,
EventsProvider,
StudioToastProvider,
StudioLogsSettingsProvider,
ProblemsContextProvider,
Expand All @@ -165,22 +173,19 @@ describe("App Component MultiProvider Tests", () => {
setup();
expect(screen.getByTestId("multi-provider")).toBeDefined();
expect(screen.getByTestId("multi-provider").children).toHaveLength(3);
expectedProviders.forEach((provider) => {
expect(verifyProviderTypes()).toContain(provider);
});
});

it("verifies that MultiProvider has rendered all providers when its nativeApp", () => {
setup({ nativeAppMenu: {} as INativeAppMenu });

expectedProviders.forEach((provider) => {
expect(verifyProviderTypes()).toContain(provider);
});
expect(verifyProviderTypes()).toContain(NativeAppMenuContext.Provider);
});

it("verifies that MultiProvider has rendered all providers when its nativeWindow", () => {
setup({ nativeWindow: {} as INativeWindow });

expectedProviders.forEach((provider) => {
expect(verifyProviderTypes()).toContain(provider);
});
expect(verifyProviderTypes()).toContain(NativeWindowContext.Provider);
});
});

Expand Down

0 comments on commit 8eaa3ba

Please sign in to comment.