Skip to content

Commit 2e16a13

Browse files
committed
fix: update useEffect dependency and clean up test mocks for OpportunityList
1 parent 9f71487 commit 2e16a13

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

apps/trustlab/src/components/OpportunityList/OpportunityList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const OpportunityList = forwardRef(function OpportunityList(props, ref) {
8484
};
8585
setParams(newParams);
8686
// eslint-disable-next-line react-hooks/exhaustive-deps
87-
}, [query]);
87+
}, []);
8888

8989
const { items = [], pagination = p } = useOpportunities(
9090
page,

apps/trustlab/src/components/OpportunityList/OpportunityList.test.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ import OpportunityList from "./OpportunityList";
55

66
import theme from "@/trustlab/theme";
77

8-
// Mock next/router
9-
jest.mock("next/router", () => ({
10-
useRouter: () => ({
11-
push: jest.fn(),
12-
query: {},
13-
pathname: "/opportunities",
14-
}),
15-
}));
16-
178
const render = createRender({ theme });
189

1910
const mockItems = [
@@ -24,8 +15,8 @@ const mockItems = [
2415
root: {
2516
children: [
2617
{
27-
children: [{ text: "Description for item 1" }],
28-
type: "paragraph",
18+
text: "Description for item 1",
19+
type: "text",
2920
},
3021
],
3122
},
@@ -48,8 +39,8 @@ const mockItems = [
4839
root: {
4940
children: [
5041
{
51-
children: [{ text: "Description for item 2" }],
52-
type: "paragraph",
42+
text: "Description for item 2",
43+
type: "text",
5344
},
5445
],
5546
},

0 commit comments

Comments
 (0)