class BigPipeIdenticalPlaceholdersTest

Tests multiple occurrences of the same placeholder.

Attributes

#[Group('big_pipe')] #[RunTestsInSeparateProcesses]

Hierarchy

Expanded class hierarchy of BigPipeIdenticalPlaceholdersTest

File

core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeIdenticalPlaceholdersTest.php, line 15

Namespace

Drupal\Tests\big_pipe\FunctionalJavascript
View source
class BigPipeIdenticalPlaceholdersTest extends WebDriverTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'big_pipe',
    'big_pipe_test',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'big_pipe_test_theme';
  
  /**
   * Tests that all occurrences of the same placeholder are replaced.
   */
  public function testIdenticalPlaceholders() : void {
    $this->drupalLogin($this->drupalCreateUser());
    $assert_session = $this->assertSession();
    $this->drupalGet(Url::fromRoute('big_pipe_test_multi_occurrence'));
    $this->assertNotNull($assert_session->waitForElement('css', 'script[data-big-pipe-event="stop"]'));
    $assert_session->elementsCount('css', 'p.multiple-occurrence-instance', 3);
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.