Skip to content

Commit 98017d0

Browse files
committed
fix test
1 parent 855c856 commit 98017d0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

webview-ui/src/components/chat/__tests__/TaskHeader.test.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jest.mock("react-i18next", () => ({
1313
useTranslation: () => ({
1414
t: (key: string) => key, // Simple mock that returns the key
1515
}),
16+
// Mock initReactI18next to prevent initialization errors in tests
17+
initReactI18next: {
18+
type: "3rdParty",
19+
init: jest.fn(),
20+
},
1621
}))
1722

1823
// Mock the vscode API
@@ -35,7 +40,7 @@ jest.mock("@src/context/ExtensionStateContext", () => ({
3540
apiKey: "test-api-key", // Add relevant fields
3641
apiModelId: "claude-3-opus-20240229", // Add relevant fields
3742
} as ProviderSettings, // Optional: Add type assertion if ProviderSettings is imported
38-
currentTaskItem: { id: "test-task-id" }, // Add a mock currentTaskItem for the condense button
43+
currentTaskItem: { id: "test-task-id" },
3944
}),
4045
}))
4146

0 commit comments

Comments
 (0)