@@ -200,29 +200,21 @@ public function testMainNavigationMenuWithFrontMatterVisible()
200200 ]);
201201 }
202202
203- public function testMainNavigationMenuWithFrontMatterGroup ()
203+ public function testMainNavigationMenuWithExplicitFrontMatterGroupUsesDropdownsRegardlessOfConfigSetting ()
204204 {
205- // TODO: For new v2 system, this should insert a root item with the group name and the children as the pages
206-
207205 $ this ->assertMenuEquals ([
208- ['label ' => 'Foo ' , 'group ' => 'group-1 ' ],
209- ['label ' => 'Bar ' , 'group ' => 'group-1 ' ],
210- ['label ' => 'Baz ' , 'group ' => 'group-1 ' ],
206+ ['label ' => 'Group 1 ' , 'children ' => ['Foo ' , 'Bar ' , 'Baz ' ]],
211207 ], [
212208 new MarkdownPage ('foo ' , ['navigation.group ' => 'Group 1 ' ]),
213209 new MarkdownPage ('bar ' , ['navigation.group ' => 'Group 1 ' ]),
214210 new MarkdownPage ('baz ' , ['navigation.group ' => 'Group 1 ' ]),
215211 ]);
216212 }
217213
218- public function testMainNavigationMenuWithFrontMatterCategory ()
214+ public function testMainNavigationMenuWithExplicitFrontMatterCategoryUsesDropdownsRegardlessOfConfigSetting ()
219215 {
220- // TODO: For new v2 system, this should insert a root item with the group name and the children as the pages
221-
222216 $ this ->assertMenuEquals ([
223- ['label ' => 'Foo ' , 'group ' => 'group-1 ' ],
224- ['label ' => 'Bar ' , 'group ' => 'group-1 ' ],
225- ['label ' => 'Baz ' , 'group ' => 'group-1 ' ],
217+ ['label ' => 'Group 1 ' , 'children ' => ['Foo ' , 'Bar ' , 'Baz ' ]],
226218 ], [
227219 new MarkdownPage ('foo ' , ['navigation.category ' => 'Group 1 ' ]),
228220 new MarkdownPage ('bar ' , ['navigation.category ' => 'Group 1 ' ]),
@@ -292,7 +284,10 @@ public function testMainNavigationMenuWithFrontMatterGroupAndCategory()
292284 {
293285 // Since the main key in the navigation schema is 'group', that takes precedence over its 'category' alias
294286
295- $ this ->assertMenuEquals (array_fill (0 , 3 , ['group ' => 'group-1 ' ]), [
287+ $ this ->assertMenuEquals ([[
288+ 'label ' => 'Group 1 ' ,
289+ 'children ' => ['Foo ' , 'Bar ' , 'Baz ' ],
290+ ]], [
296291 new MarkdownPage ('foo ' , ['navigation.group ' => 'Group 1 ' , 'navigation.category ' => 'Group 2 ' ]),
297292 new MarkdownPage ('bar ' , ['navigation.group ' => 'Group 1 ' , 'navigation.category ' => 'Group 2 ' ]),
298293 new MarkdownPage ('baz ' , ['navigation.group ' => 'Group 1 ' , 'navigation.category ' => 'Group 2 ' ]),
@@ -494,8 +489,8 @@ public function testMainNavigationMenuItemsWithTheSameLabelAreNotFilteredForDupl
494489 public function testMainNavigationMenuItemsWithSameLabelButDifferentGroupsAreNotFiltered ()
495490 {
496491 $ this ->assertMenuEquals ([
497- ['label ' => 'Foo ' , 'group ' => ' group-1 ' ],
498- ['label ' => 'Foo ' , 'group ' => ' group-2 ' ],
492+ ['label ' => 'Group 1 ' , 'children ' => [ ' Foo ' ] ],
493+ ['label ' => 'Group 2 ' , 'children ' => [ ' Foo ' ] ],
499494 ], [
500495 new MarkdownPage ('foo ' , ['navigation.label ' => 'Foo ' , 'navigation.group ' => 'Group 1 ' ]),
501496 new MarkdownPage ('bar ' , ['navigation.label ' => 'Foo ' , 'navigation.group ' => 'Group 2 ' ]),
0 commit comments