Skip to content

Commit 5ddb92c

Browse files
committed
test(provider): target queued mode switches explicitly
1 parent 8273a44 commit 5ddb92c

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,18 +1155,11 @@ describe("ClineProvider - Sticky Mode", () => {
11551155
return Promise.resolve([])
11561156
})
11571157

1158-
// Mock getCurrentTask to return different tasks
1159-
const getCurrentTaskSpy = vi.spyOn(provider, "getCurrentTask")
1160-
1161-
// Simulate simultaneous mode switches for different tasks
1162-
getCurrentTaskSpy.mockReturnValue(task1 as any)
1163-
const switch1 = provider.handleModeSwitch("architect")
1164-
1165-
getCurrentTaskSpy.mockReturnValue(task2 as any)
1166-
const switch2 = provider.handleModeSwitch("debug")
1167-
1168-
getCurrentTaskSpy.mockReturnValue(task3 as any)
1169-
const switch3 = provider.handleModeSwitch("code")
1158+
// Simulate simultaneous mode switches for distinct, explicitly targeted tasks.
1159+
// These lightweight task doubles only implement the members exercised by this test.
1160+
const switch1 = provider.handleModeSwitch("architect", task1 as unknown as Task)
1161+
const switch2 = provider.handleModeSwitch("debug", task2 as unknown as Task)
1162+
const switch3 = provider.handleModeSwitch("code", task3 as unknown as Task)
11701163

11711164
await Promise.all([switch1, switch2, switch3])
11721165

src/eslint-suppressions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@
10911091
},
10921092
"core/webview/__tests__/ClineProvider.sticky-mode.spec.ts": {
10931093
"@typescript-eslint/no-explicit-any": {
1094-
"count": 40
1094+
"count": 37
10951095
}
10961096
},
10971097
"core/webview/__tests__/ClineProvider.sticky-profile.spec.ts": {

0 commit comments

Comments
 (0)