Skip to content

Commit 42c78c0

Browse files
Replace act import deprecation warnings (#3050)
1 parent 23a408d commit 42c78c0

File tree

13 files changed

+25
-14
lines changed

13 files changed

+25
-14
lines changed

src/commons/assessment/__tests__/Assessment.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Store } from '@reduxjs/toolkit';
2-
import { act, render, screen } from '@testing-library/react';
2+
import { render, screen } from '@testing-library/react';
3+
import { act } from 'react';
34
import { Provider } from 'react-redux';
45
import { createMemoryRouter, RouterProvider } from 'react-router';
56
import { OverallState, Role } from 'src/commons/application/ApplicationTypes';

src/commons/assessmentWorkspace/__tests__/AssessmentWorkspace.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { act, render, screen } from '@testing-library/react';
1+
import { render, screen } from '@testing-library/react';
2+
import { act } from 'react';
23
import { Provider } from 'react-redux';
34
import { createMemoryRouter, RouterProvider } from 'react-router';
45
import { mockInitialStore } from 'src/commons/mocks/StoreMocks';

src/commons/gitHubOverlay/__tests__/FileExplorerDialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Octokit } from '@octokit/rest';
2-
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
2+
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
3+
import { act } from 'react';
34

45
import * as GitHubUtils from '../../../features/github/GitHubUtils';
56
import FileExplorerDialog from '../FileExplorerDialog';

src/commons/gitHubOverlay/__tests__/RepositoryDialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { act, fireEvent, render, screen } from '@testing-library/react';
1+
import { fireEvent, render, screen } from '@testing-library/react';
2+
import { act } from 'react';
23

34
import * as NotificationHelper from '../../utils/notifications/NotificationsHelper';
45
import RepositoryDialog from '../RepositoryDialog';

src/commons/profile/__tests__/Profile.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { act, render, screen } from '@testing-library/react';
1+
import { render, screen } from '@testing-library/react';
2+
import { act } from 'react';
23
import { Provider } from 'react-redux';
34
import { MemoryRouter } from 'react-router';
45
import { OverallState, Role } from 'src/commons/application/ApplicationTypes';

src/commons/sideContent/__tests__/SideContentAutograder.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { act, render, screen } from '@testing-library/react';
1+
import { render, screen } from '@testing-library/react';
22
import { ErrorSeverity, ErrorType, SourceError } from 'js-slang/dist/types';
3+
import { act } from 'react';
34
import { shallowRender } from 'src/commons/utils/TestUtils';
45

56
import { AutogradingResult, Testcase, TestcaseTypes } from '../../assessment/AssessmentTypes';

src/commons/sideContent/__tests__/SideContentContestLeaderboard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { act, render, screen } from '@testing-library/react';
1+
import { render, screen } from '@testing-library/react';
22
import userEvent from '@testing-library/user-event';
3+
import { act } from 'react';
34
import { shallowRender } from 'src/commons/utils/TestUtils';
45

56
import SideContentContestLeaderboard from '../content/SideContentContestLeaderboard';

src/commons/sideContent/__tests__/SideContentContestVoting.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { act, fireEvent, render, screen } from '@testing-library/react';
1+
import { fireEvent, render, screen } from '@testing-library/react';
2+
import { act } from 'react';
23
import { renderTreeJson } from 'src/commons/utils/TestUtils';
34

45
import SideContentContestVotingContainer from '../content/SideContentContestVotingContainer';

src/commons/sideContent/__tests__/SideContentCseMachine.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { act, render, screen } from '@testing-library/react';
1+
import { render, screen } from '@testing-library/react';
22
import { runInContext } from 'js-slang/dist/';
3+
import { act } from 'react';
34
import { Provider } from 'react-redux';
45
import { mockInitialStore } from 'src/commons/mocks/StoreMocks';
56
import { renderTreeJson } from 'src/commons/utils/TestUtils';

src/commons/utils/TestUtils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { act } from '@testing-library/react';
2-
import React from 'react';
1+
import React, { act } from 'react';
32
import renderer from 'react-test-renderer';
43
import { createRenderer } from 'react-test-renderer/shallow';
54

src/features/sicp/errors/__tests__/SicpErrors.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { act, render, screen } from '@testing-library/react';
1+
import { render, screen } from '@testing-library/react';
2+
import { act } from 'react';
23
import { shallowRender } from 'src/commons/utils/TestUtils';
34

45
import getSicpError, { SicpErrorType } from '../SicpErrors';

src/pages/githubCallback/__tests__/GitHubCallback.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { act, render, screen } from '@testing-library/react';
1+
import { render, screen } from '@testing-library/react';
2+
import { act } from 'react';
23
import { Route, Routes } from 'react-router';
34
import { StaticRouter } from 'react-router-dom/server';
45

src/pages/playground/__tests__/Playground.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Dispatch, Store } from '@reduxjs/toolkit';
22
import { Router } from '@remix-run/router';
3-
import { act, render } from '@testing-library/react';
3+
import { render } from '@testing-library/react';
44
import { FSModule } from 'browserfs/dist/node/core/FS';
55
import { Chapter } from 'js-slang/dist/types';
6+
import { act } from 'react';
67
import { Provider } from 'react-redux';
78
import { createMemoryRouter, RouteObject, RouterProvider } from 'react-router';
89
import {

0 commit comments

Comments
 (0)