#3475874: Enforce ESLint and Prettier on Cypress tests
Closes #3475874
- Added
eslint-plugin-cypressandeslint-plugin-chai-friendlyto the eslint config underoverridesso it is only
applied to the UI test directory. The chai plugin is used to allow the use of 'expect' in the UI tests without
triggering an eslint error. I added a comment in the config that explains this. - Renamed the npm command from
formattoprettier:fixand I also added aprettier:checkcommand. - Added mention of
eslint-plugin-cypressto the testing section of the README.
Test files that contains manual changes unrelated to prettier fixes:
-
prop-types.cy.js(changed to adhere to unsafe-to-chain-command) -
undo-redo.cy.js(unsafe-to-chain-command) -
xb-canvas.cy.js(unsafe-to-chain-command) -
commands.js(no-restricted-globals) -
e2e.js(no-extend-native does not like extending the native String object so I replaced it with a utils functiononlyVisibleCharsin newly created utils.js) -
add-section.cy.js(updated to use newonlyVisibleCharsfunction) -
xb-general.cy.js(updated to use newonlyVisibleCharsfunction, unsafe-to-chain-command fixes and updated a selector that looked like a copy and paste error from a previous MR- left a comment) -
configuration-slice.cy.js(changed to use file path alias for import statements) -
layout-slice.cy.js(changed to use file path alias for import statements) -
layout-utils.cy.js(changed to use file path alias for import statements) -
ui-slice.cy.js(changed to use file path alias for import statements)
Edited by Harumi Jang