refactor: tighten types and reuse instrument UI
This commit is contained in:
+5
-3
@@ -11,7 +11,7 @@ import {
|
||||
useLocation,
|
||||
useNavigate,
|
||||
} from "react-router";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { assert, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import {
|
||||
type BrokerageOperation,
|
||||
@@ -264,8 +264,8 @@ describe("AccountOperationsPage", () => {
|
||||
</QueryClientProvider>,
|
||||
);
|
||||
await screen.findByLabelText("Период");
|
||||
expect(searches[0].get("from")).toBeNull();
|
||||
expect(searches[0].get("to")).toBeNull();
|
||||
expect(searches[0]?.get("from")).toBeNull();
|
||||
expect(searches[0]?.get("to")).toBeNull();
|
||||
|
||||
for (const expected of [
|
||||
"?categories=trade",
|
||||
@@ -597,6 +597,8 @@ it("recovers an invalid cursor at the first page without clearing applied filter
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Далее" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Повторить" }));
|
||||
await waitFor(() => expect(searches).toHaveLength(3));
|
||||
assert.isDefined(searches[0]);
|
||||
assert.isDefined(searches[2]);
|
||||
expect(searches[2].get("cursor")).toBeNull();
|
||||
for (const key of ["from", "to", "categories"])
|
||||
expect(searches[2].get(key)).toBe(searches[0].get(key));
|
||||
|
||||
Reference in New Issue
Block a user