diff --git a/src/components/import/SourceConfigPanel.test.tsx b/src/components/import/SourceConfigPanel.test.tsx new file mode 100644 index 0000000..db41129 --- /dev/null +++ b/src/components/import/SourceConfigPanel.test.tsx @@ -0,0 +1,44 @@ +// SourceConfigPanel — the source name is read-only, the subfolder's (#426). +// No jsdom: rendered to static markup with the shared marked `t`. +import { describe, it, expect, vi } from "vitest"; +import { renderToStaticMarkup } from "react-dom/server"; + +vi.mock("react-i18next", async () => (await import("../../test/i18nMock")).i18nMock()); + +import SourceConfigPanel from "./SourceConfigPanel"; +import { initialWizardState } from "../../hooks/useImportWizard"; + +const noop = () => undefined; + +const render = () => + renderToStaticMarkup( + , + ); + +describe("SourceConfigPanel — source name (#426)", () => { + it("shows the subfolder name with its hint", () => { + const html = render(); + expect(html).toContain("t(import.config.sourceNameHint)"); + expect(html).toMatch(/]*>Desjardins<\/p>/); + }); + + it("has no field holding the configured name", () => { + const html = render(); + expect(html).not.toContain("Mon compte chèques"); + }); +});