Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace act import deprecation warnings #3050

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading