You are here

public function ResponsiveMenuAdminTest::testMenuDepthSetting in Responsive and off-canvas menu 4.3.x

Same name and namespace in other branches
  1. 4.4.x tests/src/Functional/ResponsiveMenuAdminTest.php \Drupal\Tests\responsive_menu\Functional\ResponsiveMenuAdminTest::testMenuDepthSetting()
  2. 4.1.x tests/src/Functional/ResponsiveMenuAdminTest.php \Drupal\Tests\responsive_menu\Functional\ResponsiveMenuAdminTest::testMenuDepthSetting()

Tests that the menu depth control works for the horizontal menu.

File

tests/src/Functional/ResponsiveMenuAdminTest.php, line 65

Class

ResponsiveMenuAdminTest
Class SettingsPageTest.

Namespace

Drupal\Tests\responsive_menu\Functional

Code

public function testMenuDepthSetting() {
  $this
    ->drupalGet('/admin/config/user-interface/responsive-menu');
  $this
    ->getSession()
    ->getPage()
    ->selectFieldOption('horizontal_depth', '1');
  $this
    ->getSession()
    ->getPage()
    ->pressButton('Save configuration');
  $this
    ->drupalGet('/node/1');
  $horizontal_menu = $this
    ->getSession()
    ->getPage()
    ->findById('horizontal-menu');
  $link = $horizontal_menu
    ->findLink('A sibling on the second level');
  $this
    ->assertTrue(empty($link), 'A second level link was found even though the menu depth was set to 1.');
}