lint: Set up Cypress config and fix issues

This commit is contained in:
Richard Hansen 2021-03-01 15:06:47 -05:00 committed by John McLear
parent a79f9efdb4
commit 8971166c58
3 changed files with 32 additions and 6 deletions

23
src/package-lock.json generated
View file

@ -1808,11 +1808,28 @@
} }
}, },
"eslint-config-etherpad": { "eslint-config-etherpad": {
"version": "1.0.25", "version": "1.0.26",
"resolved": "https://registry.npmjs.org/eslint-config-etherpad/-/eslint-config-etherpad-1.0.25.tgz", "resolved": "https://registry.npmjs.org/eslint-config-etherpad/-/eslint-config-etherpad-1.0.26.tgz",
"integrity": "sha512-KYTGf08dlwvsg05Y2hm0zurCwVMyZrsxGRnPEhL2wclk26xhnPYfNfruQQqk7nghfWFLrAL+VscnkZLCQEPBXQ==", "integrity": "sha512-xPnDnJIpQuYJNRYGIHIucct0U6CtciyZKItpet+NqoGJgxUMkwAXgD5bzuXQvd9u4I2aj/kRU1BIL2DbAGe+pA==",
"dev": true "dev": true
}, },
"eslint-plugin-cypress": {
"version": "2.11.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.2.tgz",
"integrity": "sha512-1SergF1sGbVhsf7MYfOLiBhdOg6wqyeV9pXUAIDIffYTGMN3dTBQS9nFAzhLsHhO+Bn0GaVM1Ecm71XUidQ7VA==",
"dev": true,
"requires": {
"globals": "^11.12.0"
},
"dependencies": {
"globals": {
"version": "11.12.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
"dev": true
}
}
},
"eslint-plugin-es": { "eslint-plugin-es": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz",

View file

@ -79,7 +79,8 @@
}, },
"devDependencies": { "devDependencies": {
"eslint": "^7.20.0", "eslint": "^7.20.0",
"eslint-config-etherpad": "^1.0.25", "eslint-config-etherpad": "^1.0.26",
"eslint-plugin-cypress": "^2.11.2",
"eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-mocha": "^8.0.0", "eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
@ -155,9 +156,10 @@
], ],
"excludedFiles": [ "excludedFiles": [
"**/.eslintrc.js", "**/.eslintrc.js",
"tests/frontend/travis/**/*", "tests/frontend/cypress/**/*",
"tests/frontend/helper.js", "tests/frontend/helper.js",
"tests/frontend/helper/**/*", "tests/frontend/helper/**/*",
"tests/frontend/travis/**/*",
"tests/ratelimit/**/*" "tests/ratelimit/**/*"
], ],
"extends": "etherpad/tests", "extends": "etherpad/tests",
@ -195,6 +197,7 @@
], ],
"excludedFiles": [ "excludedFiles": [
"**/.eslintrc.js", "**/.eslintrc.js",
"tests/frontend/cypress/**/*",
"tests/frontend/helper.js", "tests/frontend/helper.js",
"tests/frontend/helper/**/*", "tests/frontend/helper/**/*",
"tests/frontend/travis/**/*" "tests/frontend/travis/**/*"
@ -215,6 +218,12 @@
} }
] ]
}, },
{
"files": [
"tests/frontend/cypress/**/*"
],
"extends": "etherpad/tests/cypress"
},
{ {
"files": [ "files": [
"tests/frontend/travis/**/*" "tests/frontend/travis/**/*"

View file

@ -8,7 +8,7 @@ Cypress.Commands.add('iframe', {prevSubject: 'element'},
})); }));
describe(__filename, () => { describe(__filename, () => {
it('Pad content exists', async () => { it('Pad content exists', () => {
cy.visit('http://127.0.0.1:9001/p/test'); cy.visit('http://127.0.0.1:9001/p/test');
cy.get('iframe[name="ace_outer"]', {timeout: 10000}).iframe() cy.get('iframe[name="ace_outer"]', {timeout: 10000}).iframe()
.find('.line-number:first') .find('.line-number:first')