From d49c1e995c0a7622d11eb95932a5854f6b235445 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Fri, 24 Jan 2025 12:50:04 -0500 Subject: [PATCH] Trivial: fix test to reflect differences between 10.1/11.0. --- .../src/VuFindTest/Mink/SearchFacetsTest.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SearchFacetsTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SearchFacetsTest.php index d38c100a94b..41ab94c995e 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SearchFacetsTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SearchFacetsTest.php @@ -1525,12 +1525,11 @@ public function testMultiSelectOnAdvancedSearch(bool $changeLanguage, bool $incl ); // Make sure we have the expected number of filters applied on screen and in the URL query: - $this->assertCount(2, $page->findAll('css', '.facet.active')); - $this->assertCount($includeCheckbox ? 1 : 0, $page->findAll('css', '.checkbox-filter [data-checked="true"]')); + $appliedFacetCount = $includeCheckbox ? 3 : 2; + $this->assertCount($appliedFacetCount, $page->findAll('css', '.facet.active')); $query = parse_url($session->getCurrentUrl(), PHP_URL_QUERY); parse_str($query, $queryArray); - $expectedFilterCount = $includeCheckbox ? 3 : 2; - $this->assertCount($expectedFilterCount, $queryArray['filter']); + $this->assertCount($appliedFacetCount, $queryArray['filter']); // If configured, flip-flop language again to potentially modify filter params: if ($changeLanguage) { @@ -1539,10 +1538,10 @@ public function testMultiSelectOnAdvancedSearch(bool $changeLanguage, bool $incl // Let's also confirm that we can now remove the filters: $this->clickCss($page, '.js-user-selection-multi-filters'); - $this->clickCss($page, '.facet.active'); - $this->clickCss($page, '.facet.active'); + for ($i = 0; $i < $appliedFacetCount; $i++) { + $this->clickCss($page, '.facet.active'); + } $this->clickCss($page, '.js-apply-multi-facets-selection'); - $this->assertCount(0, $page->findAll('css', '.facet.active')); } }