Skip to content

Commit e7d6903

Browse files
committed
test(zoo-gateway): assert full cache survives empty model response
Strengthen the empty-response case to verify pre-existing providers (openrouter) are preserved, not just that zoo-gateway stays unset. Addresses CodeRabbit feedback on PR #490.
1 parent e1d8860 commit e7d6903

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

webview-ui/src/components/ui/hooks/__tests__/useZooGatewayRouterModelsSync.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ describe("useZooGatewayRouterModelsSync", () => {
110110
await waitFor(() => expect(mockFetchRouterModels).toHaveBeenCalled())
111111
const cached = queryClient.getQueryData<RouterModels>(["routerModels", "all"])
112112
expect(cached?.["zoo-gateway"]).toBeUndefined()
113+
// The whole cache must survive an empty result, not just the zoo-gateway key.
114+
expect(cached?.openrouter).toEqual({ "openai/gpt-4": modelInfo })
113115
})
114116

115117
it("swallows fetch errors", async () => {

0 commit comments

Comments
 (0)