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:
@@ -5,6 +5,7 @@ import type { FC, PropsWithChildren } from "react";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { apiClient, apiQueryClient, useAuthenticatedQuery } from "@/shared/api";
|
||||
import { createTestQueryClient } from "@/test/query";
|
||||
import { resource } from "@/test/resource";
|
||||
import { server } from "@/test/server";
|
||||
import { AuthProvider, useAuth } from "./auth";
|
||||
|
||||
@@ -24,7 +25,7 @@ describe("AuthProvider", () => {
|
||||
),
|
||||
http.get("*/api/v1/brokerage-accounts", ({ request }) => {
|
||||
authorization = request.headers.get("Authorization");
|
||||
return HttpResponse.json([]);
|
||||
return HttpResponse.json(resource([]));
|
||||
}),
|
||||
);
|
||||
const queryClient = createTestQueryClient();
|
||||
|
||||
@@ -143,8 +143,8 @@ const AuthProvider: FC<PropsWithChildren> = (props) => {
|
||||
refresh,
|
||||
clear: clearSession,
|
||||
});
|
||||
return () => configureAuthClient(null);
|
||||
});
|
||||
useEffect(() => () => configureAuthClient(null), []);
|
||||
|
||||
return (
|
||||
<AuthContext
|
||||
|
||||
Reference in New Issue
Block a user