From 66285452854fea2a5777827e88919a5a14261b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A2ni=20Borges=20de=20Freitas?= Date: Thu, 31 Aug 2023 10:49:50 +0100 Subject: [PATCH] EWPP-3349: Fix failing tests for 10.1. --- .../FunctionalJavascript/InfoDisclosureExtraFieldTest.php | 5 +++++ .../FunctionalJavascript/InPageNavigationLibraryTest.php | 5 +++++ .../FunctionalJavascript/InPageNavigationParagraphTest.php | 5 +++++ .../tests/src/FunctionalJavascript/WysiwygTableTest.php | 5 +++++ .../tests/src/Kernel/InPageNavigationBlockTest.php | 5 +++++ .../oe_theme_helper/tests/src/Kernel/TwigExtensionTest.php | 7 ++++++- 6 files changed, 31 insertions(+), 1 deletion(-) diff --git a/modules/oe_theme_content_event/tests/src/FunctionalJavascript/InfoDisclosureExtraFieldTest.php b/modules/oe_theme_content_event/tests/src/FunctionalJavascript/InfoDisclosureExtraFieldTest.php index 4e9bde6b37..cea08818bc 100644 --- a/modules/oe_theme_content_event/tests/src/FunctionalJavascript/InfoDisclosureExtraFieldTest.php +++ b/modules/oe_theme_content_event/tests/src/FunctionalJavascript/InfoDisclosureExtraFieldTest.php @@ -18,6 +18,11 @@ */ class InfoDisclosureExtraFieldTest extends WebDriverTestBase { + /** + * {@inheritdoc} + */ + protected $failOnJavascriptConsoleErrors = FALSE; + /** * {@inheritdoc} */ diff --git a/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationLibraryTest.php b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationLibraryTest.php index dbd41a8a7e..e3e59cb632 100644 --- a/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationLibraryTest.php +++ b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationLibraryTest.php @@ -16,6 +16,11 @@ */ class InPageNavigationLibraryTest extends WebDriverTestBase { + /** + * {@inheritdoc} + */ + protected $failOnJavascriptConsoleErrors = FALSE; + /** * {@inheritdoc} */ diff --git a/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationParagraphTest.php b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationParagraphTest.php index 8c4c1ea5ec..8f27bcdebc 100644 --- a/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationParagraphTest.php +++ b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationParagraphTest.php @@ -17,6 +17,11 @@ */ class InPageNavigationParagraphTest extends WebDriverTestBase { + /** + * {@inheritdoc} + */ + protected $failOnJavascriptConsoleErrors = FALSE; + /** * {@inheritdoc} */ diff --git a/modules/oe_theme_helper/tests/src/FunctionalJavascript/WysiwygTableTest.php b/modules/oe_theme_helper/tests/src/FunctionalJavascript/WysiwygTableTest.php index 65d41398c9..3a945ae2c3 100644 --- a/modules/oe_theme_helper/tests/src/FunctionalJavascript/WysiwygTableTest.php +++ b/modules/oe_theme_helper/tests/src/FunctionalJavascript/WysiwygTableTest.php @@ -22,6 +22,11 @@ class WysiwygTableTest extends WebDriverTestBase { use CKEditorTestTrait; + /** + * {@inheritdoc} + */ + protected $failOnJavascriptConsoleErrors = FALSE; + /** * {@inheritdoc} */ diff --git a/modules/oe_theme_helper/tests/src/Kernel/InPageNavigationBlockTest.php b/modules/oe_theme_helper/tests/src/Kernel/InPageNavigationBlockTest.php index 28dd34f925..11ae77d34d 100644 --- a/modules/oe_theme_helper/tests/src/Kernel/InPageNavigationBlockTest.php +++ b/modules/oe_theme_helper/tests/src/Kernel/InPageNavigationBlockTest.php @@ -16,6 +16,11 @@ */ class InPageNavigationBlockTest extends AbstractKernelTestBase { + /** + * {@inheritdoc} + */ + protected $failOnJavascriptConsoleErrors = FALSE; + /** * Tests the block markup. */ diff --git a/modules/oe_theme_helper/tests/src/Kernel/TwigExtensionTest.php b/modules/oe_theme_helper/tests/src/Kernel/TwigExtensionTest.php index 15fa790e7f..c7e8f6ca84 100644 --- a/modules/oe_theme_helper/tests/src/Kernel/TwigExtensionTest.php +++ b/modules/oe_theme_helper/tests/src/Kernel/TwigExtensionTest.php @@ -70,6 +70,8 @@ public function testSmartTrimFilter(array $variables, array $assertions, array $ * An array of test data arrays with assertions. */ public function smartTrimFilterDataProvider(): array { + $drupal_version = (float) substr(\Drupal::VERSION, 0, 4); + return [ 'Trim a string' => [ 'variables' => [ @@ -121,7 +123,10 @@ public function smartTrimFilterDataProvider(): array { ], 'assertions' => [ 'contains' => [ - "<script>\n<!--//--><![CDATA[// ><!--\ndocum...\n//--><!]]>\n</script>", + // https://www.drupal.org/project/drupal/issues/3259255 + $drupal_version < 10.1 ? + "<script>\n<!--//--><![CDATA[// ><!--\ndocum...\n//--><!]]>\n</script>" : + "<script>\n//<![CDATA[\ndocum...\n//]]>\n</script>", ], ], ],