From 32875b0ea94ca8e50e772b19ec987c2f91533644 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Fri, 8 Dec 2023 06:45:36 -0500 Subject: [PATCH] Expand Mink test to exercise more button after sorting facets. (#3252) --- .../src/VuFindTest/Mink/SearchFacetsTest.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 fa1b3ffb291..4903978867e 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SearchFacetsTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SearchFacetsTest.php @@ -200,11 +200,33 @@ protected function facetListProcedure(Element $page, int $limit, bool $exclusion $excludes = $page ->findAll('css', '#modal #facet-list-index .exclude'); $this->assertEquals($exclusionActive ? $limit : 0, count($excludes)); - // sort by index again + // sort by count again $this->clickCss($page, '[data-sort="count"]'); $this->waitForPageLoad($page); $items = $page->findAll('css', '#modal #facet-list-count .js-facet-item'); $this->assertEquals($limit * 2, count($items)); // maintain number of items + // now back to title, to see if loading a second page works + $this->clickCss($page, '[data-sort="index"]'); + $this->waitForPageLoad($page); + $this->clickCss($page, '#modal #facet-list-index .js-facet-next-page'); + $this->waitForPageLoad($page); + $items = $page->findAll('css', '#modal #facet-list-index .js-facet-item'); + $this->assertCount($limit * 2, $items); // reset number of items + $this->assertEquals( + 'Fiction 7 results 7 ' . $excludeControl + . 'The Study Of P|pes 1 results 1 ' . $excludeControl + . 'The Study and Scor_ng of Dots.and-Dashes:Colons 1 results 1 ' . $excludeControl + . 'The Study of "Important" Things 1 results 1 ' . $excludeControl + . 'The Study of %\'s? 1 results 1 ' . $excludeControl + . 'The Study of +\'s? 1 results 1 ' . $excludeControl + . 'The Study of @Twitter #test 1 results 1 ' . $excludeControl + . 'The Study of Back S\ashes 1 results 1 ' . $excludeControl + . 'moreā€¦', + $this->findCss($page, '#modal #facet-list-index')->getText() + ); + // back to count one last time... + $this->clickCss($page, '[data-sort="count"]'); + $this->waitForPageLoad($page); // When exclusion is active, the result count is outside of the link tag: $expectedLinkText = $exclusionActive ? 'Weird IDs' : 'Weird IDs 9 results 9'; $weirdIDs = $this->findAndAssertLink(