refactor: share instrument search presentation
This commit is contained in:
@@ -349,6 +349,12 @@ describe("CardPage", () => {
|
||||
it("archives without deleting history and restores financial actions", async () => {
|
||||
setup();
|
||||
await screen.findByText("Перевод на «Запасная»");
|
||||
server.use(http.patch("*/api/v1/bank-cards/a", () =>
|
||||
HttpResponse.json({ code: "BANK_WRITE_CONFLICT" }, { status: 409 }),
|
||||
));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Убрать в архив" }));
|
||||
await screen.findByRole("alert");
|
||||
expect(screen.getByRole("button", { name: "Добавить операцию" })).toBeEnabled();
|
||||
let current = card;
|
||||
const bodies: unknown[] = [];
|
||||
server.use(
|
||||
@@ -376,6 +382,7 @@ describe("CardPage", () => {
|
||||
);
|
||||
fireEvent.click(screen.getByRole("button", { name: "Убрать в архив" }));
|
||||
await screen.findByRole("button", { name: "Вернуть из архива" });
|
||||
expect(screen.queryByRole("alert")).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("button", { name: "Добавить операцию" }),
|
||||
).toBeDisabled();
|
||||
|
||||
Reference in New Issue
Block a user