test(FN-4924): align useAgents cache assertions with envelope format
Fusion-Task-Id: FN-4924 Fusion-Task-Lineage: a5f882e1-8348-4f9d-89be-15994adc148c
This commit is contained in:
committed by
gsxdsm
parent
cf12704885
commit
eaa67616a4
@@ -209,8 +209,18 @@ describe("useAgents", () => {
|
||||
renderHook(() => useAgents());
|
||||
|
||||
await waitFor(() => {
|
||||
expect(JSON.parse(window.localStorage.getItem(SWR_CACHE_KEYS.AGENTS) ?? "[]")).toEqual(agents);
|
||||
expect(JSON.parse(window.localStorage.getItem(SWR_CACHE_KEYS.AGENT_STATS) ?? "null")).toEqual(stats);
|
||||
const agentsEnvelope = JSON.parse(window.localStorage.getItem(SWR_CACHE_KEYS.AGENTS) ?? "null") as {
|
||||
savedAt?: number;
|
||||
data?: unknown;
|
||||
};
|
||||
const statsEnvelope = JSON.parse(window.localStorage.getItem(SWR_CACHE_KEYS.AGENT_STATS) ?? "null") as {
|
||||
savedAt?: number;
|
||||
data?: unknown;
|
||||
};
|
||||
expect(typeof agentsEnvelope.savedAt).toBe("number");
|
||||
expect(agentsEnvelope.data).toEqual(agents);
|
||||
expect(typeof statsEnvelope.savedAt).toBe("number");
|
||||
expect(statsEnvelope.data).toEqual(stats);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user