diff --git a/.eslintrc b/.eslintrc index dc830b3..bceeb82 100644 --- a/.eslintrc +++ b/.eslintrc @@ -25,6 +25,20 @@ "globals": { "strapi": true }, + "overrides": [ + { + "files": [ + "**/*.cy.*", + "./cypress/**/*.*" + ], + "extends": [ + "plugin:cypress/recommended" + ], + "parserOptions": { + "project": "./tsconfig.cypress.json" + } + } + ], "rules": { "import/no-unresolved": [2, { "ignore": [ diff --git a/admin/src/index.cy.jsx b/admin/src/index.cy.jsx index a78a193..e157500 100644 --- a/admin/src/index.cy.jsx +++ b/admin/src/index.cy.jsx @@ -1,5 +1,4 @@ -/// -// +// describe('Config Sync', () => { beforeEach(() => { diff --git a/cypress.config.js b/cypress.config.js index 2a4fef2..701bbf7 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -10,6 +10,7 @@ module.exports = defineConfig({ requestTimeout: 10000, setupNodeEvents(on, config) { // implement node event listeners here. + // eslint-disable-next-line global-require require('cypress-terminal-report/src/installLogsPrinter')(on); on('task', { @@ -21,7 +22,7 @@ module.exports = defineConfig({ console.log(`folder ${folderName} deleted`); return null; }) - .catch(err => { + .catch((err) => { console.error(`error deleting folder ${folderName}`, err); throw err; }); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 0751064..627c81f 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -1,4 +1,4 @@ -/// +// // *********************************************** // This example commands.ts shows you how to // create various custom commands and overwrite @@ -43,6 +43,7 @@ Cypress.Commands.add('login', (path) => { cy.wait('@adminInit').its('response.statusCode').should('equal', 200); // Wait for the form to render. + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); cy.get('body').then(($body) => { @@ -120,7 +121,8 @@ Cypress.Commands.add('makeConfigChanges', (path) => { }).as('saveUpEmailTemplates'); cy.get('a[href="/admin/settings/users-permissions/email-templates"]').click(); cy.get('tbody tr').contains('Reset password').click(); - cy.get('input[name="options.response_email"]').clear().type(`${Math.random().toString(36).substring(2, 15)}@example.com`); + cy.get('input[name="options.response_email"]').clear(); + cy.get('input[name="options.response_email"]').type(`${Math.random().toString(36).substring(2, 15)}@example.com`); cy.get('button[type="submit"]').click(); cy.wait('@saveUpEmailTemplates').its('response.statusCode').should('equal', 200); });