Skip to content

Commit

Permalink
Add additional unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 23, 2024
1 parent 528d9f4 commit 04aa0f6
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,15 @@ public function testGetActiveGroupReturnsExplicitlySetIndexPageGroupWhenRenderin
$this->assertSame('usage', $sidebar->getActiveGroup()->getGroupKey());
}

public function testGetActiveGroupReturnsExplicitlySetIndexPageGroupWhenRenderingIndexPageRegardlessOfPriorities()
{
$sidebar = $this->createSidebar();
$sidebar->add(new NavigationGroup('other', [new NavigationItem('Other', 'Other')], 0));

$this->renderData->setPage(new DocumentationPage('index', ['navigation.group' => 'usage']));
$this->assertSame('usage', $sidebar->getActiveGroup()->getGroupKey());
}

protected function mockCurrentPageForActiveGroup(string $group, string $identifier = 'foo'): void
{
$this->renderData->setPage(new DocumentationPage($identifier, ['navigation.group' => $group]));
Expand Down

0 comments on commit 04aa0f6

Please sign in to comment.