You are here

protected function MediaLibraryTestBase::assertNoMediaAdded 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::assertNoMediaAdded()
  2. 9 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::assertNoMediaAdded()

Asserts that media was not added, i.e. due to a validation error.

File

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

Class

MediaLibraryTestBase
Base class for functional tests of Media Library functionality.

Namespace

Drupal\Tests\media_library\FunctionalJavascript

Code

protected function assertNoMediaAdded() {

  // Assert the focus is shifted to the first tabbable element of the add
  // form, which should be the source field.
  $this
    ->assertJsCondition('jQuery(tabbable.tabbable(document.getElementById("media-library-add-form-wrapper"))[0]).is(":focus")');
  $this
    ->assertSession()
    ->elementNotExists('css', '[data-drupal-selector="edit-media-0-fields"]');
  $this
    ->getTypesMenu();
}