Commit b5d05767 authored by Joshua Sedler's avatar Joshua Sedler 🤸🏼 Committed by Julian Pustkuchen
Browse files

Issue #3271083: Fix failing test

parent 834204ef
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,4 +5,5 @@ drowl_trademark:
  dependencies:
    - core/jquery
    - core/jquery.once
    - core/drupal
    - core/drupalSettings
+0 −1
Original line number Diff line number Diff line
@@ -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".
+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: {  }
+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
+21 −9
Original line number Diff line number Diff line
@@ -17,7 +17,10 @@ class DrowlTrademarkFunctionalJavascriptTest extends WebDriverTestBase {
  protected static $modules = [
    'node',
    'test_page_test',
    'editor',
    'filter',
    'drowl_trademark',
    'drowl_trademark_test',
  ];

  /**
@@ -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>');
@@ -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');
  }

  /**
@@ -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>');