cte hai 9 meses
pai
achega
dd7d9824ba

+ 10 - 14
webview-ui/src/components/common/VSCodeButtonLink.tsx

@@ -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>
+)

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

@@ -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"

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

@@ -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