From 038bc41cb3f60acd4d83345b98ea4d3a1b3d01ee Mon Sep 17 00:00:00 2001 From: le king fu Date: Sun, 18 Oct 2026 20:31:50 -0400 Subject: [PATCH] test(import): pin the empty state's variant for a folder stored as "" (#384) With folderName as its only prop, ImportEmptyState tells "no folder" from "a folder" by null alone. The page hands "" for an import folder stored as "", as hasFolder did, so the empty state keeps the "no source" variant the step card describes. Co-Authored-By: Claude Opus 5.5 --- src/pages/ImportPage.render.test.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/pages/ImportPage.render.test.tsx b/src/pages/ImportPage.render.test.tsx index 3270e49..c4731b0 100644 --- a/src/pages/ImportPage.render.test.tsx +++ b/src/pages/ImportPage.render.test.tsx @@ -303,6 +303,23 @@ describe("ImportPage — before the folder is read (#384)", () => { }); }); +describe("ImportPage — the empty state's one prop (#384)", () => { + it("an import folder stored as \"\": the 'no source' variant, as the card says", () => { + // `folderName` alone tells the variants apart: the page hands "" for "", + // as `hasFolder` (`importFolder !== null`) did, so the empty state and + // the card (`hasFolder` of `importCardModel`) keep speaking of a folder. + harness.wizard = wizard({ importFolder: "" }); + harness.onboarding = path(ZERO, true); + const html = render(); + expect(html).toContain("t(import.empty.noSources.title)"); + expect(html).not.toContain("import.empty.noFolder.title"); + expect(sentence(html)).toBe( + "t(onboarding.card.import.noSources[folder=,refresh=t(import.empty.refresh),sample=t(import.empty.createSample)])", + ); + expect(highlighted(html).inner).toBe("t(import.empty.createSample)"); + }); +}); + describe("ImportPage — files placed directly in the import folder (#427)", () => { const WARNING = "t(import.rootFiles.message[";