File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,32 @@ public function testNavigationMenuWithDropdownPages()
78
78
{
79
79
config (['hyde.navigation.subdirectories ' => 'dropdown ' ]);
80
80
81
+ $ page = new MarkdownPage ('page ' );
82
+ $ bar = new MarkdownPage ('foo/bar ' );
83
+ $ baz = new MarkdownPage ('foo/baz ' );
84
+
85
+ Hyde::routes ()->add ($ page ->getRoute ());
86
+ Hyde::routes ()->add ($ bar ->getRoute ());
87
+ Hyde::routes ()->add ($ baz ->getRoute ());
88
+
89
+ $ this ->mockRoute ($ page ->getRoute ());
90
+ $ this ->mockPage ($ page );
91
+
92
+ $ contents = $ page ->compile ();
93
+
94
+ $ this ->assertStringContainsString ('dropdown-container ' , $ contents );
95
+ $ this ->assertStringContainsString ('dropdown-button ' , $ contents );
96
+
97
+ $ dropdown = Str::between ($ contents , '<ul class="dropdown-items ' , '</ul> ' );
98
+
99
+ $ this ->assertStringContainsString ('<a href="foo/bar.html" ' , $ dropdown );
100
+ $ this ->assertStringContainsString ('<a href="foo/baz.html" ' , $ dropdown );
101
+ }
102
+
103
+ public function testNavigationMenuWithDropdownPagesWithRootGroupPage ()
104
+ {
105
+ config (['hyde.navigation.subdirectories ' => 'dropdown ' ]);
106
+
81
107
$ foo = new MarkdownPage ('foo ' );
82
108
$ bar = new MarkdownPage ('foo/bar ' );
83
109
$ baz = new MarkdownPage ('foo/baz ' );
You can’t perform that action at this time.
0 commit comments