From 0167f5803e86fa29e22827c388e2bb81bd18b5ac Mon Sep 17 00:00:00 2001
From: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Date: Wed, 9 Nov 2022 18:20:53 +0100
Subject: [PATCH] Upgrade `@cypress/grep` library (#26299)

* Upgrade `cypress/grep` library

* Update Cypress config
---
 frontend/test/__support__/e2e/config.js  |  2 +-
 frontend/test/__support__/e2e/cypress.js |  3 ++-
 package.json                             |  2 +-
 yarn.lock                                | 33 ++++++++++--------------
 4 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/frontend/test/__support__/e2e/config.js b/frontend/test/__support__/e2e/config.js
index 25ae010a42a..ea03ff46095 100644
--- a/frontend/test/__support__/e2e/config.js
+++ b/frontend/test/__support__/e2e/config.js
@@ -33,7 +33,7 @@ const defaultConfig = {
 
     // `on` is used to hook into various events Cypress emits
     // `config` is the resolved Cypress config
-    require("cypress-grep/src/plugin")(config);
+    require("@cypress/grep/src/plugin")(config);
 
     /********************************************************************
      **                        PREPROCESSOR                            **
diff --git a/frontend/test/__support__/e2e/cypress.js b/frontend/test/__support__/e2e/cypress.js
index 65363174f9c..b07a2ca05cb 100644
--- a/frontend/test/__support__/e2e/cypress.js
+++ b/frontend/test/__support__/e2e/cypress.js
@@ -1,7 +1,8 @@
 // Cypress analytics and the alternative to Cypress dashboard
 // Needs to sit at the top of this file to catch all exceptions!
 import "@deploysentinel/cypress-debugger/support";
-require("cypress-grep")();
+import registerCypressGrep from "@cypress/grep";
+registerCypressGrep();
 
 import addContext from "mochawesome/addContext";
 import "@testing-library/cypress/add-commands";
diff --git a/package.json b/package.json
index 21e2f30717e..45654c6c5fd 100644
--- a/package.json
+++ b/package.json
@@ -116,6 +116,7 @@
     "@babel/preset-react": "^7.14.5",
     "@babel/preset-typescript": "^7.17.12",
     "@bahmutov/cypress-esbuild-preprocessor": "^2.1.5",
+    "@cypress/grep": "^3.1.0",
     "@cypress/skip-test": "^2.6.1",
     "@deploysentinel/cypress-debugger": "^0.5.3",
     "@emotion/babel-plugin": "^11.7.2",
@@ -210,7 +211,6 @@
     "concurrently": "^3.1.0",
     "css-loader": "^0.28.7",
     "cypress": "^10.9.0",
-    "cypress-grep": "^3.0.3",
     "cypress-real-events": "^1.7.1",
     "documentation": "^13.2.5",
     "esbuild": "^0.14.49",
diff --git a/yarn.lock b/yarn.lock
index 14358b0bb3f..857f2059190 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2744,6 +2744,15 @@
     lazy-ass "1.6.0"
     ramda "0.26.1"
 
+"@cypress/grep@^3.1.0":
+  version "3.1.0"
+  resolved "https://registry.yarnpkg.com/@cypress/grep/-/grep-3.1.0.tgz#d055fd63a9dd59326020af90e2fe56610ea89ec6"
+  integrity sha512-ZSAwUyEw7e7Lu4KhjQLZrJDnzA04awqikj7ZcPHr+oW4wDpiVscn7VEZ/P/WRC1fBydUoZ5e24aFEPxXmKCreg==
+  dependencies:
+    debug "^4.3.2"
+    find-test-names "^1.19.0"
+    globby "^11.0.4"
+
 "@cypress/request@^2.88.10":
   version "2.88.10"
   resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.10.tgz#b66d76b07f860d3a4b8d7a0604d020c662752cce"
@@ -9690,15 +9699,6 @@ cyclist@^1.0.1:
   resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
   integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=
 
-cypress-grep@^3.0.3:
-  version "3.0.3"
-  resolved "https://registry.yarnpkg.com/cypress-grep/-/cypress-grep-3.0.3.tgz#fb79b26a30333ce75f512b52824bc3b288f90919"
-  integrity sha512-N7AErz9HJavM0+l59ktRa0Ix9/kljp59eXYqW/JuuYQg2xaa4LsWxk93KPwXeaaEyPvWcrABEgXNSxFe1L/qCQ==
-  dependencies:
-    debug "4.3.1"
-    find-test-names "^1.17.2"
-    globby "^11.0.4"
-
 cypress-real-events@^1.7.1:
   version "1.7.1"
   resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.7.1.tgz#8f430d67c29ea4f05b9c5b0311780120cbc9b935"
@@ -9967,13 +9967,6 @@ debug@4.1.1:
   dependencies:
     ms "^2.1.1"
 
-debug@4.3.1:
-  version "4.3.1"
-  resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
-  integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==
-  dependencies:
-    ms "2.1.2"
-
 debug@4.3.4, debug@^4.3.4:
   version "4.3.4"
   resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
@@ -11887,10 +11880,10 @@ find-root@^1.1.0:
   resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4"
   integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==
 
-find-test-names@^1.17.2:
-  version "1.19.0"
-  resolved "https://registry.yarnpkg.com/find-test-names/-/find-test-names-1.19.0.tgz#aae8bd6d2defd61393142ae5d79cf69a987e78a5"
-  integrity sha512-pAa+CyHs3KUtFVPQPfpw5HpZ7GWQNKdYrMRwyGnuiXbqERXhZmTM7K2z7Uccqo84c+GFrmxDptAW4BDi2k7srQ==
+find-test-names@^1.19.0:
+  version "1.21.0"
+  resolved "https://registry.yarnpkg.com/find-test-names/-/find-test-names-1.21.0.tgz#fe0d0bdd7e8ad9df6b5e0f08986e982654fc4417"
+  integrity sha512-yYcl4X2U1maVXCktO24e9K7qs1uDqDTQWe51gso6JgK2iinRbNyHKrb43/LQTit8/SteA2qODqPkapgeuSdzZw==
   dependencies:
     "@babel/parser" "^7.16.5"
     acorn-walk "^8.2.0"
-- 
GitLab