Loading drowl_trademark.libraries.yml +1 −0 Original line number Diff line number Diff line Loading @@ -5,4 +5,5 @@ drowl_trademark: dependencies: - core/jquery - core/jquery.once - core/drupal - core/drupalSettings js/drowl_trademark.js +0 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ * Run Drupal module JS initialization. * * @param context * @param settings */ attach: function (context, settings) { // #webksde#JP20141015: Do not handle email addresses and elements with container class ".no-replacetext". Loading tests/modules/drowl_trademark_test/config/install/filter.format.full_html.yml 0 → 100644 +35 −0 Original line number Diff line number Diff line langcode: en status: true dependencies: module: - editor name: 'Full HTML' format: full_html weight: 2 roles: - administrator filters: filter_align: id: filter_align provider: filter status: true weight: 8 settings: { } filter_caption: id: filter_caption provider: filter status: true weight: 9 settings: { } filter_htmlcorrector: id: filter_htmlcorrector provider: filter status: true weight: 10 settings: { } editor_file_reference: id: editor_file_reference provider: editor status: true weight: 11 settings: { } tests/modules/drowl_trademark_test/drowl_trademark_test.info.yml 0 → 100644 +9 −0 Original line number Diff line number Diff line name: 'Drowl Trademark Test' type: module description: 'Provides test config for drowl_trademark module tests.' core_version_requirement: ^9.3 dependencies: - drupal:node - drupal:filter - drupal:drowl_trademark - drupal:editor tests/src/FunctionalJavascript/DrowlTrademarkFunctionalJavascriptTest.php +21 −9 Original line number Diff line number Diff line Loading @@ -17,7 +17,10 @@ class DrowlTrademarkFunctionalJavascriptTest extends WebDriverTestBase { protected static $modules = [ 'node', 'test_page_test', 'editor', 'filter', 'drowl_trademark', 'drowl_trademark_test', ]; /** Loading Loading @@ -67,14 +70,17 @@ class DrowlTrademarkFunctionalJavascriptTest extends WebDriverTestBase { 'title' => 'test', 'body' => [ [ 'value' => 'prefix test suffix', 'format' => filter_default_format(), ] 'value' => '<p>prefix test suffix</p>', 'format' => 'full_html', ], ], ]); $this->drupalGet('/node/1'); // Ensure the Javascript already ran: $session->waitForElementVisible('css', 'h1 > span sup'); // Test the title. Expected to contain ® suffix: $session->elementTextEquals('css', 'h1 > span', 'test®'); $session->elementContains('css', 'h1 > span', 'test<sup>®</sup>'); Loading @@ -98,18 +104,21 @@ class DrowlTrademarkFunctionalJavascriptTest extends WebDriverTestBase { [ 'value' => 'prefix testabc suffix', 'format' => filter_default_format(), ] ], ], ]); $this->drupalGet('/node/1'); // Ensure the Javascript already ran: $session->waitForElementVisible('css', 'h1 > span sup'); // Test the title. Expected to contain ® suffix: $session->elementTextEquals('css', 'h1 > span', 'prefix test® suffix'); $session->elementContains('css', 'h1 > span', 'prefix test<sup>®</sup> suffix'); // Test the body. Expected to NOT contain ® suffix: $session->elementTextEquals('css', 'article > div > div > p', 'prefix testabc suffix'); $session->elementTextEquals('css', 'article > div > div', 'prefix testabc suffix'); } /** Loading @@ -124,14 +133,17 @@ class DrowlTrademarkFunctionalJavascriptTest extends WebDriverTestBase { 'title' => 'test', 'body' => [ [ 'value' => '<span class="no-drowl-trademark">prefix test suffix</span>', 'format' => filter_default_format(), ] 'value' => '<p><span class="no-drowl-trademark">prefix test suffix</span></p>', 'format' => 'full_html', ], ], ]); $this->drupalGet('/node/1'); // Ensure the Javascript already ran: $session->waitForElementVisible('css', 'h1 > span sup'); // Test the title. Expected to contain ® suffix: $session->elementTextEquals('css', 'h1 > span', 'test®'); $session->elementContains('css', 'h1 > span', 'test<sup>®</sup>'); Loading Loading
drowl_trademark.libraries.yml +1 −0 Original line number Diff line number Diff line Loading @@ -5,4 +5,5 @@ drowl_trademark: dependencies: - core/jquery - core/jquery.once - core/drupal - core/drupalSettings
js/drowl_trademark.js +0 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ * Run Drupal module JS initialization. * * @param context * @param settings */ attach: function (context, settings) { // #webksde#JP20141015: Do not handle email addresses and elements with container class ".no-replacetext". Loading
tests/modules/drowl_trademark_test/config/install/filter.format.full_html.yml 0 → 100644 +35 −0 Original line number Diff line number Diff line langcode: en status: true dependencies: module: - editor name: 'Full HTML' format: full_html weight: 2 roles: - administrator filters: filter_align: id: filter_align provider: filter status: true weight: 8 settings: { } filter_caption: id: filter_caption provider: filter status: true weight: 9 settings: { } filter_htmlcorrector: id: filter_htmlcorrector provider: filter status: true weight: 10 settings: { } editor_file_reference: id: editor_file_reference provider: editor status: true weight: 11 settings: { }
tests/modules/drowl_trademark_test/drowl_trademark_test.info.yml 0 → 100644 +9 −0 Original line number Diff line number Diff line name: 'Drowl Trademark Test' type: module description: 'Provides test config for drowl_trademark module tests.' core_version_requirement: ^9.3 dependencies: - drupal:node - drupal:filter - drupal:drowl_trademark - drupal:editor
tests/src/FunctionalJavascript/DrowlTrademarkFunctionalJavascriptTest.php +21 −9 Original line number Diff line number Diff line Loading @@ -17,7 +17,10 @@ class DrowlTrademarkFunctionalJavascriptTest extends WebDriverTestBase { protected static $modules = [ 'node', 'test_page_test', 'editor', 'filter', 'drowl_trademark', 'drowl_trademark_test', ]; /** Loading Loading @@ -67,14 +70,17 @@ class DrowlTrademarkFunctionalJavascriptTest extends WebDriverTestBase { 'title' => 'test', 'body' => [ [ 'value' => 'prefix test suffix', 'format' => filter_default_format(), ] 'value' => '<p>prefix test suffix</p>', 'format' => 'full_html', ], ], ]); $this->drupalGet('/node/1'); // Ensure the Javascript already ran: $session->waitForElementVisible('css', 'h1 > span sup'); // Test the title. Expected to contain ® suffix: $session->elementTextEquals('css', 'h1 > span', 'test®'); $session->elementContains('css', 'h1 > span', 'test<sup>®</sup>'); Loading @@ -98,18 +104,21 @@ class DrowlTrademarkFunctionalJavascriptTest extends WebDriverTestBase { [ 'value' => 'prefix testabc suffix', 'format' => filter_default_format(), ] ], ], ]); $this->drupalGet('/node/1'); // Ensure the Javascript already ran: $session->waitForElementVisible('css', 'h1 > span sup'); // Test the title. Expected to contain ® suffix: $session->elementTextEquals('css', 'h1 > span', 'prefix test® suffix'); $session->elementContains('css', 'h1 > span', 'prefix test<sup>®</sup> suffix'); // Test the body. Expected to NOT contain ® suffix: $session->elementTextEquals('css', 'article > div > div > p', 'prefix testabc suffix'); $session->elementTextEquals('css', 'article > div > div', 'prefix testabc suffix'); } /** Loading @@ -124,14 +133,17 @@ class DrowlTrademarkFunctionalJavascriptTest extends WebDriverTestBase { 'title' => 'test', 'body' => [ [ 'value' => '<span class="no-drowl-trademark">prefix test suffix</span>', 'format' => filter_default_format(), ] 'value' => '<p><span class="no-drowl-trademark">prefix test suffix</span></p>', 'format' => 'full_html', ], ], ]); $this->drupalGet('/node/1'); // Ensure the Javascript already ran: $session->waitForElementVisible('css', 'h1 > span sup'); // Test the title. Expected to contain ® suffix: $session->elementTextEquals('css', 'h1 > span', 'test®'); $session->elementContains('css', 'h1 > span', 'test<sup>®</sup>'); Loading