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.
This commit is contained in:
Roo Code 2026-01-31 05:51:04 +00:00
parent 11cddf8bd2
commit 65a15d54e4

View file

@ -599,6 +599,10 @@ describe("webviewMessageHandler - requestRouterModels", () => {
describe("webviewMessageHandler - requestOpenAiCodexRateLimits", () => {
beforeEach(() => {
vi.clearAllMocks()
mockClineProvider.getState = vi.fn().mockResolvedValue({
currentApiConfigName: "test-profile",
listApiConfigMeta: [{ id: "test-profile-id", name: "test-profile" }],
})
mockGetAccessToken.mockResolvedValue(null)
mockGetAccountId.mockResolvedValue(null)
})