$assert_session->
pageTextContains('Twin media'
);
$assert_session->
pageTextContains('Single media type'
);
$assert_session->
pageTextContains('Empty types media'
);
// 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();