From 6619b103ced8537cf90febf94251c603334256bf Mon Sep 17 00:00:00 2001
From: Bastien Dumont <bdumont@grandlyon.com>
Date: Mon, 4 Mar 2024 11:40:01 +0100
Subject: [PATCH] Revert "chore(tests): add react testing library linting
 plugin"

This reverts commit 81219475221d5e488db62e6add9ffff9821b809d.
---
 .eslintrc.js                                          | 11 ++---------
 package.json                                          |  1 -
 .../Action/ActionOnGoing/ActionOnGoing.spec.tsx       |  2 +-
 .../ChallengeCardUnlocked.spec.tsx                    |  2 +-
 yarn.lock                                             |  9 +--------
 5 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/.eslintrc.js b/.eslintrc.js
index 195d0daae..9d68cf3ab 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -49,20 +49,13 @@ module.exports = {
     },
     {
       files: ['**/*.spec.{ts,tsx}'],
-      extends: ['plugin:jest/recommended', 'plugin:testing-library/react'],
+      extends: ['plugin:jest/recommended'],
       rules: {
         'jest/no-mocks-import': 0,
       },
     },
   ],
-  plugins: [
-    '@typescript-eslint',
-    'react',
-    'react-hooks',
-    'jest',
-    'jsx-a11y',
-    'testing-library',
-  ],
+  plugins: ['@typescript-eslint', 'react', 'react-hooks', 'jest', 'jsx-a11y'],
   parser: '@typescript-eslint/parser', // Specifies the ESLint parser
   parserOptions: {
     ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
diff --git a/package.json b/package.json
index 06c02dce2..2a58e3818 100644
--- a/package.json
+++ b/package.json
@@ -116,7 +116,6 @@
     "eslint-plugin-prettier": "^5.0.0",
     "eslint-plugin-react": "7.33.2",
     "eslint-plugin-react-hooks": "^4.6.0",
-    "eslint-plugin-testing-library": "^6.2.0",
     "git-directory-deploy": "1.5.1",
     "jest-canvas-mock": "^2.4.0",
     "jest-junit": "^16.0.0",
diff --git a/src/components/Action/ActionOnGoing/ActionOnGoing.spec.tsx b/src/components/Action/ActionOnGoing/ActionOnGoing.spec.tsx
index 4509fa4cd..899e6e3cd 100644
--- a/src/components/Action/ActionOnGoing/ActionOnGoing.spec.tsx
+++ b/src/components/Action/ActionOnGoing/ActionOnGoing.spec.tsx
@@ -46,6 +46,6 @@ describe('ActionOnGoing component', () => {
     )
     await waitFor(() => null, { container })
     await userEvent.click(await screen.findByText('action.details'))
-    expect(screen.getByRole('dialog')).toBeTruthy()
+    expect(screen.findByRole('dialog')).toBeTruthy()
   })
 })
diff --git a/src/components/Challenge/ChallengeCardUnlocked/ChallengeCardUnlocked.spec.tsx b/src/components/Challenge/ChallengeCardUnlocked/ChallengeCardUnlocked.spec.tsx
index 8aaa1d3c9..46c7d7a5f 100644
--- a/src/components/Challenge/ChallengeCardUnlocked/ChallengeCardUnlocked.spec.tsx
+++ b/src/components/Challenge/ChallengeCardUnlocked/ChallengeCardUnlocked.spec.tsx
@@ -38,7 +38,7 @@ describe('ChallengeCardUnlocked component', () => {
       </Provider>
     )
     await userEvent.click(screen.getByRole('button'))
-    expect(screen.getAllByRole('dialog').length).toBeTruthy()
+    expect(screen.queryAllByRole('dialog').length).toBeTruthy()
   })
 
   it('should not display ChallengeNoFluidModal and update userChallenge when launching challenge with configured fluid', async () => {
diff --git a/yarn.lock b/yarn.lock
index 0504b9bf6..421f54db9 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3377,7 +3377,7 @@
     eslint-scope "^5.1.1"
     semver "^7.3.7"
 
-"@typescript-eslint/utils@^5.10.0", "@typescript-eslint/utils@^5.58.0":
+"@typescript-eslint/utils@^5.10.0":
   version "5.62.0"
   resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86"
   integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==
@@ -7967,13 +7967,6 @@ eslint-plugin-react@7.33.2:
     semver "^6.3.1"
     string.prototype.matchall "^4.0.8"
 
-eslint-plugin-testing-library@^6.2.0:
-  version "6.2.0"
-  resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-6.2.0.tgz#af3340b783c881eb19ec5ac6b3a4bfe8ab4a1f74"
-  integrity sha512-+LCYJU81WF2yQ+Xu4A135CgK8IszcFcyMF4sWkbiu6Oj+Nel0TrkZq/HvDw0/1WuO3dhDQsZA/OpEMGd0NfcUw==
-  dependencies:
-    "@typescript-eslint/utils" "^5.58.0"
-
 eslint-plugin-vue@5.2.3:
   version "5.2.3"
   resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-5.2.3.tgz#3ee7597d823b5478804b2feba9863b1b74273961"
-- 
GitLab