feat: default journal period to last 7 days
This commit is contained in:
@@ -6,6 +6,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type * as BrokerageEvents from "@/entities/brokerage-event";
|
||||
|
||||
import { useBrokerageEvents } from "@/entities/brokerage-event";
|
||||
import { defaultPeriod } from "@/shared/lib";
|
||||
|
||||
import { AccountEventsPage } from "./AccountEventsPage";
|
||||
|
||||
@@ -71,7 +72,10 @@ describe("AccountEventsPage", () => {
|
||||
</MemoryRouter>
|
||||
</MantineProvider>,
|
||||
);
|
||||
expect(query).toHaveBeenCalledWith("selected-account", {});
|
||||
expect(query).toHaveBeenCalledWith("selected-account", {
|
||||
from: defaultPeriod()[0],
|
||||
to: defaultPeriod()[1],
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps the loading fallback when no result or account is available", () => {
|
||||
@@ -88,7 +92,10 @@ describe("AccountEventsPage", () => {
|
||||
} as never,
|
||||
);
|
||||
renderPage();
|
||||
expect(query).toHaveBeenCalledWith("", {});
|
||||
expect(query).toHaveBeenCalledWith("", {
|
||||
from: defaultPeriod()[0],
|
||||
to: defaultPeriod()[1],
|
||||
});
|
||||
expect(screen.getByRole("status", { name: "Загрузка" })).toHaveAttribute(
|
||||
"aria-busy",
|
||||
"true",
|
||||
|
||||
Reference in New Issue
Block a user