1
0
forked from mixa/67
Files
67/apps/web/src/app/App.test.jsx
2026-06-22 20:13:14 +03:00

22 lines
724 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { screen } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
import { renderWithProviders } from "../test/renderWithProviders";
import { App } from "./App";
import { useSession } from "./store/session";
describe("защищенные маршруты", () => {
beforeEach(() => {
useSession.setState({ user: null });
});
it("перенаправляет гостя со страницы кабинета на вход", async () => {
renderWithProviders(
<MemoryRouter initialEntries={["/cabinet"]}>
<App />
</MemoryRouter>,
);
expect(await screen.findByRole("heading", { name: "Вход в систему" })).toBeInTheDocument();
});
});