test(deploy): preserve empty Foundry map filters
This commit is contained in:
@@ -64,8 +64,8 @@ async function assertFilterToggleBoundary() {
|
|||||||
const helper = await readFile(resolve(foundryRoot, files[1]), "utf8");
|
const helper = await readFile(resolve(foundryRoot, files[1]), "utf8");
|
||||||
for (const marker of [
|
for (const marker of [
|
||||||
"toggleMapPresentationFacetSelection",
|
"toggleMapPresentationFacetSelection",
|
||||||
"const { [field]: _removed, ...unconstrained } = facets",
|
"const { [field]: _removed, ...remaining } = facets",
|
||||||
"return unconstrained",
|
"return { [field]: [] }",
|
||||||
]) {
|
]) {
|
||||||
if (!helper.includes(marker)) throw new Error(`foundry_filter_toggle_helper_missing:${marker}`);
|
if (!helper.includes(marker)) throw new Error(`foundry_filter_toggle_helper_missing:${marker}`);
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,9 @@ async function assertFilterToggleBoundary() {
|
|||||||
|
|
||||||
const test = await readFile(resolve(foundryRoot, files[2]), "utf8");
|
const test = await readFile(resolve(foundryRoot, files[2]), "utf8");
|
||||||
for (const marker of [
|
for (const marker of [
|
||||||
"interactive deselect of the last chip removes the facet constraint",
|
"interactive deselect of the last chip preserves the zero-match state",
|
||||||
|
"the first chip selected after a saved empty view removes every empty sentinel",
|
||||||
|
"a complete interactive toggle cycle returns to zero matches instead of all",
|
||||||
"interactive deselect preserves other values and facet constraints",
|
"interactive deselect preserves other values and facet constraints",
|
||||||
"deselecting the last chip remains empty and never normalizes to all",
|
"deselecting the last chip remains empty and never normalizes to all",
|
||||||
]) {
|
]) {
|
||||||
|
|||||||
@@ -75,9 +75,10 @@ class ModuleFoundryFilterToggleArtifactTest(unittest.TestCase):
|
|||||||
preview = (payload / EXPECTED_FILES[0]).read_text(encoding="utf-8")
|
preview = (payload / EXPECTED_FILES[0]).read_text(encoding="utf-8")
|
||||||
regression = (payload / EXPECTED_FILES[2]).read_text(encoding="utf-8")
|
regression = (payload / EXPECTED_FILES[2]).read_text(encoding="utf-8")
|
||||||
self.assertIn("toggleMapPresentationFacetSelection", helper)
|
self.assertIn("toggleMapPresentationFacetSelection", helper)
|
||||||
self.assertIn("return unconstrained", helper)
|
self.assertIn("return { [field]: [] }", helper)
|
||||||
self.assertIn("filters: toggleMapPresentationFacetSelection(filters, field, value)", preview)
|
self.assertIn("filters: toggleMapPresentationFacetSelection(filters, field, value)", preview)
|
||||||
self.assertIn("interactive deselect of the last chip removes the facet constraint", regression)
|
self.assertIn("interactive deselect of the last chip preserves the zero-match state", regression)
|
||||||
|
self.assertIn("a complete interactive toggle cycle returns to zero matches instead of all", regression)
|
||||||
|
|
||||||
with tarfile.open(first_artifact, "r:gz") as archive:
|
with tarfile.open(first_artifact, "r:gz") as archive:
|
||||||
members = archive.getmembers()
|
members = archive.getmembers()
|
||||||
|
|||||||
Reference in New Issue
Block a user