You are here

protected function MediaLibraryTestBase::assertSelectedMediaCount in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::assertSelectedMediaCount()
  2. 9 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::assertSelectedMediaCount()

Asserts the current text of the selected item counter.

Parameters

string $text: The expected text of the counter.

File

core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php, line 449

Class

MediaLibraryTestBase
Base class for functional tests of Media Library functionality.

Namespace

Drupal\Tests\media_library\FunctionalJavascript

Code

protected function assertSelectedMediaCount($text) {
  $selected_count = $this
    ->assertSession()
    ->elementExists('css', '.js-media-library-selected-count');
  $this
    ->assertSame('status', $selected_count
    ->getAttribute('role'));
  $this
    ->assertSame('polite', $selected_count
    ->getAttribute('aria-live'));
  $this
    ->assertSame('true', $selected_count
    ->getAttribute('aria-atomic'));
  $this
    ->assertSame($text, $selected_count
    ->getText());
}