Skip to content

Commit 36cfa31

Browse files
author
ShayBC
committed
try to fix test
1 parent 1ff403d commit 36cfa31

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,8 @@ describe("ClineProvider", () => {
860860
abortTask: jest.fn(),
861861
handleWebviewAskResponse: jest.fn(),
862862
} as unknown as Cline
863-
provider.addClineToStack(mockCline)
863+
const newMockCline = Object.create(mockCline)
864+
provider.addClineToStack(newMockCline)
864865

865866
// Mock getTaskWithId
866867
;(provider as any).getTaskWithId = jest.fn().mockResolvedValue({
@@ -872,15 +873,15 @@ describe("ClineProvider", () => {
872873
await messageHandler({ type: "deleteMessage", value: 4000 })
873874

874875
// Verify correct messages were kept
875-
expect(mockCline.overwriteClineMessages).toHaveBeenCalledWith([
876+
expect(newMockCline.overwriteClineMessages).toHaveBeenCalledWith([
876877
mockMessages[0],
877878
mockMessages[1],
878879
mockMessages[4],
879880
mockMessages[5],
880881
])
881882

882883
// Verify correct API messages were kept
883-
expect(mockCline.overwriteApiConversationHistory).toHaveBeenCalledWith([
884+
expect(newMockCline.overwriteApiConversationHistory).toHaveBeenCalledWith([
884885
mockApiHistory[0],
885886
mockApiHistory[1],
886887
mockApiHistory[4],

0 commit comments

Comments
 (0)