Verified Commit e47afe4f authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3272737 by danflanagan8: Workspaces tests should not rely on Classy

parent 84be5418
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ class WorkspaceSwitcherTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'classy';
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
@@ -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.
+1 −3
Original line number Diff line number Diff line
@@ -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');
  }