Loading core/modules/workspaces/tests/src/Functional/WorkspaceSwitcherTest.php +4 −4 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class WorkspaceSwitcherTest extends BrowserTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * {@inheritdoc} Loading Loading @@ -72,16 +72,16 @@ public function testSwitchingWorkspaces() { public function testQueryParameterNegotiator() { $web_assert = $this->assertSession(); // Initially the default workspace should be active. $web_assert->elementContains('css', '.block-workspace-switcher', 'None'); $web_assert->elementContains('css', '#block-workspaceswitcher', 'None'); // When adding a query parameter the workspace will be switched. $current_user_url = \Drupal::currentUser()->getAccount()->toUrl(); $this->drupalGet($current_user_url, ['query' => ['workspace' => 'stage']]); $web_assert->elementContains('css', '.block-workspace-switcher', 'Stage'); $web_assert->elementContains('css', '#block-workspaceswitcher', 'Stage'); // The workspace switching via query parameter should persist. $this->drupalGet($current_user_url); $web_assert->elementContains('css', '.block-workspace-switcher', 'Stage'); $web_assert->elementContains('css', '#block-workspaceswitcher', 'Stage'); // Check that WorkspaceCacheContext provides the cache context used to // support its functionality. Loading core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php +1 −3 Original line number Diff line number Diff line Loading @@ -80,10 +80,8 @@ public function testWorkspaceSwitch() { $page->clickLink('Stage'); $this->assertElementVisibleAfterWait('css', '.workspace-activate-form.workspace-confirm-form'); $page->find('css', '.ui-dialog-buttonset .button--primary')->click(); $assert_session->waitForElementVisible('css', '.messages--status'); $assert_session->statusMessageContainsAfterWait('Stage is now the active workspace.', 'status'); // Make sure we stay on same page after switch. $assert_session->responseContains('<em class="placeholder">Stage</em> is now the active workspace.'); $assert_session->addressEquals('admin'); } Loading Loading
core/modules/workspaces/tests/src/Functional/WorkspaceSwitcherTest.php +4 −4 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class WorkspaceSwitcherTest extends BrowserTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * {@inheritdoc} Loading Loading @@ -72,16 +72,16 @@ public function testSwitchingWorkspaces() { public function testQueryParameterNegotiator() { $web_assert = $this->assertSession(); // Initially the default workspace should be active. $web_assert->elementContains('css', '.block-workspace-switcher', 'None'); $web_assert->elementContains('css', '#block-workspaceswitcher', 'None'); // When adding a query parameter the workspace will be switched. $current_user_url = \Drupal::currentUser()->getAccount()->toUrl(); $this->drupalGet($current_user_url, ['query' => ['workspace' => 'stage']]); $web_assert->elementContains('css', '.block-workspace-switcher', 'Stage'); $web_assert->elementContains('css', '#block-workspaceswitcher', 'Stage'); // The workspace switching via query parameter should persist. $this->drupalGet($current_user_url); $web_assert->elementContains('css', '.block-workspace-switcher', 'Stage'); $web_assert->elementContains('css', '#block-workspaceswitcher', 'Stage'); // Check that WorkspaceCacheContext provides the cache context used to // support its functionality. Loading
core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php +1 −3 Original line number Diff line number Diff line Loading @@ -80,10 +80,8 @@ public function testWorkspaceSwitch() { $page->clickLink('Stage'); $this->assertElementVisibleAfterWait('css', '.workspace-activate-form.workspace-confirm-form'); $page->find('css', '.ui-dialog-buttonset .button--primary')->click(); $assert_session->waitForElementVisible('css', '.messages--status'); $assert_session->statusMessageContainsAfterWait('Stage is now the active workspace.', 'status'); // Make sure we stay on same page after switch. $assert_session->responseContains('<em class="placeholder">Stage</em> is now the active workspace.'); $assert_session->addressEquals('admin'); } Loading