You are here

protected function MessageCommandTest::waitForMessageRemoved in Drupal 9

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

Asserts that a message of the expected type is removed.

Parameters

string $message: The expected message.

string $selector: The selector for the element in which to check for the expected message.

string $type: The expected type.

1 call to MessageCommandTest::waitForMessageRemoved()
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 103

Class

MessageCommandTest
Tests adding messages via AJAX command.

Namespace

Drupal\FunctionalJavascriptTests\Ajax

Code

protected function waitForMessageRemoved($message, $selector = '[data-drupal-messages]', $type = 'status') {
  $this
    ->assertNotEmpty($this
    ->assertSession()
    ->waitForElementRemoved('css', $selector . ' .messages--' . $type . ':contains("' . $message . '")'));
}