import test from "node:test"; import assert from "node:assert/strict"; import React from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { CopilotCliCard } from "./CopilotCliCard"; function firstButton(markup: string): string { const match = markup.match(/]*>/); return match?.[0] ?? ""; } test("Cursor check button stays enabled without a custom path", () => { const markup = renderToStaticMarkup( {}} onRecheckPath={() => {}} i18nPrefix="ai.cursor" allowEmptyCheck />, ); assert.equal(firstButton(markup).includes("disabled=\"\""), false); }); test("Copilot check button still requires a custom path", () => { const markup = renderToStaticMarkup( {}} onRecheckPath={() => {}} />, ); assert.equal(firstButton(markup).includes("disabled=\"\""), true); });