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 <noreply@anthropic.com>
This commit is contained in:
parent
66bdb19f44
commit
038bc41cb3
1 changed files with 17 additions and 0 deletions
|
|
@ -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)", () => {
|
describe("ImportPage — files placed directly in the import folder (#427)", () => {
|
||||||
const WARNING = "t(import.rootFiles.message[";
|
const WARNING = "t(import.rootFiles.message[";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue