(queryClient: QueryClient)
| 129 | } |
| 130 | }) |
| 131 | |
| 132 | it("clearing read dependencies drops the query from derivation", () => { |
| 133 | const inventoryKey = ["$Inventory", "List", undefined] |
| 134 | setQueryReadDependencies(inventoryKey, new Set([repo])) |
| 135 | clearQueryReadDependencies(inventoryKey) |
| 136 | expect(getDerivedInvalidationKeys(new Set([repo]))).toEqual([]) |
| 137 | }) |
| 138 | |
| 139 | it("derivation matches on both dependency type and name (repo vs signal)", () => { |
| 140 | const key = ["$Live", "Feed", undefined] |
| 141 | setQueryReadDependencies(key, new Set([DataDependencies.signal("Feed")])) |
| 142 | try { |
| 143 | // Same name but different type (repo "Feed") must NOT intersect a signal read. |
| 144 | expect(getDerivedInvalidationKeys(new Set([DataDependencies.repo("Feed")]))).toEqual([]) |
| 145 | // Same type and name does intersect. |
| 146 | expect(getDerivedInvalidationKeys(new Set([DataDependencies.signal("Feed")]))).toEqual([key]) |
| 147 | } finally { |
| 148 | clearQueryReadDependencies(key) |
no test coverage detected
searching dependent graphs…