Skip to content

Commit 1b64431

Browse files
committed
test(webview): align mode config test with view-local state
1 parent 7120572 commit 1b64431

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,13 +1744,8 @@ describe("ClineProvider", () => {
17441744
setModeConfig: vi.fn(),
17451745
} as any
17461746

1747-
// Mock the ContextProxy's getValue method to return the current config name
1748-
const contextProxy = (provider as any).contextProxy
1749-
const getValueSpy = vi.spyOn(contextProxy, "getValue")
1750-
getValueSpy.mockImplementation((key: any) => {
1751-
if (key === "currentApiConfigName") return "current-config"
1752-
return undefined
1753-
})
1747+
// Set the active config through ContextProxy so getState() sees the same state as runtime code.
1748+
await (provider as any).contextProxy.setValue("currentApiConfigName", "current-config")
17541749

17551750
// Switch to architect mode
17561751
await provider.handleModeSwitch("architect")

0 commit comments

Comments
 (0)