feat: add manual bank card screens
Add cards, operations, refunds, categories and monthly summaries with Mantine date controls. Derive banking types from runtime OpenAPI. Cover recovery and session isolation.
This commit is contained in:
@@ -37,6 +37,7 @@ describe("AppRoutes", () => {
|
||||
["/accounts/demo", "Вход"],
|
||||
["/accounts/demo/operations", "Вход"],
|
||||
["/settings", "Вход"],
|
||||
["/cards?month=2026-08", "Вход"],
|
||||
["/unknown", "Страница не найдена"],
|
||||
])("renders %s with its page title", async (path, title) => {
|
||||
renderRoutes(path);
|
||||
@@ -94,6 +95,41 @@ describe("AppRoutes", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("returns after login to cards with the selected month without T-Bank", async () => {
|
||||
server.use(
|
||||
http.get("*/api/v1/bank-cards/categories", () => HttpResponse.json([])),
|
||||
http.post("*/api/v1/auth/login", () =>
|
||||
HttpResponse.json({
|
||||
accessToken: "test",
|
||||
user: { id: "user-1", email: "user@example.com" },
|
||||
}),
|
||||
),
|
||||
http.get("*/api/v1/bank-cards", () => HttpResponse.json([])),
|
||||
http.get("*/api/v1/bank-cards/summary", () =>
|
||||
HttpResponse.json({
|
||||
month: "2026-08",
|
||||
cardId: null,
|
||||
expenses: { currency: "RUB", value: "0" },
|
||||
refunds: { currency: "RUB", value: "0" },
|
||||
net: { currency: "RUB", value: "0" },
|
||||
categories: [],
|
||||
}),
|
||||
),
|
||||
);
|
||||
renderRoutes("/cards?month=2026-08");
|
||||
await screen.findByRole("heading", { name: "Вход" });
|
||||
fireEvent.change(screen.getByLabelText("Email"), {
|
||||
target: { value: "user@example.com" },
|
||||
});
|
||||
fireEvent.change(screen.getByLabelText("Пароль"), {
|
||||
target: { value: "a secure password" },
|
||||
});
|
||||
fireEvent.click(screen.getByRole("button", { name: "Вход" }));
|
||||
await screen.findByRole("heading", { name: "Добавьте первую карту" });
|
||||
expect(screen.getByLabelText("Месяц")).toHaveTextContent("August 2026");
|
||||
expect(document.title).toBe("Карты — WealthLedger");
|
||||
});
|
||||
|
||||
it("lazy-loads the protected shell for an authenticated accounts route", async () => {
|
||||
server.use(
|
||||
http.post("*/api/v1/auth/refresh", () =>
|
||||
|
||||
Reference in New Issue
Block a user