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
Issue fork drowl_trademark-3271083
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
Comment #4
grevil commented@Anybody you are probably faster than me, since it is your code. :)
Comment #5
anybodyComment #6
anybodyThanks 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!
Comment #7
grevil commentedGreat :)
Comment #8
anybodyComment #9
grevil commentedTests 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...
Comment #10
grevil commentedOk, now the tests should be fixed.
The tests should be green now, hopefully, I can't test it locally right now for some reason...
Comment #11
anybodyPlain 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, ...
Comment #12
anybodyPlain 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, ...
Comment #14
anybody