diff --git a/package.json b/package.json index d7ef31c115..0887e7b61f 100644 --- a/package.json +++ b/package.json @@ -72,16 +72,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", @@ -138,12 +138,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", @@ -171,10 +170,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/__tests__/__snapshots__/ContentDisplay.tsx.snap b/src/commons/__tests__/__snapshots__/ContentDisplay.tsx.snap index a10dcc05e0..cd84441922 100644 --- a/src/commons/__tests__/__snapshots__/ContentDisplay.tsx.snap +++ b/src/commons/__tests__/__snapshots__/ContentDisplay.tsx.snap @@ -1,19 +1,21 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ContentDisplay page renders correctly 1`] = ` -
+
-
- Test Content +
+
+ Test Content +
-
+
`; diff --git a/src/commons/__tests__/__snapshots__/Markdown.tsx.snap b/src/commons/__tests__/__snapshots__/Markdown.tsx.snap index baf1d93d8f..f9a9e46630 100644 --- a/src/commons/__tests__/__snapshots__/Markdown.tsx.snap +++ b/src/commons/__tests__/__snapshots__/Markdown.tsx.snap @@ -1,16 +1,75 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP 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/application/__tests__/Application.tsx b/src/commons/application/__tests__/Application.tsx deleted file mode 100644 index 54ff1729f2..0000000000 --- a/src/commons/application/__tests__/Application.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { useTypedSelector } from 'src/commons/utils/Hooks'; -import { shallowRender } from 'src/commons/utils/TestUtils'; - -import Application from '../Application'; - -// JSDOM does not implement window.matchMedia, so we have to mock it. -window.matchMedia = - window.matchMedia || - function () { - return { - matches: false, - addListener: function () {}, - removeListener: function () {} - }; - }; - -jest.mock('react-redux', () => ({ - ...jest.requireActual('react-redux'), - useDispatch: jest.fn(), - useSelector: jest.fn() -})); -const useSelectorMock = useTypedSelector as jest.Mock; - -test('Application renders correctly', () => { - useSelectorMock.mockReturnValue({ name: 'Bob' }); - - const app = ; - const tree = shallowRender(app); - expect(tree).toMatchSnapshot(); -}); diff --git a/src/commons/application/__tests__/__snapshots__/Application.tsx.snap b/src/commons/application/__tests__/__snapshots__/Application.tsx.snap deleted file mode 100644 index 48245c5e41..0000000000 --- a/src/commons/application/__tests__/__snapshots__/Application.tsx.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Application renders correctly 1`] = ` - -
- -
- -
-
-
-`; diff --git a/src/commons/assessment/__tests__/__snapshots__/Assessment.tsx.snap b/src/commons/assessment/__tests__/__snapshots__/Assessment.tsx.snap index 7f453e8c1b..ea908d8029 100644 --- a/src/commons/assessment/__tests__/__snapshots__/Assessment.tsx.snap +++ b/src/commons/assessment/__tests__/__snapshots__/Assessment.tsx.snap @@ -1,1692 +1,1558 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Assessment page "loading" content renders correctly 1`] = ` -
+
- - - - + + + + +
-
-
-
- Fetching assessment... +
+
+ Fetching assessment... +
-
+ `; exports[`Assessment page does not show attempt Button for upcoming assessments for student user 1`] = ` -
+
- -
+ + + + + + Upcoming + +
-
-
-
- Assessment -
+
+
+ Assessment +
+
-

- An Odessey to Runes (Duplicate) -

-
-
- + An Odessey to Runes (Duplicate) + +
+
- - + + +
-
-
-
- Max XP: 1000 -
-
-
+
+ Max XP: 1000 +
+
This is a test for the UI of the unopened assessment overview. It links to the mock Mission 0

", - } - } - /> -
-
-
- This is an individual assessment. -
-
-
-
- - - - - - Opens: 18th June, 13:24 +

+ This is a test for the UI of the unopened assessment overview. It links to the mock Mission 0 +

-
-
-
-
-
-
-
- -
-
-
-
-
- Assessment -
-
-
-
-

+

- The Secret to Streams -
+ This is an individual assessment. +
+
+
+
+
+
+
+ +
+
+
+
-
- Max XP: 1000 -
+ Assessment
Once upon a time, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nec vulputate sapien. Fusce vel lacus fermentum, efficitur ipsum.

