Skip to content

Commit

Permalink
Create additional view test method
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 10, 2024
1 parent 53cc222 commit 48a5a10
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/framework/tests/Unit/Views/NavigationMenuViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,32 @@ public function testNavigationMenuWithDropdownPages()
{
config(['hyde.navigation.subdirectories' => 'dropdown']);

$page = new MarkdownPage('page');
$bar = new MarkdownPage('foo/bar');
$baz = new MarkdownPage('foo/baz');

Hyde::routes()->add($page->getRoute());
Hyde::routes()->add($bar->getRoute());
Hyde::routes()->add($baz->getRoute());

$this->mockRoute($page->getRoute());
$this->mockPage($page);

$contents = $page->compile();

$this->assertStringContainsString('dropdown-container', $contents);
$this->assertStringContainsString('dropdown-button', $contents);

$dropdown = Str::between($contents, '<ul class="dropdown-items', '</ul>');

$this->assertStringContainsString('<a href="foo/bar.html"', $dropdown);
$this->assertStringContainsString('<a href="foo/baz.html"', $dropdown);
}

public function testNavigationMenuWithDropdownPagesWithRootGroupPage()
{
config(['hyde.navigation.subdirectories' => 'dropdown']);

$foo = new MarkdownPage('foo');
$bar = new MarkdownPage('foo/bar');
$baz = new MarkdownPage('foo/baz');
Expand Down

0 comments on commit 48a5a10

Please sign in to comment.