File tree 1 file changed +53
-0
lines changed
1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Hyde \Framework \Testing \Unit \Views ;
4
+
5
+ use Hyde \Testing \TestCase ;
6
+
7
+ /**
8
+ * @see resources/views/layouts/navigation.blade.php
9
+ */
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
+ }
53
+ }
You can’t perform that action at this time.
0 commit comments