Loading core/modules/navigation/src/WorkspacesLazyBuilder.php +3 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ public function renderNavigationLinks(): array { 'title' => $active_workspace ? $active_workspace->label() : $this->t('Live'), 'url' => $url, 'class' => 'workspaces', 'icon' => [ 'icon_id' => 'workspaces', ], ], ], '#attached' => [ Loading core/modules/navigation/tests/src/Functional/NavigationWorkspacesUiTest.php 0 → 100644 +49 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace Drupal\Tests\navigation\Functional; use Drupal\Tests\BrowserTestBase; /** * Tests for \Drupal\navigation\WorkspacesLazyBuilder. * * @group navigation */ class NavigationWorkspacesUiTest extends BrowserTestBase { /** * {@inheritdoc} */ protected static $modules = ['navigation', 'workspaces_ui']; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * {@inheritdoc} */ protected function setUp(): void { parent::setUp(); $admin_user = $this->drupalCreateUser([ 'access navigation', 'administer workspaces', ]); $this->drupalLogin($admin_user); } /** * Tests the Workspaces button in the navigation bar. */ public function testWorkspacesNavigationButton(): void { $this->drupalGet('<front>'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->elementAttributeContains('css', 'a.toolbar-button--icon--workspaces svg', 'width', '20'); $this->assertSession()->elementAttributeContains('css', 'a.toolbar-button--icon--workspaces svg', 'class', 'toolbar-button__icon'); } } Loading
core/modules/navigation/src/WorkspacesLazyBuilder.php +3 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ public function renderNavigationLinks(): array { 'title' => $active_workspace ? $active_workspace->label() : $this->t('Live'), 'url' => $url, 'class' => 'workspaces', 'icon' => [ 'icon_id' => 'workspaces', ], ], ], '#attached' => [ Loading
core/modules/navigation/tests/src/Functional/NavigationWorkspacesUiTest.php 0 → 100644 +49 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace Drupal\Tests\navigation\Functional; use Drupal\Tests\BrowserTestBase; /** * Tests for \Drupal\navigation\WorkspacesLazyBuilder. * * @group navigation */ class NavigationWorkspacesUiTest extends BrowserTestBase { /** * {@inheritdoc} */ protected static $modules = ['navigation', 'workspaces_ui']; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * {@inheritdoc} */ protected function setUp(): void { parent::setUp(); $admin_user = $this->drupalCreateUser([ 'access navigation', 'administer workspaces', ]); $this->drupalLogin($admin_user); } /** * Tests the Workspaces button in the navigation bar. */ public function testWorkspacesNavigationButton(): void { $this->drupalGet('<front>'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->elementAttributeContains('css', 'a.toolbar-button--icon--workspaces svg', 'width', '20'); $this->assertSession()->elementAttributeContains('css', 'a.toolbar-button--icon--workspaces svg', 'class', 'toolbar-button__icon'); } }