import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it, vi } from "vitest";
vi.mock("@/lib/api/api-fetch", () => ({ apiFetchRaw: vi.fn() }));
import { I18nProvider } from "@/lib/i18n/context";
import { TestConnectionButton } from "../test-connection-button";
function render(unsavedChanges?: boolean) {
return renderToStaticMarkup(
,
);
}
// The test route sends through the saved config. With an unsaved change on
// the card, a test would report on something other than what is on screen.
describe("TestConnectionButton with unsaved changes", () => {
it("locks the button and says to save first", () => {
const html = render(true);
expect(html).toMatch(/