// SourceNameDisplay (#426). No jsdom: rendered to static markup with the shared
// marked `t`, so the label and hint keys are read as written.
import { describe, it, expect, vi } from "vitest";
import { renderToStaticMarkup } from "react-dom/server";
vi.mock("react-i18next", async () => (await import("../../test/i18nMock")).i18nMock());
import SourceNameDisplay from "./SourceNameDisplay";
const render = (folderName: string) =>
renderToStaticMarkup();
describe("SourceNameDisplay (#426)", () => {
it("shows the subfolder name, the label and the hint", () => {
const html = render("Desjardins chèques");
expect(html).toContain("Desjardins chèques");
expect(html).toContain("t(import.config.sourceName)");
expect(html).toContain("t(import.config.sourceNameHint)");
});
it("has no input field: the name cannot be edited", () => {
const html = render("Tangerine");
expect(html).not.toContain("