mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-20 15:19:16 +00:00
* feat(ai): add Cursor SDK agent support * fix(ai): harden Cursor SDK support * fix(ai): address Cursor SDK review findings * fix(ai): refresh Cursor environment handling * fix(ai): refresh Cursor discovery scans * fix(ai): enable Cursor recheck without path * Use official Cursor agent icon * Clarify Cursor SDK setup requirements * Split Cursor SDK setup status * Simplify Cursor settings copy * Improve Cursor API key error * Add safe Cursor auth diagnostics * Disable Cursor local sandbox by default * Show Cursor MCP tool names in tool cards * Add spacing inside tool call groups
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
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(/<button\b[^>]*>/);
|
|
return match?.[0] ?? "";
|
|
}
|
|
|
|
test("Cursor check button stays enabled without a custom path", () => {
|
|
const markup = renderToStaticMarkup(
|
|
<CopilotCliCard
|
|
pathInfo={{ path: null, version: null, available: false }}
|
|
isResolvingPath={false}
|
|
customPath=""
|
|
onCustomPathChange={() => {}}
|
|
onRecheckPath={() => {}}
|
|
i18nPrefix="ai.cursor"
|
|
allowEmptyCheck
|
|
/>,
|
|
);
|
|
|
|
assert.equal(firstButton(markup).includes("disabled=\"\""), false);
|
|
});
|
|
|
|
test("Copilot check button still requires a custom path", () => {
|
|
const markup = renderToStaticMarkup(
|
|
<CopilotCliCard
|
|
pathInfo={{ path: null, version: null, available: false }}
|
|
isResolvingPath={false}
|
|
customPath=""
|
|
onCustomPathChange={() => {}}
|
|
onRecheckPath={() => {}}
|
|
/>,
|
|
);
|
|
|
|
assert.equal(firstButton(markup).includes("disabled=\"\""), true);
|
|
});
|