Skip to content

Commit

Permalink
fix: Removed not working testing-library rule, added waitFor
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui authored and paulschreiber committed Apr 29, 2024
1 parent 8dd32f4 commit b875af5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"rules": {
"prettier/prettier": "error",
"testing-library/no-unnecessary-act": "off",
"testing-library/prefer-find-by": "off",
"curly": "error"
}
}
6 changes: 5 additions & 1 deletion src/landscape/components/LandscapeForm/ProfileUpdate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b875af5

Please sign in to comment.