Skip to content

Commit 3f774f3

Browse files
leslieyip02ravernjloh02
authored
feat(optimizer): Add optimizer unit tests and refactor (#4094)
* refactor: extract optimiser lesson option management and add unit tests * refactor: extract unassigned lesson option filtering and add unit tests * refactor: move optimiser test defaults into test-utils * feat: add optimiser button unit tests * feat: add optimiser results unit tests * refactor: WIP refactor optimiser form * refactor: update optimiser form styles * feat: add format unit tests * feat: add optimiser form unit tests * fix: revert api path * fix: set difference compatibility * fix: optimiser free day toggle * lint: remove unused import * fix: update style issues * fix: optimiser tooltip icon wrap * fix: update styles * refactor: replace enzyme with testing library * fix: set difference compatibility # Conflicts: # website/src/views/optimiser/OptimiserForm/OptimiserFreeDaySelect.tsx * lint: remove unused import * fix: remove hard coded value * fix: adjust styles * fix: update dropdown style --------- Co-authored-by: Ravern Koh <ravernkoh@gmail.com> Co-authored-by: Jonathan Loh <36648707+jloh02@users.noreply.github.com>
1 parent a731c43 commit 3f774f3

46 files changed

Lines changed: 2968 additions & 1280 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

website/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ If a community libdef is not available, you can try writing your own and placing
267267

268268
### Testing and Linting
269269

270-
We use [Jest][jest] with [Enzyme][enzyme] to test our code and React components, [TypeScript][ts] for typechecking, [Stylelint][stylelint] and [ESLint][eslint] using [Airbnb config][eslint-airbnb] and [Prettier][prettier] for linting and formatting.
270+
We use [Jest][jest] with [Enzyme][enzyme] and [Testing Library][testing-library] to test our code and React components, [TypeScript][ts] for typechecking, [Stylelint][stylelint] and [ESLint][eslint] using [Airbnb config][eslint-airbnb] and [Prettier][prettier] for linting and formatting.
271+
272+
**Note: The majority of React tests are written with Enzyme. For new unit tests, please try to use [Testing Library][testing-library] instead!**
271273

272274
```sh
273275
# Run all tests once with code coverage
@@ -404,6 +406,7 @@ Components should keep their styles and tests in the same directory with the sam
404406
[bootstrap]: https://getbootstrap.com/
405407
[jest]: https://facebook.github.io/jest/
406408
[enzyme]: http://airbnb.io/enzyme/
409+
[testing-library]: https://testing-library.com/docs/react-testing-library/intro/
407410
[ts]: https://www.typescriptlang.org/
408411
[eslint]: https://eslint.org/
409412
[svgr]: https://github.com/smooth-code/svgr

website/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
4343
"@svgr/webpack": "8.1.0",
4444
"@testing-library/dom": "10.4.0",
45-
"@testing-library/jest-dom": "6.6.3",
46-
"@testing-library/react": "16.1.0",
45+
"@testing-library/jest-dom": "^6.6.3",
46+
"@testing-library/react": "^16.3.0",
4747
"@testing-library/user-event": "14.5.2",
4848
"@types/body-scroll-lock": "2.6.2",
4949
"@types/enzyme": "3.10.18",

0 commit comments

Comments
 (0)