mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-31 15:54:24 +00:00
25 lines
708 B
TypeScript
25 lines
708 B
TypeScript
import { render } from "@testing-library/react";
|
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
|
|
import { SIDEBAR_NAVIGATION_MODE, useSidebar } from "@/hooks/use-sidebar";
|
|
|
|
import { SidebarNavigationModeSync } from "./navigation-mode-sync";
|
|
|
|
describe("SidebarNavigationModeSync", () => {
|
|
beforeEach(() => {
|
|
useSidebar.setState({
|
|
navigationMode: SIDEBAR_NAVIGATION_MODE.CHAT,
|
|
});
|
|
});
|
|
|
|
it("restores app navigation mode when the overview mounts", () => {
|
|
// Given / When
|
|
render(<SidebarNavigationModeSync mode={SIDEBAR_NAVIGATION_MODE.BROWSE} />);
|
|
|
|
// Then
|
|
expect(useSidebar.getState().navigationMode).toBe(
|
|
SIDEBAR_NAVIGATION_MODE.BROWSE,
|
|
);
|
|
});
|
|
});
|