From ddddd508515bb4d578d7cd27db8c1407bee7bad9 Mon Sep 17 00:00:00 2001
From: Dave Long <dave@longwaveconsulting.com>
Date: Mon, 3 Feb 2025 21:54:43 +0000
Subject: [PATCH] Issue #3503556 by tom konda: Wrong Regular Expression for
 string comparison in Nightwatch.js assertion

(cherry picked from commit daf3cd72f76049d0f036b7545d623ad41663b11d)
---
 .../Drupal/Nightwatch/Assertions/deprecationErrorExists.js      | 2 +-
 core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js b/core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js
index 0b8b9f64f56c..e1afee8ea784 100644
--- a/core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js
+++ b/core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js
@@ -7,7 +7,7 @@ module.exports.assertion = function (expected) {
     const deprecationMessages =
       sessionStorageEntries !== null
         ? sessionStorageEntries.filter((message) =>
-            new RegExp('[Deprecation]').test(message),
+            message.includes('[Deprecation]'),
           )
         : [];
 
diff --git a/core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js b/core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js
index 8d5ab79b9e8a..2fb004e64f20 100644
--- a/core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js
+++ b/core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js
@@ -7,7 +7,7 @@ module.exports.assertion = function () {
     const deprecationMessages =
       sessionStorageEntries !== null
         ? sessionStorageEntries.filter((message) =>
-            new RegExp('[Deprecation]').test(message),
+            message.includes('[Deprecation]'),
           )
         : [];
 
-- 
GitLab