feat: show persisted investment data and sync state
Consume the provided resource-envelope API snapshot. Preserve financial snapshots during refresh, observe synchronization without importing, and fence late responses across account and connection changes.
This commit is contained in:
@@ -12,6 +12,7 @@ import { MemoryRouter, useNavigate } from "react-router";
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { AuthProvider } from "@/features/auth";
|
||||
import { createTestQueryClient } from "@/test/query";
|
||||
import { resource } from "@/test/resource";
|
||||
import { server } from "@/test/server";
|
||||
import { ProtectedDocumentTitle } from "./DocumentTitle";
|
||||
|
||||
@@ -62,7 +63,7 @@ describe("document titles", () => {
|
||||
server.use(
|
||||
http.get("*/api/v1/brokerage-accounts", async () => {
|
||||
await accountsReady;
|
||||
return HttpResponse.json([{ id: "a", name: "ИИС" }]);
|
||||
return HttpResponse.json(resource([{ id: "a", name: "ИИС" }]));
|
||||
}),
|
||||
);
|
||||
renderTitle("/accounts/a/income?from=2026-01-01&to=2026-08-31");
|
||||
@@ -85,7 +86,7 @@ describe("document titles", () => {
|
||||
async (kind, id, fallback, name) => {
|
||||
server.use(
|
||||
http.get(`*/api/v1/${kind}/by-ticker/:ticker`, () =>
|
||||
HttpResponse.json({ name }),
|
||||
HttpResponse.json(resource({ name })),
|
||||
),
|
||||
);
|
||||
renderTitle(`/${kind}/${id}`);
|
||||
|
||||
Reference in New Issue
Block a user