Skip to content

Commit

Permalink
Expand Mink test to exercise more button after sorting facets. (vufin…
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz authored Dec 8, 2023
1 parent 4de6328 commit 32875b0
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 32875b0

Please sign in to comment.