authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-18 02:51:10-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-18 21:59:17-08:00
log200e43e44c52e0f819f7162a6a3fb7551a9ee013
treeead7bc195a334ab06d0c918ba24f67c72dd2bd2b
parent6aea858ed85fc3e8e4b41d6164b428a80895dcc7

Use QueryClient to execute checkpoint diff query in test

- run `checkpointDiffQueryOptions` through `QueryClient.fetchQuery` - validate `getCheckpointDiff` call via React Query execution path

1 files changed, 3 insertions(+), 1 deletions(-)

apps/web/src/lib/providerReactQuery.test.ts+3-1
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1import type { NativeApi } from "@t3tools/contracts";1import type { NativeApi } from "@t3tools/contracts";
2import { QueryClient } from "@tanstack/react-query";
2import { describe, expect, it, vi } from "vitest";3import { describe, expect, it, vi } from "vitest";
3import { checkpointDiffQueryOptions, providerQueryKeys } from "./providerReactQuery";4import { checkpointDiffQueryOptions, providerQueryKeys } from "./providerReactQuery";
45
...@@ -42,7 +43,8 @@ describe("checkpointDiffQueryOptions", () => {...@@ -42,7 +43,8 @@ describe("checkpointDiffQueryOptions", () => {
42 cacheScope: "turn:abc",43 cacheScope: "turn:abc",
43 });44 });
4445
45 await options.queryFn();46 const queryClient = new QueryClient();
47 await queryClient.fetchQuery(options);
4648
47 expect(getCheckpointDiff).toHaveBeenCalledWith({49 expect(getCheckpointDiff).toHaveBeenCalledWith({
48 sessionId: "session-id",50 sessionId: "session-id",