$links);
$this->
assertSame($link_titles,
['Show Type One media (selected)', 'Show Type Three media', 'Show Type Four media', 'Show Type Two media'
]);
$assert_session->
elementExists('css', '.ui-dialog-titlebar-close'
)->
click();
// Assert the announcements for media type navigation in the media library.
$this->
openMediaLibraryForField('field_unlimited_media'
);
$this->
switchToMediaType('Three'
);
$this->
assertNotEmpty($assert_session->
waitForText('Showing Type Three media.'
));
$this->
switchToMediaType('One'
);
$this->
assertNotEmpty($assert_session->
waitForText('Showing Type One media.'
));
// Assert the links can be triggered by via the spacebar.
$assert_session->
elementExists('named',
['link', 'Type Three'
])->
keyPress(32
);
$this->
waitForText('Showing Type Three media.'
);
$assert_session->
elementExists('css', '.ui-dialog-titlebar-close'
)->
click();
// Assert media is only visible on the tab for the related media type.
$this->
openMediaLibraryForField('field_unlimited_media'
);
$assert_session->
pageTextContains('Dog'
);
$assert_session->
pageTextContains('Bear'
);
$assert_session->
pageTextNotContains('Turtle'
);
$this->
switchToMediaType('Three'
);
$this->
assertNotEmpty($assert_session->
waitForText('Showing Type Three media.'
));
$assert_session->
elementExists('named',
['link', 'Show Type Three media (selected)'
]);