Skip to content

Commit 753e94f

Browse files
authored
Use act from @test-utils in SC (#32432)
* test: use `act` from `@test-utils` in SC * chore: add rules to enforce use of act from `@test-utils`
1 parent 1b76f2b commit 753e94f

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

packages/shared-components/.eslintrc.cjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ module.exports = {
3030
"react/jsx-key": ["error"],
3131
"matrix-org/require-copyright-header": "error",
3232
"react-compiler/react-compiler": "error",
33+
"no-restricted-imports": [
34+
"error",
35+
{
36+
paths: [
37+
{
38+
name: "react",
39+
importNames: ["act"],
40+
message: "Please use @test-utils instead.",
41+
},
42+
],
43+
},
44+
],
3345
},
3446
overrides: [
3547
{

packages/shared-components/src/room-list/RoomListPrimaryFilters/RoomListPrimaryFilters.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* Please see LICENSE files in the repository root for full details.
66
*/
77

8-
import React, { act } from "react";
9-
import { render, screen } from "@test-utils";
8+
import React from "react";
9+
import { act, render, screen } from "@test-utils";
1010
import userEvent from "@testing-library/user-event";
1111
import { composeStories } from "@storybook/react-vite";
1212
import { describe, it, expect, vi, beforeEach } from "vitest";

0 commit comments

Comments
 (0)