Files
frontend-app-authoring/package.json
David Joy 63444e6861 refactor: use Paragon versions of Stepper and FullscreenModal (#94)
* test: adding @testing-library/user-event

We use this library to simulate user clicks on interactive elements.

* test: adding some test environment mocks

Paragon components tend to use some advanced browser features that aren’t available in node.js/jest’s environment.  This safely mocks those features so that testing can proceed.

* test: Make our API responses reusable

Our future tests for DiscussionsSettings will want to use these API responses, so pull them out into a “factories” directory so multiple tests can re-use them.

The directory is called “factories” because ideally we’d use a test data factory to generate this data if we need a number of varieties of it.  Right now we just need these two, so generating factories for it isn’t really worthwhile.  But we might as well put it in the right place.

* refactor: use new CheckboxControl for AppCards

This replaces our usage of Input for checkboxes with a new CheckboxControl which is made specifically for this sort of use case.

It also adds an aria-label that describes what the checkbox does: “Select <appName>”

* feat: adds aria-label to Next button

The button lacked a label - this also lets us use queryByLabelText in our tests.

* test: favoring getByRole over getByTestId

The testing-library documentation talks about how it’s preferable to write tests that act like screen readers and inspect the DOM in ways that a user would.  Adding “test IDs” is a last resort when no better option is available.  The spinner actually has a “status” role on it, so we can use that instead here.

* feat: adding a spinner to the AppConfigForm

Improves the UX here by giving the user some feedback, and also makes it consistent with how AppList works.

* fix: set the selected app in redux so it’s official

Prior to this, we derived a selected app from the activeAppId if one wasn’t actively selected, but we never sent that decision back to redux.  This closes the loop.

* fix: add the message for selecting an app

Forgot to include this in a prior commit.  Oops.

* refactor: use Paragon Stepper and FullscreenModal

Also deletes our app-specific implementations of Stepper and FullScreenModal.

Note that the routes were pulled up into PagesAndResources.  This is so that we can access the appId param in DiscussionsSettings, and is an artifact of how react-router works.  You can’t access sub-route params in the same component that defines sub-routes.

Related to this, we now decide which step we’re on by examining the appId parameter, rather than having a route per step.  Conceptually it’s the same and each step has its own route, but now DiscussionsSettings just has multiple routes and doesn’t define subroutes.

* test: Adding tests proving that DiscussionsSettings works

This exercises the modal and stepper, proving that they interact with routes properly.  It also exercises the navigation buttons.

* doc: documenting selectedAppId and activeAppId

* fix: removing unnecessary aria-label attributes

aria-label is only necessary on buttons if the button text doesn’t sufficiently label the button, i.e., in the case that the button text is an “X” instead of the word “Close”.  This removes unnecessary button aria-labe attributes and updates the tests not to use them.

* test: adding more DiscussionsSettings tests

- form submission
- loading the ‘legacy’ form

* test: improving coverage for “full support” apps
2021-04-22 12:26:01 -04:00

79 lines
2.3 KiB
JSON

{
"name": "@edx/frontend-app-course-authoring",
"version": "0.1.0",
"description": "Frontend application template",
"repository": {
"type": "git",
"url": "git+https://github.com/edx/frontend-app-course-authoring.git"
},
"browserslist": [
"last 2 versions",
"ie 11"
],
"scripts": {
"build": "fedx-scripts webpack",
"i18n_extract": "BABEL_ENV=i18n fedx-scripts babel src --quiet > /dev/null",
"is-es5": "es-check es5 ./dist/*.js",
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
"snapshot": "fedx-scripts jest --updateSnapshot",
"start": "fedx-scripts webpack-dev-server --progress",
"test": "fedx-scripts jest --coverage --passWithNoTests"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
},
"author": "edX",
"license": "AGPL-3.0",
"homepage": "https://github.com/edx/frontend-app-course-authoring#readme",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/edx/frontend-app-course-authoring/issues"
},
"dependencies": {
"@edx/brand": "npm:@edx/brand-openedx@1.1.0",
"@edx/frontend-component-footer": "10.0.11",
"@edx/frontend-platform": "1.9.0",
"@edx/paragon": "14.7.0",
"@fortawesome/fontawesome-svg-core": "1.2.28",
"@fortawesome/free-brands-svg-icons": "5.11.2",
"@fortawesome/free-regular-svg-icons": "5.11.2",
"@fortawesome/free-solid-svg-icons": "5.11.2",
"@fortawesome/react-fontawesome": "0.1.9",
"@reduxjs/toolkit": "1.5.0",
"classnames": "2.2.6",
"core-js": "3.8.1",
"email-validator": "2.0.4",
"formik": "2.2.6",
"moment": "2.27.0",
"prop-types": "15.7.2",
"react": "16.14.0",
"react-dom": "16.14.0",
"react-redux": "7.1.3",
"react-responsive": "8.1.0",
"react-router": "5.1.2",
"react-router-dom": "5.1.2",
"react-transition-group": "4.4.1",
"redux": "4.0.5",
"regenerator-runtime": "0.13.7",
"yup": "0.31.1"
},
"devDependencies": {
"@edx/frontend-build": "5.6.11",
"@testing-library/jest-dom": "5.11.10",
"@testing-library/react": "10.4.7",
"@testing-library/user-event": "^13.1.5",
"axios-mock-adapter": "1.18.1",
"codecov": "3.7.1",
"es-check": "5.1.0",
"glob": "7.1.6",
"husky": "3.1.0",
"jest": "24.9.0",
"react-test-renderer": "16.9.0",
"reactifex": "1.1.1"
}
}