3 namespace Drupal\Tests\system\FunctionalJavascript;
5 use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
8 * Tests that dialog links use different renderer services.
12 class ModalRendererTest extends WebDriverTestBase {
17 public static $modules = ['system', 'dialog_renderer_test'];
20 * Tests that links respect 'data-dialog-renderer' attribute.
22 public function testModalRenderer() {
23 $session_assert = $this->assertSession();
24 $this->drupalGet('/dialog_renderer-test-links');
25 $this->clickLink('Normal Modal!');
26 // Neither of the wide modals should have been used.
27 $style = $session_assert->waitForElementVisible('css', '.ui-dialog')->getAttribute('style');
28 $this->assertNotContains('700px', $style);
29 $this->assertNotContains('1000px', $style);
30 $this->drupalGet('/dialog_renderer-test-links');
31 $this->clickLink('Wide Modal!');
32 $this->assertNotEmpty($session_assert->waitForElementVisible('css', '.ui-dialog[style*="width: 700px;"]'));
33 $this->drupalGet('/dialog_renderer-test-links');
34 $this->clickLink('Extra Wide Modal!');
35 $this->assertNotEmpty($session_assert->waitForElementVisible('css', '.ui-dialog[style*="width: 1000px;"]'));