Problem/Motivation

Update: Manual testing shows that the filter function doesn't seem to work as expected, so the test seems to be right!

One test is still failing, where we'd expect the trademark to be filtered out:

Testing Drupal\Tests\drowl_trademark\FunctionalJavascript\DrowlTrademarkFunctionalJavascriptTest
..F                                                                 3 / 3 (100%)

Time: 00:18.039, Memory: 4.00 MB

There was 1 failure:

1) Drupal\Tests\drowl_trademark\FunctionalJavascript\DrowlTrademarkFunctionalJavascriptTest::testTrademarkInExcludedClass
Failed asserting that the text of the element identified by 'article > div > div > p' equals 'prefix test suffix'.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'prefix test suffix'
+'prefix test® suffix'

/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php:96
/var/www/html/core/tests/Drupal/Tests/WebAssert.php:995
/var/www/html/modules/contrib/drowl_trademark/tests/src/FunctionalJavascript/DrowlTrademarkFunctionalJavascriptTest.php:140
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:726

FAILURES!
Tests: 3, Assertions: 27, Failures: 1.

https://www.drupal.org/pift-ci-job/2344609

We should test manually that it works as expected and then try to find out, why it doesn't work in the test or what's the reason. Testing in the test would need to much time until we know the deeper reason.

Steps to reproduce

Test the filter functionality

Proposed resolution

Check and fix the filter functionality

Remaining tasks

Debug and fix the filter functionality
Write further tests for other nesting structures to ensure it works as expected

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Anybody created an issue. See original summary.

Grevil made their first commit to this issue’s fork.

grevil’s picture

Assigned: grevil » anybody

@Anybody you are probably faster than me, since it is your code. :)

anybody’s picture

Title: Fix failing test » Fix broken filter function and failing test
Assigned: anybody » Unassigned
Issue summary: View changes
anybody’s picture

Assigned: Unassigned » anybody

Thanks for the MR @grevil! This cleans up code and looks good, but I guess won't fix the bug. I'll have a deeper look soon!

grevil’s picture

Status: Active » Needs work

Great :)

anybody’s picture

Status: Needs work » Needs review
grevil’s picture

Status: Needs review » Needs work

Tests are still red.
The problem is that "filter_default_format()" always defaults to "plain text", since there are no other formats in the test environment, fixing this...

grevil’s picture

Ok, now the tests should be fixed.

The tests should be green now, hopefully, I can't test it locally right now for some reason...

anybody’s picture

The problem is that "filter_default_format()" always defaults to "plain text", since there are no other formats in the test environment, fixing this...

Plain text is okay, the replacements are not done by a text filter, but by JS intentionally as they have to be done globally, for example also on menu items, ...

anybody’s picture

Status: Needs work » Needs review

The problem is that "filter_default_format()" always defaults to "plain text", since there are no other formats in the test environment, fixing this...

Plain text is okay, the replacements are not done by a text filter, but by JS intentionally as they have to be done globally, for example also on menu items, ...

anybody’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.