Skip to content

Commit b03d2da

Browse files
PierrunoYTclaude
andcommitted
test: give delegation test doubles the window-local mode lookup
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 4c6ca84 commit b03d2da

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎src/__tests__/ClineProvider.delegation.spec.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
295295
isViewLaunched: false,
296296
taskHistoryStore: makeStoreStub(),
297297
providerSettingsManager,
298+
// No window-local choice is recorded, so the lookup reaches the shared manager.
299+
getModeConfigId: (mode: string) => providerSettingsManager.getModeConfigId(mode),
298300
context: { workspaceState: { get: workspaceGet } },
299301
} as unknown as ClineProvider
300302

@@ -347,6 +349,7 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
347349
? vi.fn().mockRejectedValue(savedProfile)
348350
: vi.fn().mockResolvedValue(savedProfile)
349351
const log = vi.fn()
352+
const getModeConfigId = vi.fn().mockResolvedValue(savedConfigId)
350353
const provider = {
351354
taskScheduler: new TaskScheduler(),
352355
emit: vi.fn(),
@@ -356,10 +359,9 @@ describe("ClineProvider.delegateParentAndOpenChild()", () => {
356359
log,
357360
isViewLaunched: false,
358361
taskHistoryStore: makeStoreStub(),
359-
providerSettingsManager: {
360-
getModeConfigId: vi.fn().mockResolvedValue(savedConfigId),
361-
getProfile,
362-
},
362+
providerSettingsManager: { getModeConfigId, getProfile },
363+
// No window-local choice is recorded, so the lookup reaches the shared manager.
364+
getModeConfigId,
363365
context: { workspaceState: { get: vi.fn().mockReturnValue(false) } },
364366
} as unknown as ClineProvider
365367

0 commit comments

Comments
 (0)