Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 65a15d5

Browse files
committed
fix(tests): add getState() mock to requestOpenAiCodexRateLimits tests
The tests were failing when run in isolation due to missing getState() mock with currentApiConfigName and listApiConfigMeta properties. Added the mock to the beforeEach block similar to other describe blocks in the file.
1 parent 11cddf8 commit 65a15d5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/core/webview/__tests__/webviewMessageHandler.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,10 @@ describe("webviewMessageHandler - requestRouterModels", () => {
599599
describe("webviewMessageHandler - requestOpenAiCodexRateLimits", () => {
600600
beforeEach(() => {
601601
vi.clearAllMocks()
602+
mockClineProvider.getState = vi.fn().mockResolvedValue({
603+
currentApiConfigName: "test-profile",
604+
listApiConfigMeta: [{ id: "test-profile-id", name: "test-profile" }],
605+
})
602606
mockGetAccessToken.mockResolvedValue(null)
603607
mockGetAccountId.mockResolvedValue(null)
604608
})

0 commit comments

Comments
 (0)