From b875af5ee4243a842ba33ef44483a0fd649b2995 Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Wed, 17 Apr 2024 12:12:57 -0500 Subject: [PATCH] fix: Removed not working testing-library rule, added waitFor --- .eslintrc | 1 + .../components/LandscapeForm/ProfileUpdate.test.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index c6524cced8..4c0892e959 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,6 +21,7 @@ "rules": { "prettier/prettier": "error", "testing-library/no-unnecessary-act": "off", + "testing-library/prefer-find-by": "off", "curly": "error" } } diff --git a/src/landscape/components/LandscapeForm/ProfileUpdate.test.js b/src/landscape/components/LandscapeForm/ProfileUpdate.test.js index 4ab887dc3f..7e2ba33dac 100644 --- a/src/landscape/components/LandscapeForm/ProfileUpdate.test.js +++ b/src/landscape/components/LandscapeForm/ProfileUpdate.test.js @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. */ -import { fireEvent, render, screen, within } from 'tests/utils'; +import { fireEvent, render, screen, waitFor, within } from 'tests/utils'; import React from 'react'; import { act } from 'react-dom/test-utils'; import { useParams } from 'react-router-dom'; @@ -50,6 +50,10 @@ const setup = async () => { }); fireEvent.change(combobox, { target: { value: newValue } }); + await waitFor(() => + expect(screen.getByRole('listbox', { name })).toBeInTheDocument() + ); + const optionsList = screen.getByRole('listbox', { name }); if (isNew) {