Skip to content

Commit dd7d982

Browse files
committed
Fix tests
1 parent 66e036e commit dd7d982

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

webview-ui/src/components/common/VSCodeButtonLink.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@ interface VSCodeButtonLinkProps {
77
[key: string]: any
88
}
99

10-
const VSCodeButtonLink: React.FC<VSCodeButtonLinkProps> = ({ href, children, ...props }) => {
11-
return (
12-
<a
13-
href={href}
14-
style={{
15-
textDecoration: "none",
16-
color: "inherit",
17-
}}>
18-
<VSCodeButton {...props}>{children}</VSCodeButton>
19-
</a>
20-
)
21-
}
22-
23-
export default VSCodeButtonLink
10+
export const VSCodeButtonLink = ({ href, children, ...props }: VSCodeButtonLinkProps) => (
11+
<a
12+
href={href}
13+
style={{
14+
textDecoration: "none",
15+
color: "inherit",
16+
}}>
17+
<VSCodeButton {...props}>{children}</VSCodeButton>
18+
</a>
19+
)

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
import { ExtensionMessage } from "../../../../src/shared/ExtensionMessage"
3636

3737
import { vscode } from "../../utils/vscode"
38-
import VSCodeButtonLink from "../common/VSCodeButtonLink"
38+
import { VSCodeButtonLink } from "../common/VSCodeButtonLink"
3939
import { ModelInfoView } from "./ModelInfoView"
4040
import { ModelPicker } from "./ModelPicker"
4141
import { TemperatureControl } from "./TemperatureControl"

webview-ui/src/components/settings/__tests__/ApiOptions.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
// npx jest src/components/settings/__tests__/ApiOptions.test.ts
2+
13
import { render, screen } from "@testing-library/react"
2-
import ApiOptions from "../ApiOptions"
4+
35
import { ExtensionStateContextProvider } from "../../../context/ExtensionStateContext"
6+
import ApiOptions from "../ApiOptions"
47

58
// Mock VSCode components
69
jest.mock("@vscode/webview-ui-toolkit/react", () => ({
@@ -13,6 +16,7 @@ jest.mock("@vscode/webview-ui-toolkit/react", () => ({
1316
VSCodeLink: ({ children, href }: any) => <a href={href}>{children}</a>,
1417
VSCodeRadio: ({ children, value, checked }: any) => <input type="radio" value={value} checked={checked} />,
1518
VSCodeRadioGroup: ({ children }: any) => <div>{children}</div>,
19+
VSCodeButton: ({ children }: any) => <div>{children}</div>,
1620
}))
1721

1822
// Mock other components

0 commit comments

Comments
 (0)