Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / src / FunctionalJavascript / ModalRendererTest.php
1 <?php
2
3 namespace Drupal\Tests\system\FunctionalJavascript;
4
5 use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
6
7 /**
8  * Tests that dialog links use different renderer services.
9  *
10  * @group system
11  */
12 class ModalRendererTest extends JavascriptTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = ['system', 'dialog_renderer_test'];
18
19   /**
20    * Tests that links respect 'data-dialog-renderer' attribute.
21    */
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;"]'));
36   }
37
38 }