feat(cards): refine controls and modal transitions

This commit is contained in:
2026-09-12 22:34:27 +03:00
parent cf21a5bd17
commit aba4cf1ce8
16 changed files with 245 additions and 107 deletions
@@ -39,6 +39,12 @@ function setup(value: BankCard) {
return close;
}
describe("BankCardForm", () => {
it("waits for the exit transition before notifying the parent", async () => {
const close = setup(card);
fireEvent.click(screen.getByRole("button", { name: "Отмена" }));
expect(close).not.toHaveBeenCalled();
await waitFor(() => expect(close).toHaveBeenCalledTimes(1));
});
it("clears optional metadata on archive while omitting protected financial fields", async () => {
const close = setup({ ...card, archivedAt: "2026-09-01" });
expect(screen.getByLabelText(/Начальный остаток/)).toHaveAttribute(