test(deploy): preserve empty Foundry map filters

This commit is contained in:
Codex
2026-08-05 19:37:53 +03:00
parent b48b6dbfc9
commit 4f75f57177
2 changed files with 8 additions and 5 deletions
@@ -64,8 +64,8 @@ async function assertFilterToggleBoundary() {
const helper = await readFile(resolve(foundryRoot, files[1]), "utf8");
for (const marker of [
"toggleMapPresentationFacetSelection",
"const { [field]: _removed, ...unconstrained } = facets",
"return unconstrained",
"const { [field]: _removed, ...remaining } = facets",
"return { [field]: [] }",
]) {
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");
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",
"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")
regression = (payload / EXPECTED_FILES[2]).read_text(encoding="utf-8")
self.assertIn("toggleMapPresentationFacetSelection", helper)
self.assertIn("return unconstrained", helper)
self.assertIn("return { [field]: [] }", helper)
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:
members = archive.getmembers()