Related issue: #2631468: Menu subtrees in menu blocks show all subitems regardless of the active menu item

Patch for the related issue works, but the test itself needs to be re-written

From @DamienMcKenna's comment :

Could it be argued that the testConfigLevelDepth test was wrong in the first place?

The test's menu structure should be like this:

  • test.example1
  • test.example2
    • test.example3
      • test.example4
  • test.example5
    • test.example7
  • test.example6
  • test.example8

Therefore the test should have checked that if the menu level was set to '2' that only test.example3 or test.example7 would show, whereas the bug indicates that both would be shown.

Back to writing tests.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kiwad created an issue. See original summary.

kiwad’s picture

Issue summary: View changes

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

AaronBauman’s picture

In this patch, 3 changes across 2 cases:

Case 1. No active trail is set: links with level greater than 1 should not appear be rendered for menu blocks with starting depth greater than 1.

-    $no_active_trail_expectations['level_2_only'] = [
-      'test.example7' => [],
-    ];
+    $no_active_trail_expectations['level_2_only'] = [];

Case 2. Active trail is set: Only links along the active trail should appear

     $active_trail_expectations['level_2_only'] = [
       'test.example3' => [],
-      'test.example7' => [],
     ];

and same here:

       'test.example3' => [
         'test.example4' => [],
       ],
-      'test.example7' => [],
     ];

We expect this test to fail, because of #2631468: Menu subtrees in menu blocks show all subitems regardless of the active menu item
Not sure what the proper protocol is for indicating this.

Status: Needs review » Needs work

The last submitted patch, 4: MenuBlockTest-rewite_test_ConfigLevelDepth-2745003.patch, failed testing.

DamienMcKenna’s picture

Status: Needs work » Closed (duplicate)