Skip to content

Commit 0e9337f

Browse files
committed
test(webview): pin kept-switch task state and history on the committed mode
1 parent 786a1ce commit 0e9337f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/core/webview/__tests__/ClineProvider.sticky-mode.spec.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,11 @@ describe("ClineProvider - Sticky Mode", () => {
11501150
expect(provider.getValue("mode")).toBe("architect")
11511151
expect(provider["viewLocalState"].mode).toBe("architect")
11521152
expect(provider.contextProxy.getValue("currentApiConfigName")).toBe("architect-profile")
1153+
// The kept switch must leave the task state and history on the
1154+
// committed mode too: rolling the task-side writes back here would
1155+
// diverge the task from the mode stores.
1156+
expect(mockTask["_taskMode"]).toBe("architect")
1157+
expect(updateTaskHistorySpy).toHaveBeenLastCalledWith(expect.objectContaining({ mode: "architect" }))
11531158
})
11541159

11551160
it("reports ModeChanged for a switch the catch keeps after activation wrote", async () => {

0 commit comments

Comments
 (0)