You are here

protected function MessageCommandTest::assertAnnounceNotContains in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php \Drupal\FunctionalJavascriptTests\Ajax\MessageCommandTest::assertAnnounceNotContains()
  2. 9 core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php \Drupal\FunctionalJavascriptTests\Ajax\MessageCommandTest::assertAnnounceNotContains()

Checks for absence of the given text from #drupal-live-announce.

@internal

Parameters

string $expected_message: The text expected to be absent from #drupal-live-announce.

1 call to MessageCommandTest::assertAnnounceNotContains()
MessageCommandTest::testMessageCommand in core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php
Tests AJAX MessageCommand use in a form.

File

core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php, line 219

Class

MessageCommandTest
Tests adding messages via AJAX command.

Namespace

Drupal\FunctionalJavascriptTests\Ajax

Code

protected function assertAnnounceNotContains(string $expected_message) : void {
  $assert_session = $this
    ->assertSession();
  $this
    ->assertEmpty($assert_session
    ->waitForElement('css', "#drupal-live-announce:contains('{$expected_message}')", 1000));
}