Skip to content

Commit

Permalink
Replace act import deprecation warnings (#3050)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMythologist authored Sep 22, 2024
1 parent 23a408d commit 42c78c0
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/commons/assessment/__tests__/Assessment.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Store } from '@reduxjs/toolkit';
import { act, render, screen } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { act } from 'react';
import { Provider } from 'react-redux';
import { createMemoryRouter, RouterProvider } from 'react-router';
import { OverallState, Role } from 'src/commons/application/ApplicationTypes';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { act, render, screen } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { act } from 'react';
import { Provider } from 'react-redux';
import { createMemoryRouter, RouterProvider } from 'react-router';
import { mockInitialStore } from 'src/commons/mocks/StoreMocks';
Expand Down
3 changes: 2 additions & 1 deletion src/commons/gitHubOverlay/__tests__/FileExplorerDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Octokit } from '@octokit/rest';
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { act } from 'react';

import * as GitHubUtils from '../../../features/github/GitHubUtils';
import FileExplorerDialog from '../FileExplorerDialog';
Expand Down
3 changes: 2 additions & 1 deletion src/commons/gitHubOverlay/__tests__/RepositoryDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { act, fireEvent, render, screen } from '@testing-library/react';
import { fireEvent, render, screen } from '@testing-library/react';
import { act } from 'react';

import * as NotificationHelper from '../../utils/notifications/NotificationsHelper';
import RepositoryDialog from '../RepositoryDialog';
Expand Down
3 changes: 2 additions & 1 deletion src/commons/profile/__tests__/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { act, render, screen } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { act } from 'react';
import { Provider } from 'react-redux';
import { MemoryRouter } from 'react-router';
import { OverallState, Role } from 'src/commons/application/ApplicationTypes';
Expand Down
3 changes: 2 additions & 1 deletion src/commons/sideContent/__tests__/SideContentAutograder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { act, render, screen } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { ErrorSeverity, ErrorType, SourceError } from 'js-slang/dist/types';
import { act } from 'react';
import { shallowRender } from 'src/commons/utils/TestUtils';

import { AutogradingResult, Testcase, TestcaseTypes } from '../../assessment/AssessmentTypes';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { act, render, screen } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { act } from 'react';
import { shallowRender } from 'src/commons/utils/TestUtils';

import SideContentContestLeaderboard from '../content/SideContentContestLeaderboard';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { act, fireEvent, render, screen } from '@testing-library/react';
import { fireEvent, render, screen } from '@testing-library/react';
import { act } from 'react';
import { renderTreeJson } from 'src/commons/utils/TestUtils';

import SideContentContestVotingContainer from '../content/SideContentContestVotingContainer';
Expand Down
3 changes: 2 additions & 1 deletion src/commons/sideContent/__tests__/SideContentCseMachine.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { act, render, screen } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { runInContext } from 'js-slang/dist/';
import { act } from 'react';
import { Provider } from 'react-redux';
import { mockInitialStore } from 'src/commons/mocks/StoreMocks';
import { renderTreeJson } from 'src/commons/utils/TestUtils';
Expand Down
3 changes: 1 addition & 2 deletions src/commons/utils/TestUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { act } from '@testing-library/react';
import React from 'react';
import React, { act } from 'react';
import renderer from 'react-test-renderer';
import { createRenderer } from 'react-test-renderer/shallow';

Expand Down
3 changes: 2 additions & 1 deletion src/features/sicp/errors/__tests__/SicpErrors.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { act, render, screen } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { act } from 'react';
import { shallowRender } from 'src/commons/utils/TestUtils';

import getSicpError, { SicpErrorType } from '../SicpErrors';
Expand Down
3 changes: 2 additions & 1 deletion src/pages/githubCallback/__tests__/GitHubCallback.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { act, render, screen } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { act } from 'react';
import { Route, Routes } from 'react-router';
import { StaticRouter } from 'react-router-dom/server';

Expand Down
3 changes: 2 additions & 1 deletion src/pages/playground/__tests__/Playground.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Dispatch, Store } from '@reduxjs/toolkit';
import { Router } from '@remix-run/router';
import { act, render } from '@testing-library/react';
import { render } from '@testing-library/react';
import { FSModule } from 'browserfs/dist/node/core/FS';
import { Chapter } from 'js-slang/dist/types';
import { act } from 'react';
import { Provider } from 'react-redux';
import { createMemoryRouter, RouteObject, RouterProvider } from 'react-router';
import {
Expand Down

0 comments on commit 42c78c0

Please sign in to comment.