Files
frontend/src/features/tbank-connection/ui/TbankConnectionSection/TbankConnectionSection.view.test.tsx
T
ksv741 b987fd8e78
Frontend security / security (push) Successful in 9s
Frontend verify / verify (push) Successful in 5m10s
Conventional commits / commits (pull_request) Successful in 25s
Frontend security / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Successful in 5m10s
refactor: colocate frontend component files
2026-09-23 08:34:58 +03:00

30 lines
843 B
TypeScript

import { MantineProvider } from "@mantine/core";
import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import {
TbankConnectionError,
TbankConnectionLoading,
} from "./TbankConnectionSection.view";
describe("TbankConnectionSection state views", () => {
it("renders loading and retries a status error", () => {
const retry = vi.fn();
const { rerender } = render(
<MantineProvider>
<TbankConnectionLoading />
</MantineProvider>,
);
expect(screen.getByRole("status", { name: "Загрузка" })).toHaveAttribute(
"aria-busy",
"true",
);
rerender(
<MantineProvider>
<TbankConnectionError retry={retry} />
</MantineProvider>,
);
screen.getByRole("button", { name: "Повторить" }).click();
expect(retry).toHaveBeenCalledOnce();
});
});