From 00b4319c44b528c3357b17c4d94d3a856459ebe0 Mon Sep 17 00:00:00 2001 From: le king fu Date: Tue, 13 Oct 2026 21:06:07 -0400 Subject: [PATCH] test(import): pin the read-only source name of the configuration panel Co-Authored-By: Claude Opus 5.5 --- .../import/SourceConfigPanel.test.tsx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/components/import/SourceConfigPanel.test.tsx 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"); + }); +});