/**
* Tests the media library widget shows all media only once.
*/
public function testMediaLibraryTranslations() { $assert_session =
$this->
assertSession();
$page =
$this->
getSession()->
getPage();
// All translations should be shown in the administration overview,
// regardless of the interface language.
$this->
drupalGet('nl/admin/content/media-grid'
);
$assert_session->
elementsCount('css', '.js-media-library-item', 6
);
$media_items =
$page->
findAll('css', '.js-media-library-item-preview + div'
);
$media_names =
[];
foreach ($media_items as $media_item) { $media_names[] =
$media_item->
getText();
} sort($media_names);
// cSpell:disable-next-line
$this->
assertSame(['Ardilla', 'Eekhoorn', 'Hert', 'Tejón', 'Vos', 'Zorro'
],
$media_names);
$this->
drupalGet('es/admin/content/media-grid'
);
$assert_session->
elementsCount('css', '.js-media-library-item', 6
);
$media_items =
$page->
findAll('css', '.js-media-library-item-preview + div'
);