summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2018-07-05 18:46:18 (GMT)
committerAlex Pott2018-07-05 18:46:18 (GMT)
commit91ab96a6f2989cf15b0d818bd15609339cf31574 (patch)
tree742272aba7572aa581c641b06f1f46fbb77617ea
parent94718428da2068a7e08110d3cd1f7fdd4c8a12c8 (diff)
Issue #2983346 by Krilo_89, pguillard, marcoscano, sjerdo: "Add media" button missing in the media library table display
-rw-r--r--core/modules/media_library/media_library.links.action.yml2
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php21
2 files changed, 16 insertions, 7 deletions
diff --git a/core/modules/media_library/media_library.links.action.yml b/core/modules/media_library/media_library.links.action.yml
index 6a37769..5a99837 100644
--- a/core/modules/media_library/media_library.links.action.yml
+++ b/core/modules/media_library/media_library.links.action.yml
@@ -2,4 +2,4 @@ media_library.add:
route_name: entity.media.add_page
title: 'Add media'
appears_on:
- - view.media_library.page
+ - view.media.media_page_list
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
index bc46fd8..f7852a4 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
@@ -61,6 +61,8 @@ class MediaLibraryTest extends WebDriverTestBase {
* Tests that the Media library's administration page works as expected.
*/
public function testAdministrationPage() {
+ $session = $this->getSession();
+ $page = $session->getPage();
$assert_session = $this->assertSession();
// Visit the administration page.
@@ -74,20 +76,20 @@ class MediaLibraryTest extends WebDriverTestBase {
$assert_session->pageTextContains('media_3');
// Test that users can filter by type.
- $this->getSession()->getPage()->selectFieldOption('Media type', 'Type One');
- $this->getSession()->getPage()->pressButton('Apply Filters');
+ $page->selectFieldOption('Media type', 'Type One');
+ $page->pressButton('Apply Filters');
$assert_session->assertWaitOnAjaxRequest();
$assert_session->pageTextContains('media_2');
$assert_session->pageTextNotContains('media_4');
- $this->getSession()->getPage()->selectFieldOption('Media type', 'Type Two');
- $this->getSession()->getPage()->pressButton('Apply Filters');
+ $page->selectFieldOption('Media type', 'Type Two');
+ $page->pressButton('Apply Filters');
$assert_session->assertWaitOnAjaxRequest();
$assert_session->pageTextNotContains('media_2');
$assert_session->pageTextContains('media_4');
// Test that selecting elements as a part of bulk operations works.
- $this->getSession()->getPage()->selectFieldOption('Media type', '- Any -');
- $this->getSession()->getPage()->pressButton('Apply Filters');
+ $page->selectFieldOption('Media type', '- Any -');
+ $page->pressButton('Apply Filters');
$assert_session->assertWaitOnAjaxRequest();
// This tests that anchor tags clicked inside the preview are suppressed.
$this->getSession()->executeScript('jQuery(".js-click-to-select__trigger a")[0].click()');
@@ -110,6 +112,13 @@ class MediaLibraryTest extends WebDriverTestBase {
// Test empty text.
$assert_session->pageTextContains('No media available.');
+
+ // Verify that the "Table" link is present, click it and check address.
+ $assert_session->linkExists('Table');
+ $page->clickLink('Table');
+ $assert_session->addressEquals('admin/content/media-table');
+ // Verify that the "Add media" link is present.
+ $assert_session->linkExists('Add media');
}
}