Note: This adds the dependency package "jest-environment-dom" to package.json.
Run rm -rf node_modules && yarn install to update
React Unit Tests Part One
This PR only covers the following tests:
[x] Widget Player (widget-player.test.js)
[x] Widget Creator (widget-creator.test.js)
[x] Admin Widgets (widget-admin-page.test.js)
[x] Admin Instances (support-page.test.js)
To run, use the command:yarn test widget-player.test.js widget-creator.test.js support-page.test.js widget-admin-page.test.js
Running yarn test will include tests from the old dashboard as well as tests that have not been implemented (such as the collaborator and settings dialog).
Issues fixed
Widget Admin
[x] Widget Admin not displaying error message on failed saves
[x] Replacing Materia.Image.iconUrl with /util/icon-url.js
Widget Creator
[x] Pressing "Save Draft" doesn't change the text back after it saves (stays on "Saving...")
[x] Clicking "Update" in published widgets displays the Publish banner instead
Support / Admin Pages
[x] Includes user support role in User Admin
[x] The to_array function used by users_search and user_get now sets is_support_user based on searched user's ID instead of the current ID
[x] Make it so open_at dates must come before close_at dates
[x] Fixes name not updating in Admin Instance
[x] Copying a widget with 'Grant Access' on should set include current user as owner of copied widget
[x] Moves OnCopy to SupportSelectedInstance from the parent SupportPage
Collaborate Dialog
[x] Collaborate Dialog should show support users if they are collaborators
Other Issues Fixed
[x] Prefixes the widget admin files with widget-admin for organizational purposes.
History
This was originally #1402. However, since that PR, the creator and player race issues have been solved. I pulled the unit tests from that PR and updated them to account for new changes.
Note: This adds the dependency package "jest-environment-dom" to package.json.
Run
rm -rf node_modules && yarn install
to updateReact Unit Tests Part One
This PR only covers the following tests:
To run, use the command:
yarn test widget-player.test.js widget-creator.test.js support-page.test.js widget-admin-page.test.js
Running
yarn test
will include tests from the old dashboard as well as tests that have not been implemented (such as the collaborator and settings dialog).Issues fixed
Widget Admin
Widget Creator
Support / Admin Pages
Collaborate Dialog
Other Issues Fixed
History
This was originally #1402. However, since that PR, the creator and player race issues have been solved. I pulled the unit tests from that PR and updated them to account for new changes.
Pages to do in future parts