refactor: tighten types and reuse instrument UI
Frontend verify / commits (pull_request) Successful in 24s
Frontend verify / security (pull_request) Failing after 9s
Frontend verify / verify (pull_request) Skipped

This commit is contained in:
2026-09-29 06:15:31 +03:00
parent b404c1802a
commit 7c28a423dd
67 changed files with 380 additions and 347 deletions
@@ -9,7 +9,7 @@ import {
} from "@testing-library/react";
import { http, HttpResponse } from "msw";
import { MemoryRouter } from "react-router";
import { describe, expect, it } from "vitest";
import { assert, describe, expect, it } from "vitest";
import { configureAuthClient } from "@/shared/api";
import { createTestQueryClient } from "@/test/query";
@@ -62,9 +62,9 @@ describe("CardsPage", () => {
it("preserves exact negative opening amount and the creation intent through unknown failure", async () => {
renderCards();
await screen.findByRole("heading", { name: "Добавьте первую карту" });
fireEvent.click(
screen.getAllByRole("button", { name: "Добавить карту" })[0],
);
const creationButton = screen.getAllByRole("button", { name: "Добавить карту" })[0];
assert.isDefined(creationButton);
fireEvent.click(creationButton);
const dialog = screen.getByRole("dialog");
const submitted: Record<string, unknown>[] = [];
let resolve: (() => void) | undefined;
@@ -80,7 +80,7 @@ describe("CardsPage", () => {
return HttpResponse.error();
}
return HttpResponse.json({ id: submitted[0].id }, { status: 201 });
return HttpResponse.json({ id: submitted[0]?.id }, { status: 201 });
}),
);
fireEvent.change(within(dialog).getByLabelText(/Название карты/), {
@@ -75,6 +75,8 @@ const CardsPageViewCards: FC<CardsPageViewProps> = (props) => {
</LoadingSkeleton>
);
}
return null;
};
const CardsPageView: FC<CardsPageViewProps> = (props) => {