Skip to content

Commit

Permalink
test(react): update stories to fix failing avt (#11620)
Browse files Browse the repository at this point in the history
* test(react): update stories to fix failing avt

* test(react): lock achecker rule set

* chore(react): ran dedupe

* chore(jest-config): update moduleNameMapper for uuid support

Co-authored-by: Josh Black <[email protected]>
  • Loading branch information
abbeyhrt and joshblack authored Jun 17, 2022
1 parent 31bf067 commit 996aa9e
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 32 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion achecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
const path = require('path');

module.exports = {
ruleArchive: 'latest',
ruleArchive: '09June2022',
policies: ['Custom_Ruleset'],
failLevels: ['violation'],
reportLevels: [
Expand Down
7 changes: 7 additions & 0 deletions config/jest-config-carbon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

module.exports = {
moduleFileExtensions: ['js', 'json', 'node'],
moduleNameMapper: {
// This mapping is the result of updating to Jest 28. We currently require
// this as the version of uuid that gets resolved is ESM but we would like
// to work in CommonJS until Jest lands support for ESM in stable
// Reference: https://github.com/microsoft/accessibility-insights-web/pull/5421#issuecomment-1109168149
'^uuid$': require.resolve('uuid'),
},
modulePathIgnorePatterns: ['/build/', '/es/', '/lib/', '/umd/', '/examples/'],
reporters: ['default'],
setupFiles: [require.resolve('./setup/setup.js')],
Expand Down
2 changes: 1 addition & 1 deletion config/jest-config-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@babel/preset-react": "^7.17.12",
"@babel/runtime": "^7.18.3",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.5",
"accessibility-checker": "^3.1.18",
"accessibility-checker": "^3.1.32",
"axe-core": "^4.3.5",
"babel-jest": "^28.1.0",
"chalk": "^4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"accessibility-checker": "^3.1.29-rc.0",
"accessibility-checker": "^3.1.32",
"all-contributors-cli": "^6.19.0",
"cross-env": "^7.0.0",
"cross-spawn": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/FileUploader/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class FileUploader extends React.Component {
: PropTypes.string,

/**
* Specify the description text of this <FileUploader>
* Specify the description text of this `<FileUploader>`
*/
labelDescription: PropTypes.string,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ FileUploaderButton.propTypes = {
disabled: PropTypes.bool,

/**
* Provide a unique id for the underlying <input> node
* Provide a unique id for the underlying `<input>` node
*/
id: PropTypes.string,

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/FileUploader/Filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Filename.propTypes = {
status: PropTypes.oneOf(['edit', 'complete', 'uploading']),

/**
* Provide a custom tabIndex value for the <Filename>
* Provide a custom tabIndex value for the `<Filename>`
*/
tabIndex: PropTypes.string,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ _FileUploader.args = {
filenameStatus: 'edit',
accept: ['.jpg', '.png'],
name: '',
role: 'button',
multiple: true,
disabled: false,
iconDescription: 'Clear file',
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/Form/next/Form.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const Default = () => (
id="file-1"
labelDescription="Choose Files..."
iconDescription="Dismiss file"
role="button"
/>
</FormGroup>

Expand Down
47 changes: 21 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8443,34 +8443,19 @@ __metadata:
languageName: node
linkType: hard

"accessibility-checker@npm:^3.1.18":
version: 3.1.28
resolution: "accessibility-checker@npm:3.1.28"
"accessibility-checker@npm:^3.1.32":
version: 3.1.32
resolution: "accessibility-checker@npm:3.1.32"
dependencies:
axios: ^0.27.2
chromedriver: "*"
deep-diff: ^1.0.2
js-yaml: ^4.1.0
puppeteer: ^13.0.0
request: ^2.88.2
bin:
achecker: bin/achecker.js
checksum: 913dc0d787ca83e4c6eacc48cf7d8334abdcd88e0523a2fcdb99b4f953c4fe141548f8c0759a198ec9ed3c46753a2671b0988ddf5d4424b4c7c9479c1e37b264
languageName: node
linkType: hard

"accessibility-checker@npm:^3.1.29-rc.0":
version: 3.1.29-rc.0
resolution: "accessibility-checker@npm:3.1.29-rc.0"
dependencies:
chromedriver: "*"
deep-diff: ^1.0.2
js-yaml: ^4.1.0
puppeteer: ^13.0.0
request: ^2.88.2
uuid: ^8.3.2
bin:
achecker: bin/achecker.js
checksum: 1c85d991100deec9fc32d72aeeb5b2f42b2e1c4b744174e48646a89c1ddd17b5ef7cee69ac3f47817e3277147b180ec66b03e4855a6c453ff45e105f543b8f4d
checksum: 6e3590648800ba35eb2a15d02ab73bde34ce526cace841db5b07b562bfb490b085f08f7b68b215076ae5fa9a2c4e7f30123a1864975ee76532bb85f99ae3296c
languageName: node
linkType: hard

Expand Down Expand Up @@ -9380,6 +9365,16 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^0.27.2":
version: 0.27.2
resolution: "axios@npm:0.27.2"
dependencies:
follow-redirects: ^1.14.9
form-data: ^4.0.0
checksum: 38cb7540465fe8c4102850c4368053c21683af85c5fdf0ea619f9628abbcb59415d1e22ebc8a6390d2bbc9b58a9806c874f139767389c862ec9b772235f06854
languageName: node
linkType: hard

"axobject-query@npm:^2.2.0":
version: 2.2.0
resolution: "axobject-query@npm:2.2.0"
Expand Down Expand Up @@ -10633,7 +10628,7 @@ __metadata:
"@testing-library/jest-dom": ^5.16.1
"@testing-library/react": ^12.1.2
"@testing-library/user-event": ^13.5.0
accessibility-checker: ^3.1.29-rc.0
accessibility-checker: ^3.1.32
all-contributors-cli: ^6.19.0
cross-env: ^7.0.0
cross-spawn: ^7.0.0
Expand Down Expand Up @@ -15761,13 +15756,13 @@ __metadata:
languageName: node
linkType: hard

"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.10.0":
version: 1.14.9
resolution: "follow-redirects@npm:1.14.9"
"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.10.0, follow-redirects@npm:^1.14.9":
version: 1.15.1
resolution: "follow-redirects@npm:1.15.1"
peerDependenciesMeta:
debug:
optional: true
checksum: f5982e0eb481818642492d3ca35a86989c98af1128b8e1a62911a3410621bc15d2b079e8170b35b19d3bdee770b73ed431a257ed86195af773771145baa57845
checksum: 6aa4e3e3cdfa3b9314801a1cd192ba756a53479d9d8cca65bf4db3a3e8834e62139245cd2f9566147c8dfe2efff1700d3e6aefd103de4004a7b99985e71dd533
languageName: node
linkType: hard

Expand Down Expand Up @@ -18961,7 +18956,7 @@ fsevents@^1.2.7:
"@babel/preset-react": ^7.17.12
"@babel/runtime": ^7.18.3
"@wojtekmaj/enzyme-adapter-react-17": ^0.6.5
accessibility-checker: ^3.1.18
accessibility-checker: ^3.1.32
axe-core: ^4.3.5
babel-jest: ^28.1.0
chalk: ^4.1.1
Expand Down

0 comments on commit 996aa9e

Please sign in to comment.