refactor: simplify frontend state and mutation boundaries
Frontend verify / commits (pull_request) Successful in 31s
Frontend verify / security (pull_request) Successful in 11s
Frontend verify / verify (pull_request) Successful in 9m1s
Frontend verify / commits (push) Skipped
Frontend verify / security (push) Successful in 10s
Frontend verify / verify (push) Successful in 9m59s

This commit was merged in pull request #44.
This commit is contained in:
2026-09-28 20:01:37 +03:00
parent a4046dbe87
commit a7537da344
25 changed files with 414 additions and 547 deletions
@@ -126,6 +126,32 @@ function setup(
}
describe("CardPage", () => {
it.each([
["Изменить карту", "Изменить карту"],
["Добавить операцию", "Добавить операцию"],
["Изменить", "Изменить операцию"],
["Удалить", "Удалить операцию?"],
])("opens %s and restores focus after cancellation", async (action, title) => {
setup();
server.use(
http.get("*/api/v1/bank-cards/categories", () =>
HttpResponse.json([]),
),
http.get("*/api/v1/bank-cards/operations/:id", ({ params }) =>
HttpResponse.json({ ...operation, id: params.id }),
),
);
await screen.findByText("Перевод на «Запасная»");
const trigger = screen.getByRole("button", { name: action });
await waitFor(() => expect(trigger).toBeEnabled());
trigger.focus();
fireEvent.click(trigger);
const dialog = await screen.findByRole("dialog", { name: title });
fireEvent.click(within(dialog).getByRole("button", { name: "Отмена" }));
await waitFor(() => expect(dialog).not.toBeInTheDocument());
await waitFor(() => expect(trigger).toHaveFocus());
});
it.each([
["0001-01", "0001-01-31"],
["0099-12", "0099-12-31"],