chore: add typed ESLint checks #18

Refs WealthLedger/main#18. Keep Biome; add no Prettier dependencies.
This commit is contained in:
2026-09-28 16:36:40 +03:00
committed by ksv741
parent 95fdc8759e
commit 57630102e4
38 changed files with 2914 additions and 155 deletions
+13 -19
View File
@@ -1,6 +1,6 @@
import { MantineProvider } from "@mantine/core";
import { QueryClientProvider } from "@tanstack/react-query";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { fireEvent, render, screen } from "@testing-library/react";
import { cssVariablesResolver, theme } from "@wealthledger/ui/theme";
import { HttpResponse, http } from "msw";
import { MemoryRouter } from "react-router";
@@ -41,22 +41,18 @@ describe("AppRoutes", () => {
])("renders %s with its page title", async (path, title) => {
renderRoutes(path);
await waitFor(() =>
expect(
screen.getByRole("heading", { level: 1, name: title }),
).toBeInTheDocument(),
);
expect(
await screen.findByRole("heading", { level: 1, name: title }),
).toBeInTheDocument();
expect(document.title).toBe(`${title} — WealthLedger`);
});
it("redirects anonymous users from accounts", async () => {
renderRoutes("/accounts");
await waitFor(() =>
expect(
screen.getByRole("heading", { level: 1, name: "Вход" }),
).toBeInTheDocument(),
);
expect(
await screen.findByRole("heading", { level: 1, name: "Вход" }),
).toBeInTheDocument();
});
it("logs in through the public form and reaches the protected landing", async () => {
@@ -142,14 +138,12 @@ describe("AppRoutes", () => {
);
renderRoutes("/accounts");
await waitFor(() =>
expect(
screen.getByRole("heading", {
level: 2,
name: "Нет инвестиционных счетов",
}),
).toBeInTheDocument(),
);
expect(
await screen.findByRole("heading", {
level: 2,
name: "Нет инвестиционных счетов",
}),
).toBeInTheDocument();
expect(
screen.getByRole("navigation", { name: "WealthLedger" }),
).toBeInTheDocument();
@@ -1,5 +1,5 @@
import { MantineProvider } from "@mantine/core";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { fireEvent, render, screen } from "@testing-library/react";
import { type FC, lazy, Suspense } from "react";
import { MemoryRouter, useLocation, useNavigate } from "react-router";
import { describe, expect, it, vi } from "vitest";
@@ -135,8 +135,6 @@ describe("RouteErrorBoundary", () => {
authenticated = true;
renderBoundary("/accounts");
screen.getByRole("button", { name: "go healthy" }).click();
await waitFor(() =>
expect(screen.getByText("healthy route")).toBeInTheDocument(),
);
expect(await screen.findByText("healthy route")).toBeInTheDocument();
});
});
@@ -33,7 +33,7 @@ const AccountScopeSwitch: FC<AccountScopeSwitchProps> = (props) => {
if (!value || value === accountId) return;
const filters = new URLSearchParams(search);
filters.delete("cursor");
navigate({
void navigate({
pathname: `/accounts/${encodeURIComponent(value)}${section ? `/${section}` : ""}`,
search: filters.toString(),
});