Skip to content
Snippets Groups Projects
Commit 45c46c31 authored by Justin Toupin's avatar Justin Toupin
Browse files

Refactored for simplicity.

parent bec45e2d
No related branches found
No related tags found
1 merge request!103Issue #3295875: Add a new dedicated permission for Layout paragraphs configurations
......@@ -5,14 +5,12 @@ namespace Drupal\Tests\layout_paragraphs\FunctionalJavascript;
/**
* Tests that buttons remain reachable even with tall modal heights.
*
* @requires module layout_paragraphs_alter_controls_test
*
* @group layout_paragraphs
*/
class ModalHeightTest extends BuilderTestBase {
/**
* Tests modal height.
* Tests that buttons remain reachable even with tall modal heights.
*/
public function testModalHeight() {
$this->loginWithPermissions([
......@@ -26,15 +24,18 @@ class ModalHeightTest extends BuilderTestBase {
$page->find('css', '.lpb-btn--add')->click();
$this->assertSession()->assertWaitOnAjaxRequest(1000, 'Unable to click add a component.');
// Add a text component.
// Open the "Create text" dialog.
$page->clickLink('text');
$this->assertSession()->assertWaitOnAjaxRequest(1000, 'Unable to select text component.');
$this->assertSession()->waitForText('Create text');
// Force the dialog height to expand beyond the viewport.
// Since the dialog height is 'auto' by default, increasing the height of
// the dialog's content will automatically increase the dialog's height.
$this->getSession()->executeScript('jQuery(\'.layout-paragraphs-component-form\').height(\'2000px\');');
// Pause for UI to update.
$this->getSession()->wait(1000);
// Save button should be reachable.
$this->assertSession()->waitForElementVisible('css', '.ui-dialog-buttonpane .lpb-btn--save', 1000);
// Save button should still be reachable.
$this->assertSession()->assertVisibleInViewport('css', '.ui-dialog-buttonpane .lpb-btn--save');
}
......
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