Skip to content

Commit

Permalink
Make tag faceting test pass in PostgreSQL as well as MySQL. (#3808)
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Jun 17, 2024
1 parent 1411944 commit 4972664
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,27 @@ public function testFavoriteFaceting(): void
$this->waitForPageLoad($page);

// Make sure we have a facet list:
$facetList = $this->findCss($page, 'nav[aria-labelledby="acc-menu-favs-header"]');
$this->assertEquals('1 test 3 1 test1 1 test2', $facetList->getText());
$facetLinks = $page->findAll('css', 'nav[aria-labelledby="acc-menu-favs-header"] a');
$linkToClick = null;
$allText = [];
foreach ($facetLinks as $link) {
$allText[] = $link->getText();
if ($link->getText() === '1 test 3') {
$linkToClick = $link;
}
}
// Facet order may vary by database engine, but let's make sure all the values are there:
$this->assertCount(3, $allText);
$expectedLinks = [
'1 test 3',
'1 test1',
'1 test2',
];
$this->assertEmpty(array_diff($expectedLinks, $allText));

// Now click on one and confirm that it filters the list down to just one item:
$firstLink = $this->findCss($facetList, 'a');
$this->assertEquals('1 test 3', $firstLink->getText());
$firstLink->click();
$this->assertEquals('1 test 3', $linkToClick?->getText());
$linkToClick->click();
$this->waitForPageLoad($page);
$this->assertFavoriteTitleOrder($page, ['Fake Record 1 with multiple relators/']);
}
Expand Down

0 comments on commit 4972664

Please sign in to comment.