forked from jordanlambrecht/tracker-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery-options.test.ts
More file actions
34 lines (28 loc) · 1.06 KB
/
Copy pathquery-options.test.ts
File metadata and controls
34 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// src/lib/__tests__/query-options.test.ts
//
// Tests for shared TanStack Query options objects.
// Verifies queryKey values and that queryFn is callable.
// Does not test fetch behavior (network/integration concern).
import { describe, expect, it } from "vitest"
import { clientQueryOptions, trackerQueryOptions } from "@/lib/query-options"
describe("clientQueryOptions", () => {
it("has the correct queryKey", () => {
expect(clientQueryOptions.queryKey).toEqual(["clients"])
})
it("has a queryFn function", () => {
expect(typeof clientQueryOptions.queryFn).toBe("function")
})
})
describe("trackerQueryOptions", () => {
it("has the correct queryKey", () => {
expect(trackerQueryOptions.queryKey).toEqual(["trackers"])
})
it("has a queryFn function", () => {
expect(typeof trackerQueryOptions.queryFn).toBe("function")
})
})
describe("query option key uniqueness", () => {
it("clientQueryOptions and trackerQueryOptions have distinct queryKeys", () => {
expect(clientQueryOptions.queryKey).not.toEqual(trackerQueryOptions.queryKey)
})
})