| Total Complexity | 8 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class NavigationMenuViewTest extends TestCase |
||
| 11 | { |
||
| 12 | protected function setUp(): void |
||
| 13 | { |
||
| 14 | parent::setUp(); |
||
| 15 | $this->mockRoute(); |
||
| 16 | $this->mockPage(); |
||
| 17 | } |
||
| 18 | |||
| 19 | protected function render(): string |
||
| 20 | { |
||
| 21 | return view('hyde::layouts.navigation')->render(); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function test_component_can_be_rendered() |
||
| 25 | { |
||
| 26 | $this->assertStringContainsString('id="main-navigation"', $this->render()); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function test_component_contains_dark_mode_button() |
||
| 30 | { |
||
| 31 | $this->assertStringContainsString('theme-toggle-button', $this->render()); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function test_component_contains_navigation_menu_toggle_button() |
||
| 35 | { |
||
| 36 | $this->assertStringContainsString('id="navigation-toggle-button"', $this->render()); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function test_component_contains_main_navigation_links() |
||
| 40 | { |
||
| 41 | $this->assertStringContainsString('id="main-navigation-links"', $this->render()); |
||
| 42 | } |
||
| 43 | |||
| 44 | public function test_component_contains_index_html_link() |
||
| 45 | { |
||
| 46 | $this->assertStringContainsString('href="index.html"', $this->render()); |
||
| 47 | } |
||
| 48 | |||
| 49 | public function test_component_not_contains_404_html_link() |
||
| 50 | { |
||
| 51 | $this->assertStringNotContainsString('href="404.html"', $this->render()); |
||
| 52 | } |
||
| 54 |