Commit b3183904 authored by mikelutz's avatar mikelutz Committed by willzyx

Issue #2881521 by mikeNCM, willzyx: Toolbar Handler should use...

Issue #2881521 by mikeNCM, willzyx: Toolbar Handler should use toolbar.menu_tree instead of menu.link_tree
parent 7db6e6c6
......@@ -18,10 +18,10 @@
float: left;
}
.toolbar .toolbar-tray-horizontal .menu {
.toolbar .toolbar-tray-horizontal .toolbar-menu {
float: left; /* LTR */
}
[dir="rtl"] .toolbar .toolbar-tray-horizontal .menu {
[dir="rtl"] .toolbar .toolbar-tray-horizontal .toolbar-menu {
float: right;
}
......
......@@ -61,7 +61,7 @@ class ToolbarHandler implements ContainerInjectionInterface {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('menu.link_tree'),
$container->get('toolbar.menu_tree'),
$container->get('config.factory'),
$container->get('current_user')
);
......
......@@ -182,11 +182,11 @@ class DevelToolbarTest extends BrowserTestBase {
$toolbar_tray = $this->assertSession()->elementExists('css', $toolbar_tray_selector);
$devel_menu_items = $this->getMenuLinkInfos();
$toolbar_items = $toolbar_tray->findAll('css', 'ul.menu a');
$toolbar_items = $toolbar_tray->findAll('css', 'ul.toolbar-menu a');
$this->assertCount(count($devel_menu_items), $toolbar_items);
foreach ($devel_menu_items as $link) {
$item_selector = sprintf('ul.menu a:contains("%s")', $link['title']);
$item_selector = sprintf('ul.toolbar-menu a:contains("%s")', $link['title']);
$item = $this->assertSession()->elementExists('css', $item_selector, $toolbar_tray);
// TODO: find a more correct way to test link url.
$this->assertContains(strtok($link['url'], '?'), $item->getAttribute('href'));
......@@ -206,7 +206,7 @@ class DevelToolbarTest extends BrowserTestBase {
$this->drupalGet('');
$toolbar_tray = $this->assertSession()->elementExists('css', $toolbar_tray_selector);
$item = $this->assertSession()->elementExists('css', sprintf('ul.menu a:contains("%s")', 'Events Info'), $toolbar_tray);
$item = $this->assertSession()->elementExists('css', sprintf('ul.toolbar-menu a:contains("%s")', 'Events Info'), $toolbar_tray);
$this->assertFalse($item->hasClass('toolbar-horizontal-item-hidden'));
// Ensures that disabling a menu link it will not more shown in the toolbar
......@@ -216,7 +216,7 @@ class DevelToolbarTest extends BrowserTestBase {
$this->drupalGet('');
$toolbar_tray = $this->assertSession()->elementExists('css', $toolbar_tray_selector);
$this->assertSession()->elementNotExists('css', sprintf('ul.menu a:contains("%s")', 'Events Info'), $toolbar_tray);
$this->assertSession()->elementNotExists('css', sprintf('ul.toolbar-menu a:contains("%s")', 'Events Info'), $toolbar_tray);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment