diff --git a/package.json b/package.json index a0113308b8..cca08069c4 100644 --- a/package.json +++ b/package.json @@ -76,16 +76,16 @@ "phaser": "~3.90.0", "query-string": "^9.0.0", "re-resizable": "^6.9.9", - "react": "^18.3.1", + "react": "^19.1.0", "react-ace": "^14.0.0", "react-copy-to-clipboard": "^5.1.0", "react-debounce-render": "^8.0.2", - "react-dom": "^18.3.1", + "react-dom": "^19.1.0", "react-drag-drop-files": "^3.0.0", "react-draggable": "^4.4.5", "react-dropzone": "^14.2.3", "react-i18next": "^15.0.0", - "react-konva": "^18.2.10", + "react-konva": "^19.0.7", "react-latex-next": "^3.0.0", "react-mde": "^11.5.0", "react-papaparse": "^4.0.2", @@ -139,12 +139,11 @@ "@types/js-cookie": "^3.0.6", "@types/js-yaml": "^4.0.5", "@types/lodash": "^4.14.195", - "@types/react": "^18.3.3", + "@types/react": "^19.1.8", "@types/react-copy-to-clipboard": "^5.0.4", - "@types/react-dom": "^18.3.0", + "@types/react-dom": "^19.1.6", "@types/react-redux": "^7.1.24", "@types/react-syntax-highlighter": "^15.5.7", - "@types/react-test-renderer": "^18.0.0", "@types/redux-mock-store": "^1.0.3", "@types/showdown": "^2.0.1", "@types/xml2js": "^0.4.11", @@ -173,10 +172,10 @@ "prettier": "^3.3.3", "process": "^0.11.10", "react-error-overlay": "^6.0.11", - "react-test-renderer": "^18.2.0", "redux-saga-test-plan": "^4.0.6", "resize-observer-polyfill": "^1.5.1", "sass": "^1.63.6", + "shallow-react-snapshot": "^0.2.2", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "timers-browserify": "^2.0.12", diff --git a/src/commons/ContentDisplay.tsx b/src/commons/ContentDisplay.tsx index 30f77584f7..35e442646a 100644 --- a/src/commons/ContentDisplay.tsx +++ b/src/commons/ContentDisplay.tsx @@ -1,5 +1,5 @@ import { Card, Elevation } from '@blueprintjs/core'; -import React, { useEffect } from 'react'; +import React, { type JSX, useEffect } from 'react'; export type ContentDisplayProps = { fullWidth?: boolean; diff --git a/src/commons/__tests__/__snapshots__/ContentDisplay.test.tsx.snap b/src/commons/__tests__/__snapshots__/ContentDisplay.test.tsx.snap index 7e524c0b5f..df045c8aa0 100644 --- a/src/commons/__tests__/__snapshots__/ContentDisplay.test.tsx.snap +++ b/src/commons/__tests__/__snapshots__/ContentDisplay.test.tsx.snap @@ -1,19 +1,21 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`ContentDisplay page renders correctly 1`] = ` -
+
-
- Test Content +
+
+ Test Content +
-
+
`; diff --git a/src/commons/__tests__/__snapshots__/Markdown.test.tsx.snap b/src/commons/__tests__/__snapshots__/Markdown.test.tsx.snap index 924eff7c36..cff2144717 100644 --- a/src/commons/__tests__/__snapshots__/Markdown.test.tsx.snap +++ b/src/commons/__tests__/__snapshots__/Markdown.test.tsx.snap @@ -1,16 +1,75 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Markdown page renders correctly 1`] = ` -
Welcome to the Source Academy playground!

-

The book Structure and Interpretation of Computer Programs, JavaScript Edition -uses JavaScript sublanguages that we call Source. You have chosen the sublanguage Source §1.

-

In the editor on the left, you can use the Ace keyboard shortcuts -and also the Source Academy keyboard shortcuts.

", - } - } -/> + +
+

+ Welcome to the Source Academy playground! +

+ + +

+ The book + + + Structure and Interpretation of Computer Programs, JavaScript Edition + + + +uses JavaScript sublanguages that we call + + + Source + + + . You have chosen the sublanguage + + + Source §1 + + + . +

+ + +

+ In the editor on the left, you can use the + + + Ace keyboard shortcuts + + + +and also the + + + Source Academy keyboard shortcuts + + + . +

+
+
`; diff --git a/src/commons/achievement/control/AchievementEditor.tsx b/src/commons/achievement/control/AchievementEditor.tsx index 9388ff6972..83bc712616 100644 --- a/src/commons/achievement/control/AchievementEditor.tsx +++ b/src/commons/achievement/control/AchievementEditor.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useState } from 'react'; +import React, { type JSX, useContext, useState } from 'react'; import { AchievementContext } from 'src/features/achievement/AchievementConstants'; import AchievementAdder from './achievementEditor/AchievementAdder'; diff --git a/src/commons/achievement/control/GoalEditor.tsx b/src/commons/achievement/control/GoalEditor.tsx index 9d0a40ef25..9ba8d3b73e 100644 --- a/src/commons/achievement/control/GoalEditor.tsx +++ b/src/commons/achievement/control/GoalEditor.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useState } from 'react'; +import React, { type JSX, useContext, useState } from 'react'; import { AchievementContext } from 'src/features/achievement/AchievementConstants'; import EditableGoal from './goalEditor/EditableGoal'; diff --git a/src/commons/assessment/Assessment.tsx b/src/commons/assessment/Assessment.tsx index 158ac7cacf..35f976e80e 100644 --- a/src/commons/assessment/Assessment.tsx +++ b/src/commons/assessment/Assessment.tsx @@ -13,7 +13,7 @@ import { } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import { sortBy } from 'lodash'; -import React, { useEffect, useMemo, useState } from 'react'; +import React, { type JSX, useEffect, useMemo, useState } from 'react'; import { useDispatch } from 'react-redux'; import { Navigate, useLoaderData, useParams } from 'react-router'; import { numberRegExp } from 'src/features/academy/AcademyTypes'; diff --git a/src/commons/assessmentWorkspace/__tests__/__snapshots__/AssessmentWorkspace.test.tsx.snap b/src/commons/assessmentWorkspace/__tests__/__snapshots__/AssessmentWorkspace.test.tsx.snap index fdbedb13ae..fc7ba41f38 100644 --- a/src/commons/assessmentWorkspace/__tests__/__snapshots__/AssessmentWorkspace.test.tsx.snap +++ b/src/commons/assessmentWorkspace/__tests__/__snapshots__/AssessmentWorkspace.test.tsx.snap @@ -1,57 +1,54 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AssessmentWorkspace > AssessmentWorkspace page "loading" content renders correctly 1`] = ` -
+
- - - - + + + + +
-
-
-
- Getting mission ready... +
+
+ Getting mission ready... +
-
+ `; exports[`AssessmentWorkspace > AssessmentWorkspace page with ContestVoting question renders correctly 1`] = ` @@ -398,7 +395,6 @@ exports[`AssessmentWorkspace > AssessmentWorkspace page with ContestVoting quest
AssessmentWorkspace page with ContestVoting quest
AssessmentWorkspace page with MCQ question render
AssessmentWorkspace page with overdue assessment
AssessmentWorkspace page with programming questio
AssessmentWorkspace renders Grading tab correctly