Skip to content

Commit e57d5b2

Browse files
Update version of react used in tests to same as production (#1917)
* update version of react used in tests * upgrade test version of react to 19, same major as prod
1 parent 51bdf22 commit e57d5b2

File tree

7 files changed

+52
-31
lines changed

7 files changed

+52
-31
lines changed

frontends/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"./test-utils": "./src/test-utils/index.ts"
1616
},
1717
"peerDependencies": {
18-
"react": "18.3.1"
18+
"react": "^19"
1919
},
2020
"devDependencies": {
2121
"@faker-js/faker": "^9.0.0",

frontends/main/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"ol-components": "0.0.0",
2626
"ol-utilities": "0.0.0",
2727
"posthog-js": "^1.157.2",
28-
"react": "^18",
29-
"react-dom": "^18",
28+
"react": "^19.0.0",
29+
"react-dom": "^19.0.0",
3030
"react-slick": "^0.30.2",
3131
"slick-carousel": "^1.8.1",
3232
"tiny-invariant": "^1.3.3",
@@ -40,8 +40,8 @@
4040
"@types/jest": "^29.5.12",
4141
"@types/lodash": "^4.17.7",
4242
"@types/node": "^22.0.0",
43-
"@types/react": "^18.3.5",
44-
"@types/react-dom": "^18.3.0",
43+
"@types/react": "^19",
44+
"@types/react-dom": "^19",
4545
"@types/react-slick": "^0.23.13",
4646
"@types/slick-carousel": "^1",
4747
"eslint": "8.57.1",

frontends/main/src/app-pages/ChannelPage/ChannelPage.test.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
setMockResponse,
88
waitFor,
99
renderWithProviders,
10+
expectLastProps,
1011
} from "@/test-utils"
1112
import ChannelSearch from "./ChannelSearch"
1213
import { assertHeadings, getByImageSrc } from "ol-test-utilities"
@@ -176,18 +177,13 @@ describe.each(ALL_CHANNEL_TYPES)(
176177
setupTopicApis(channel)
177178
}
178179
await screen.findAllByText(channel.title)
179-
const expectedProps = expect.objectContaining({
180+
181+
expectLastProps(mockedChannelSearch, {
180182
constantSearchParams: {
181183
platform: ["ocw", "mitxonline"],
182184
department: ["8", "9"],
183185
},
184186
})
185-
const expectedContext = expect.anything()
186-
187-
expect(mockedChannelSearch).toHaveBeenLastCalledWith(
188-
expectedProps,
189-
expectedContext,
190-
)
191187
}, 10000)
192188
it("Does not display the channel search if search_filter is undefined", async () => {
193189
const { channel } = setupApis({

frontends/main/src/test-utils/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const expectProps = (
107107
) => {
108108
expect(fc).toHaveBeenCalledWith(
109109
expect.objectContaining(partialProps),
110-
expect.anything(),
110+
expect.toBeOneOf([expect.anything(), undefined]),
111111
)
112112
}
113113

@@ -124,7 +124,7 @@ const expectLastProps = (
124124
) => {
125125
expect(fc).toHaveBeenLastCalledWith(
126126
expect.objectContaining(partialProps),
127-
expect.anything(),
127+
expect.toBeOneOf([expect.anything(), undefined]),
128128
)
129129
}
130130

frontends/ol-components/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@mui/system": "^6.1.6",
2525
"@remixicon/react": "^4.2.0",
2626
"@testing-library/dom": "^10.4.0",
27-
"@types/react-dom": "^18.3.0",
27+
"@types/react-dom": "^19",
2828
"@types/tinycolor2": "^1.4.6",
2929
"api": "workspace:*",
3030
"classnames": "^2.5.1",
@@ -34,8 +34,8 @@
3434
"next": "^15.0.2",
3535
"ol-test-utilities": "0.0.0",
3636
"ol-utilities": "0.0.0",
37-
"react": "18.3.1",
38-
"react-dom": "^18.3.1",
37+
"react": "^19.0.0",
38+
"react-dom": "^19.0.0",
3939
"react-router": "^6.22.2",
4040
"react-router-dom": "^6.22.2",
4141
"react-select": "^5.7.7",

frontends/ol-utilities/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"./test-utils/factories": "./src/test-utils/factories.ts"
88
},
99
"peerDependencies": {
10-
"next": "^14.2.15",
11-
"react": "18.3.1"
10+
"next": "^15",
11+
"react": "19"
1212
},
1313
"sideEffects": false,
1414
"dependencies": {

yarn.lock

Lines changed: 37 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)