Skip to content

Commit 247f836

Browse files
committed
Fix browser test: mock provider.listModels and provider.getUsage RPCs
The ChatView browser test mock WS handler didn't handle provider.listModels and provider.getUsage RPCs for fork's extra providers, causing React Query "data cannot be undefined" errors that crashed the test environment.
1 parent 42a47e6 commit 247f836

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/web/src/components/ChatView.browser.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,12 @@ function resolveWsRpc(body: WsRequestEnvelope["body"]): unknown {
552552
pr: null,
553553
};
554554
}
555+
if (tag === WS_METHODS.providerListModels) {
556+
return { models: [] };
557+
}
558+
if (tag === WS_METHODS.providerGetUsage) {
559+
return { quotaSnapshots: [] };
560+
}
555561
if (tag === WS_METHODS.projectsSearchEntries) {
556562
return {
557563
entries: [],

0 commit comments

Comments
 (0)