diff --git a/core/modules/workspace/tests/src/Functional/WorkspaceSwitcherTest.php b/core/modules/workspace/tests/src/Functional/WorkspaceSwitcherTest.php index 22a51b3..245aba4 100644 --- a/core/modules/workspace/tests/src/Functional/WorkspaceSwitcherTest.php +++ b/core/modules/workspace/tests/src/Functional/WorkspaceSwitcherTest.php @@ -3,6 +3,7 @@ namespace Drupal\Tests\workspace\Functional; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait; /** * Tests workspace switching functionality. @@ -11,6 +12,7 @@ */ class WorkspaceSwitcherTest extends BrowserTestBase { + use AssertPageCacheContextsAndTagsTrait; use WorkspaceTestUtilities; /** @@ -52,6 +54,10 @@ public function testSwitchingWorkspaces() { $page = $this->getSession()->getPage(); $page->findButton('Confirm')->click(); + // Check that WorkspaceCacheContext provides the cache context used to + // support its functionality. + $this->assertCacheContext('session'); + $page->findLink($gravity->label()); } @@ -70,6 +76,10 @@ public function testQueryParameterNegotiator() { // The workspace switching via query parameter should persist. $this->drupalGet(''); $web_assert->elementContains('css', '.block-workspace-switcher', 'Stage'); + + // Check that WorkspaceCacheContext provides the cache context used to + // support its functionality. + $this->assertCacheContext('session'); } }