Fix tests

This commit is contained in:
cte 2025-03-05 12:28:17 -08:00
parent 66e036eaa2
commit dd7d9824ba
3 changed files with 16 additions and 16 deletions

View file

@ -7,17 +7,13 @@ interface VSCodeButtonLinkProps {
[key: string]: any
}
const VSCodeButtonLink: React.FC<VSCodeButtonLinkProps> = ({ href, children, ...props }) => {
return (
<a
href={href}
style={{
textDecoration: "none",
color: "inherit",
}}>
<VSCodeButton {...props}>{children}</VSCodeButton>
</a>
)
}
export default VSCodeButtonLink
export const VSCodeButtonLink = ({ href, children, ...props }: VSCodeButtonLinkProps) => (
<a
href={href}
style={{
textDecoration: "none",
color: "inherit",
}}>
<VSCodeButton {...props}>{children}</VSCodeButton>
</a>
)

View file

@ -35,7 +35,7 @@ import {
import { ExtensionMessage } from "../../../../src/shared/ExtensionMessage"
import { vscode } from "../../utils/vscode"
import VSCodeButtonLink from "../common/VSCodeButtonLink"
import { VSCodeButtonLink } from "../common/VSCodeButtonLink"
import { ModelInfoView } from "./ModelInfoView"
import { ModelPicker } from "./ModelPicker"
import { TemperatureControl } from "./TemperatureControl"

View file

@ -1,6 +1,9 @@
// npx jest src/components/settings/__tests__/ApiOptions.test.ts
import { render, screen } from "@testing-library/react"
import ApiOptions from "../ApiOptions"
import { ExtensionStateContextProvider } from "../../../context/ExtensionStateContext"
import ApiOptions from "../ApiOptions"
// Mock VSCode components
jest.mock("@vscode/webview-ui-toolkit/react", () => ({
@ -13,6 +16,7 @@ jest.mock("@vscode/webview-ui-toolkit/react", () => ({
VSCodeLink: ({ children, href }: any) => <a href={href}>{children}</a>,
VSCodeRadio: ({ children, value, checked }: any) => <input type="radio" value={value} checked={checked} />,
VSCodeRadioGroup: ({ children }: any) => <div>{children}</div>,
VSCodeButton: ({ children }: any) => <div>{children}</div>,
}))
// Mock other components