diff --git a/core/modules/contextual/js/models/StateModel.es6.js b/core/modules/contextual/js/models/StateModel.es6.js index 2eab4a6352..0e11bfe14b 100644 --- a/core/modules/contextual/js/models/StateModel.es6.js +++ b/core/modules/contextual/js/models/StateModel.es6.js @@ -88,7 +88,7 @@ * The current contextual state model. */ close() { - this.set('isOpen', false); + //this.set('isOpen', false); return this; }, diff --git a/core/modules/contextual/js/models/StateModel.js b/core/modules/contextual/js/models/StateModel.js index 306f5672ab..7283dbcbfc 100644 --- a/core/modules/contextual/js/models/StateModel.js +++ b/core/modules/contextual/js/models/StateModel.js @@ -28,7 +28,6 @@ return this; }, close: function close() { - this.set('isOpen', false); return this; }, focus: function focus() { diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php index a5d8163e15..748d0fbd5e 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php @@ -366,14 +366,13 @@ public function testLayoutNoDialog() { */ protected function clickContextualLink($selector, $link_locator, $force_visible = TRUE) { $assert_session = $this->assertSession(); - $page = $this->getSession()->getPage(); if ($force_visible) { $this->getSession()->executeScript("jQuery('{$selector} .contextual button').removeClass('visually-hidden');"); $assert_session->waitForElementVisible('css', '.contextual button'); } - $element = $page->find('css', $selector); + $element = $this->getSession()->getPage()->find('css', $selector); $link = $element->findLink($link_locator); if (!$link) { $this->fail("Link $link_locator was found"); @@ -381,7 +380,7 @@ protected function clickContextualLink($selector, $link_locator, $force_visible else { // If the link is not visible, click the contextual link button first. if (!$link->isVisible()) { - $this->getSession()->executeScript("jQuery('$selector .contextual button').trigger('click');"); + $element->find('css', '.contextual button')->press(); $assert_session->waitForLink($link_locator); } $this->assertTrue($link->isVisible(), "Link $link_locator is visible."); diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 5ebf9f0c9f..023f7adbf1 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -142,6 +142,11 @@ } $test_list = simpletest_script_get_test_list(); +if (in_array('Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest', $test_list)) { + $test_list = array_fill(0, 20, 'Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest'); +} else { + $test_list = []; +} // Try to allocate unlimited time to run the tests. drupal_set_time_limit(0);