", - } - } - /> -
-
-
- This is an individual assessment. -
-
-
-
- - - - - - Opened: 18th July, 13:24 + The Secret to Streams +
- - - + + + + Finalize + + + Submission + + + - Due: 18th June, 13:24
+
+ Max XP: 1000 +
+
+ +
+
+
+ This is an individual assessment. +
+
+
-
-
-
-
-
- Assessment -
- +
+
+
+
-
- Max XP: 1000 -
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor - incididunt ut labore et dolore magna aliqua.

-
  const a = 5;
-
-

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium - doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore - veritatis et quasi architecto beatae vitae dicta sunt - explicabo.

", - } - } + Assessment
-
- This is a team assessment. -
-
-
-
- - - - - - Opened: 18th June, 13:24 + An Odessey to Runes +
- - - + + + + Finalize + + + Submission + + + - Due: 18th June, 13:24
+
+ Max XP: 1000 +
+
+
+
+

+ + Lorem ipsum + + dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. +

+ + +
+                          
+                              const a = 5;
+
+                          
+                        
+ + +

+ Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium + + + doloremque laudantium + + , totam rem aperiam, eaque ipsa quae ab illo inventore + + + veritatis et quasi architecto + + beatae vitae dicta sunt + + + explicabo + + . +

+
+
+ +
-
- -
+ + + + + + Closed + +
+ class="bp5-collapse" + > +
-
+ `; exports[`Assessment page with 0 missions renders correctly 1`] = ` -
+
- - - -
-
-

+ + + +

+
- There are no assessments. - +

+ There are no assessments. +

+
-
+ `; exports[`Assessment page with multiple loaded missions renders correctly 1`] = ` -
+
-
-
-
-
-
- -
+ + + + + + Open + +
-
-
-
- Assessment -
+
+
+ Assessment +
+
-

- The Secret to Streams -

-
-
- + The Secret to Streams + +
+
- - + + +
-
-
-
- Max XP: 1000 -
-
-
+
+ Max XP: 1000 +
+
Once upon a time, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nec vulputate sapien. Fusce vel lacus fermentum, efficitur ipsum.

", - } - } - /> -
-
-
- This is an individual assessment. -
-
-
-
- - - - - - Opened: 18th July, 13:24 +

+ Once upon a time, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nec vulputate sapien. Fusce vel lacus fermentum, efficitur ipsum. +

-
+
+
- - - - - - Due: 18th June, 13:24 -
+ This is an individual assessment. +
-
-
-
-
-
-
-
- Assessment -
- +
+
+
+
-
- Max XP: 1000 -
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor - incididunt ut labore et dolore magna aliqua.

-
  const a = 5;
-
-

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium - doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore - veritatis et quasi architecto beatae vitae dicta sunt - explicabo.

", - } - } + Assessment
-
- This is a team assessment. -
-
-
-
- - - - - - Opened: 18th June, 13:24 + An Odessey to Runes +
- - - + + + + Finalize + + + Submission + + + - Due: 18th June, 13:24
+
+ Max XP: 1000 +
+
+
+
+

+ + Lorem ipsum + + dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. +

+ + +
+                          
+                              const a = 5;
+
+                          
+                        
+ + +

+ Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium + + + doloremque laudantium + + , totam rem aperiam, eaque ipsa quae ab illo inventore + + + veritatis et quasi architecto + + beatae vitae dicta sunt + + + explicabo + + . +

+
+
+ +
-
- -
+ + + + + + Closed + +
+ class="bp5-collapse" + > +
-
+ `; diff --git a/src/commons/assessmentWorkspace/__tests__/__snapshots__/AssessmentWorkspace.tsx.snap b/src/commons/assessmentWorkspace/__tests__/__snapshots__/AssessmentWorkspace.tsx.snap index 3f1f133cb7..f455263a91 100644 --- a/src/commons/assessmentWorkspace/__tests__/__snapshots__/AssessmentWorkspace.tsx.snap +++ b/src/commons/assessmentWorkspace/__tests__/__snapshots__/AssessmentWorkspace.tsx.snap @@ -1,57 +1,54 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP 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`] = ` @@ -387,7 +384,6 @@ exports[`AssessmentWorkspace AssessmentWorkspace page with ContestVoting questio