feat: default journal period to last 7 days
This commit is contained in:
+7
-4
@@ -18,6 +18,7 @@ import {
|
||||
LedgerEntryRow,
|
||||
} from "@/entities/broker-operation";
|
||||
import { configureAuthClient } from "@/shared/api";
|
||||
import { defaultPeriod } from "@/shared/lib";
|
||||
import { createTestQueryClient } from "@/test/query";
|
||||
import { resource } from "@/test/resource";
|
||||
import { server } from "@/test/server";
|
||||
@@ -312,18 +313,20 @@ describe("AccountOperationsPage", () => {
|
||||
"allows resetting filters after a request failure for %s",
|
||||
async (accountId) => {
|
||||
configureTestAuth();
|
||||
const [defaultFrom] = defaultPeriod();
|
||||
server.use(
|
||||
http.get(
|
||||
"*/api/v1/brokerage-accounts/:accountId/operations",
|
||||
({ request }) =>
|
||||
new URL(request.url).searchParams.has("from")
|
||||
? HttpResponse.json({ code: "VALIDATION_ERROR" }, { status: 400 })
|
||||
: HttpResponse.json(
|
||||
new URL(request.url).searchParams.get("from")
|
||||
=== `${defaultFrom}T00:00:00.000Z`
|
||||
? HttpResponse.json(
|
||||
|
||||
resource(
|
||||
{ hasNext: false, items: [], nextCursor: null },
|
||||
),
|
||||
),
|
||||
)
|
||||
: HttpResponse.json({ code: "VALIDATION_ERROR" }, { status: 400 }),
|
||||
),
|
||||
);
|
||||
render(
|
||||
|
||||
Reference in New Issue
Block a user