Skip to content

Commit

Permalink
fix: update act import to remove depreaction warning
Browse files Browse the repository at this point in the history
  • Loading branch information
paulschreiber committed Apr 29, 2024
1 parent e449e69 commit bebc9b5
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/account/components/AccountProfile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { fireEvent, render, screen, within } from 'tests/utils';
import React from 'react';

Check failure on line 18 in src/account/components/AccountProfile.test.js

View workflow job for this annotation

GitHub Actions / lint

Insert `,·{·act·}`
import { when } from 'jest-when';
import _ from 'lodash/fp';

Check failure on line 20 in src/account/components/AccountProfile.test.js

View workflow job for this annotation

GitHub Actions / lint

Delete `';⏎import·{·act·}·from·'react`
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useNavigate, useParams, useSearchParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
2 changes: 1 addition & 1 deletion src/contact/ContactForm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { render, screen } from 'tests/utils';
import React from 'react';

Check failure on line 18 in src/contact/ContactForm.test.js

View workflow job for this annotation

GitHub Actions / lint

Insert `,·{·act·}`
import _ from 'lodash/fp';

Check failure on line 19 in src/contact/ContactForm.test.js

View workflow job for this annotation

GitHub Actions / lint

Delete `';⏎import·{·act·}·from·'react`
import { act } from 'react-dom/test-utils';
import { act } from 'react';

import { useScript } from 'custom-hooks';

Expand Down
2 changes: 1 addition & 1 deletion src/group/components/GroupForm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen, within } from 'tests/utils';
import React from 'react';

Check failure on line 18 in src/group/components/GroupForm.test.js

View workflow job for this annotation

GitHub Actions / lint

Replace `·from·'react';⏎import` with `,`
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
2 changes: 1 addition & 1 deletion src/group/components/GroupList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen, within } from 'tests/utils';
import React from 'react';

Check failure on line 18 in src/group/components/GroupList.test.js

View workflow job for this annotation

GitHub Actions / lint

Replace `·from·'react';⏎import` with `,`
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useSearchParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';
import useMediaQuery from '@mui/material/useMediaQuery';
Expand Down
2 changes: 1 addition & 1 deletion src/group/membership/components/GroupMembers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { fireEvent, render, screen, waitFor, within } from 'tests/utils';
import React from 'react';

Check failure on line 18 in src/group/membership/components/GroupMembers.test.js

View workflow job for this annotation

GitHub Actions / lint

Insert `,·{·act·}`
import _ from 'lodash/fp';

Check failure on line 19 in src/group/membership/components/GroupMembers.test.js

View workflow job for this annotation

GitHub Actions / lint

Delete `';⏎import·{·act·}·from·'react`
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';
import { GROUP_TYPES_WITH_REDIRECTS } from 'tests/constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen, within } from 'tests/utils';
import React from 'react';

Check failure on line 18 in src/landscape/components/LandscapeForm/AffiliationUpdate.test.js

View workflow job for this annotation

GitHub Actions / lint

Replace `·from·'react';⏎import` with `,`
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen, waitFor, within } from 'tests/utils';
import React from 'react';

Check failure on line 18 in src/landscape/components/LandscapeForm/BoundaryStepNewBoundariesFile.test.js

View workflow job for this annotation

GitHub Actions / lint

Replace `·from·'react';⏎import` with `,`
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { fireEvent, render, screen, waitFor, within } from 'tests/utils';
import React from 'react';
import MapboxDraw from '@mapbox/mapbox-gl-draw';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { fireEvent, render, screen, waitFor, within } from 'tests/utils';
import React from 'react';
import MapboxDraw from '@mapbox/mapbox-gl-draw';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen } from 'tests/utils';
import React from 'react';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
2 changes: 1 addition & 1 deletion src/landscape/components/LandscapeForm/KeyInfoNew.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen, waitFor, within } from 'tests/utils';
import React from 'react';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen, within } from 'tests/utils';
import React from 'react';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { fireEvent, render, screen, waitFor } from 'tests/utils';
import React from 'react';
import AvatarEditor from 'react-avatar-editor';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen, within } from 'tests/utils';
import React from 'react';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';

Expand Down
2 changes: 1 addition & 1 deletion src/landscape/components/LandscapeList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen, waitFor, within } from 'tests/utils';
import React from 'react';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useSearchParams } from 'react-router-dom';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';
import { mockTerrasoAPIrequestGraphQL } from 'tests/apiUtils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { fireEvent, render, screen, waitFor, within } from 'tests/utils';
import React from 'react';
import _ from 'lodash/fp';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';
import { mockTerrasoAPIrequestGraphQL } from 'tests/apiUtils';
import useMediaQuery from '@mui/material/useMediaQuery';
Expand Down
2 changes: 1 addition & 1 deletion src/layout/AppBar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { fireEvent, render, screen } from 'tests/utils';
import React from 'react';
import Cookies from 'js-cookie';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import useMediaQuery from '@mui/material/useMediaQuery';

Expand Down
2 changes: 1 addition & 1 deletion src/localization/components/LocalePicker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { fireEvent, render, screen, within } from 'tests/utils';
import React from 'react';
import _ from 'lodash/fp';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import * as terrasoApi from 'terraso-client-shared/terrasoApi/api';
import useMediaQuery from '@mui/material/useMediaQuery';

Expand Down
2 changes: 1 addition & 1 deletion src/localization/i18n.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
import { render, screen } from 'tests/utils';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useTranslation } from 'react-i18next';

import i18n from 'localization/i18n';
Expand Down
2 changes: 1 addition & 1 deletion src/navigation/components/Navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { fireEvent, render, screen } from 'tests/utils';
import React from 'react';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import { useLocation } from 'react-router-dom';

import Navigation from 'navigation/components/Navigation';
Expand Down
2 changes: 1 addition & 1 deletion src/tests/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
render as rtlRender,
} from '@testing-library/react';
import { axe, toHaveNoViolations } from 'jest-axe';
import { act } from 'react-dom/test-utils';
import { act } from 'react';
import createStore from 'terrasoApi/store';

import AppWrappers from 'layout/AppWrappers';
Expand Down

0 comments on commit bebc9b5

Please sign in to comment.