Update to Drupal 8.2.4. For more information, see https://www.drupal.org/project/drupal/releases/8.2.4

This commit is contained in:
Pantheon Automation 2016-12-07 12:19:38 -08:00 committed by Greg Anderson
parent 0a95b8440e
commit 8544b60b39
284 changed files with 12980 additions and 3199 deletions

View file

@ -0,0 +1,71 @@
<?php
namespace Drupal\Tests\views_ui\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
/**
* Tests the View UI filter criteria group dialog.
*
* @group views_ui
*/
class FilterCriteriaTest extends JavascriptTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['node', 'views', 'views_ui'];
/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser([
'administer site configuration',
'administer views',
'administer nodes',
'access content overview',
]);
// Disable automatic live preview to make the sequence of calls clearer.
\Drupal::configFactory()->getEditable('views.settings')->set('ui.always_live_preview', FALSE)->save();
$this->drupalLogin($admin_user);
}
/**
* Tests dialog for filter criteria.
*/
public function testFilterCriteriaDialog() {
$this->drupalGet('admin/structure/views/view/content_recent');
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
// Use the 'And/Or Rearrange' link for fields to open a dialog.
$dropbutton = $page->find('css', '.views-ui-display-tab-bucket.filter .dropbutton-toggle button');
$dropbutton->click();
$add_link = $page->findById('views-rearrange-filter');
$this->assertTrue($add_link->isVisible(), 'And/Or Rearrange button found.');
$add_link->click();
$assert_session->assertWaitOnAjaxRequest();
// Add a new filter group.
$create_new_filter_group = $page->findById('views-add-group-link');
$this->assertTrue($create_new_filter_group->isVisible(), 'Add group link found.');
$create_new_filter_group->click();
$assert_session->assertWaitOnAjaxRequest();
// Assert the existence of the new filter group by checking the remove group
// link.
$remove_link = $page->findLink('Remove group');
$this->assertTrue($remove_link->isVisible(), 'New group found.');
// Remove the group again and assert the group is not present anymore.
$remove_link->click();
$assert_session->assertWaitOnAjaxRequest();
$remove_link = $page->findLink('Remove group');
$this->assertEmpty($remove_link, 'Remove button not available');
}
}

View file

@ -39,12 +39,12 @@ class LibraryCachingTest extends JavascriptTestBase {
$add_link = $page->findById('views-add-field');
$this->assertTrue($add_link->isVisible(), 'Add fields button found.');
$add_link->click();
$this->getSession()->wait(5000, "jQuery('.ui-dialog-titlebar').length > 0");
$this->assertJsCondition("jQuery('.ui-dialog-titlebar').length > 0");
// Close the dialog and open it again. No no libraries will be loaded, but a
// cache entry will be made for not loading any libraries.
$page->pressButton('Close');
$add_link->click();
$this->getSession()->wait(5000, "jQuery('.ui-dialog-titlebar').length > 0");
$this->assertJsCondition("jQuery('.ui-dialog-titlebar').length > 0");
$page->pressButton('Close');
// Reload the page.
@ -55,14 +55,14 @@ class LibraryCachingTest extends JavascriptTestBase {
$preview = $page->findById('preview-submit');
// The first click will load all the libraries.
$preview->click();
$this->getSession()->wait(5000, "jQuery('.ajax-progress').length === 0");
$this->assertJsCondition("jQuery('.ajax-progress').length === 0");
// The second click will not load any new libraries.
$preview->click();
$this->getSession()->wait(5000, "jQuery('.ajax-progress').length === 0");
$this->assertJsCondition("jQuery('.ajax-progress').length === 0");
// Check to see if the dialogs still open.
$add_link = $page->findById('views-add-field');
$add_link->click();
$this->getSession()->wait(5000, "jQuery('.ui-dialog-titlebar').length > 0");
$this->assertJsCondition("jQuery('.ui-dialog-titlebar').length > 0");
$page->pressButton('Close');
}

View file

@ -15,7 +15,7 @@ class ViewsWizardTest extends JavascriptTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['node', 'views', 'views_ui', 'block'];
public static $modules = ['node', 'views', 'views_ui', 'block', 'user'];
/**
* {@inheritdoc}
@ -56,6 +56,27 @@ class ViewsWizardTest extends JavascriptTestBase {
// Add a block display.
$page->findField('block[create]')->click();
$this->assertEquals($label_value, $page->findField('block[title]')->getValue());
// Select the entity type to display and test that the type selector is
// shown when expected.
$page->selectFieldOption('show[wizard_key]', 'node');
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertNull($page->findField('show[type]'), 'The "of type" filter is not added for nodes when there are no node types.');
$this->assertEquals('teasers', $page->findField('page[style][row_plugin]')->getValue(), 'The page display format shows the expected default value.');
$this->assertEquals('titles_linked', $page->findField('block[style][row_plugin]')->getValue(), 'The block display format shows the expected default value.');
$page->selectFieldOption('show[wizard_key]', 'users');
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertNull($page->findField('show[type]'), 'The "of type" filter is not added for users.');
$this->assertEquals('fields', $page->findField('page[style][row_plugin]')->getValue(), 'The page display format was updated to a valid value.');
$this->assertEquals('fields', $page->findField('block[style][row_plugin]')->getValue(), 'The block display format was updated to a valid value.');
$this->drupalCreateContentType(['type' => 'page']);
$page->selectFieldOption('show[wizard_key]', 'node');
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertNotNull($page->findField('show[type]'), 'The "of type" filter is added for nodes when there is at least one node type.');
$this->assertEquals('fields', $page->findField('page[style][row_plugin]')->getValue(), 'The page display format was not changed from a valid value.');
$this->assertEquals('fields', $page->findField('block[style][row_plugin]')->getValue(), 'The block display format was not changed from a valid value.');
}
}