// Assert generic media library elements.
$this->
openMediaLibraryForField('field_unlimited_media'
);
$assert_session->
elementExists('css', '.ui-dialog-titlebar-close'
)->
click();
// Assert that the media type menu is available when more than 1 type is
// configured for the field.
$menu =
$this->
openMediaLibraryForField('field_unlimited_media'
);
$this->
assertTrue($menu->
hasLink('Show Type One media (selected)'
));
$this->
assertFalse($menu->
hasLink('Type Two'
));
$this->
assertTrue($menu->
hasLink('Type Three'
));
$this->
assertFalse($menu->
hasLink('Type Four'
));
$this->
switchToMediaType('Three'
);
// Assert the active tab is set correctly.
$this->
assertFalse($menu->
hasLink('Show Type One media (selected)'
));
$this->
assertTrue($menu->
hasLink('Show Type Three media (selected)'
));
// Assert the focus is set to the first tabbable element when a vertical tab
// is clicked.
$this->
assertJsCondition('jQuery(tabbable.tabbable(document.getElementById("media-library-content"))[0]).is(":focus")'
);
$assert_session->
elementExists('css', '.ui-dialog-titlebar-close'
)->
click();
// Assert that there are no links in the media library view.
$this->
openMediaLibraryForField('field_unlimited_media'
);
$assert_session->
elementNotExists('css', '.media-library-item__name a'
);