Skip to content
Snippets Groups Projects
Unverified Commit 91ab96a6 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2983346 by Krilo_89, pguillard, marcoscano, sjerdo: "Add media" button...

Issue #2983346 by Krilo_89, pguillard, marcoscano, sjerdo: "Add media" button missing in the media library table display
parent 94718428
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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
......@@ -61,6 +61,8 @@ protected function setUp() {
* 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 @@ public function testAdministrationPage() {
$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 @@ public function testAdministrationPage() {
// 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');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment