Skip to content

Commit 7df5d1f

Browse files
committed
feat: Add ApiConfiguration type assertion and relevant fields in TaskHeader tests
1 parent b3ecf4c commit 7df5d1f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import React from "react"
22
import { render, screen } from "@testing-library/react"
33
import TaskHeader from "../TaskHeader"
4-
5-
// Mock the translation function
6-
jest.mock("react-i18next", () => ({
7-
useTranslation: () => ({ t: (key: string) => key }),
8-
}))
4+
import { ApiConfiguration } from "../../../../../src/shared/api"
95

106
// Mock the vscode API
117
jest.mock("@/utils/vscode", () => ({
@@ -19,7 +15,9 @@ jest.mock("../../../context/ExtensionStateContext", () => ({
1915
useExtensionState: () => ({
2016
apiConfiguration: {
2117
apiProvider: "anthropic",
22-
},
18+
apiKey: "test-api-key", // Add relevant fields
19+
apiModelId: "claude-3-opus-20240229", // Add relevant fields
20+
} as ApiConfiguration, // Optional: Add type assertion if ApiConfiguration is imported
2321
currentTaskItem: null,
2422
}),
2523
}))

0 commit comments

Comments
 (0)