Skip to content

Commit

Permalink
fix: updated eslint rules for cypress files
Browse files Browse the repository at this point in the history
  • Loading branch information
boazpoolman committed Dec 30, 2024
1 parent 24bbf07 commit 4e4613d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
3 changes: 1 addition & 2 deletions admin/src/index.cy.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
//
// <reference types="cypress" />

describe('Config Sync', () => {
beforeEach(() => {
Expand Down
3 changes: 2 additions & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -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;
});
Expand Down
6 changes: 4 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference types="cypress" />
// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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);
});

0 comments on commit 4e4613d

Please sign in to comment.