diff --git a/cypress/e2e/Incidents/incidents.spec.js b/cypress/e2e/Incidents/incidents.spec.js index ef7733e4..39029b30 100644 --- a/cypress/e2e/Incidents/incidents.spec.js +++ b/cypress/e2e/Incidents/incidents.spec.js @@ -310,9 +310,7 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => { removeColumns.map((column) => column[1]), ); - const addColumns = [ - ['Num Alerts', 'num_alerts'], - ]; + const addColumns = [['Num Alerts', 'num_alerts']]; manageIncidentTableColumns( 'add', addColumns.map((column) => column[1]), @@ -324,7 +322,9 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => { .should('be.visible') .should('contain', '1'); - cy.get(`[data-incident-header="Num Alerts"][data-incident-row-cell-idx="${incidentIdx}"]`).within(() => { + cy.get( + `[data-incident-header="Num Alerts"][data-incident-row-cell-idx="${incidentIdx}"]`, + ).within(() => { cy.get('[aria-haspopup="dialog"]').realHover(); }); @@ -340,7 +340,9 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => { it('Split/move alert from one incident to a new incident', () => { const incidentIdx = 0; - cy.get(`[data-incident-header="Num Alerts"][data-incident-row-cell-idx="${incidentIdx}"]`).within(() => { + cy.get( + `[data-incident-header="Num Alerts"][data-incident-row-cell-idx="${incidentIdx}"]`, + ).within(() => { cy.get('[aria-haspopup="dialog"]').click(); }); @@ -348,7 +350,9 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => { cy.get('#alerts-modal-move-btn').click(); cy.get('#alerts-modal-move-select').type('Move all selected alerts to one new incident{enter}'); - cy.get('#alerts-modal-move-summary-input').clear().type('New incident created from split alert'); + cy.get('#alerts-modal-move-summary-input') + .clear() + .type('New incident created from split alert'); cy.get('#alerts-modal-complete-move-btn').click(); checkActionAlertsModalContent('Alerts moved'); @@ -368,7 +372,9 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => { waitForIncidentTable(); const incidentIdx = 0; - cy.get(`[data-incident-header="Num Alerts"][data-incident-row-cell-idx="${incidentIdx}"]`).within(() => { + cy.get( + `[data-incident-header="Num Alerts"][data-incident-row-cell-idx="${incidentIdx}"]`, + ).within(() => { cy.get('[aria-haspopup="dialog"]').should('be.visible').should('have.text', '2').click(); }); @@ -376,7 +382,9 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => { selectAlert(1); cy.get('#alerts-modal-move-btn').click(); - cy.get('#alerts-modal-move-select').type('Move each selected alert to its own new incident{enter}'); + cy.get('#alerts-modal-move-select').type( + 'Move each selected alert to its own new incident{enter}', + ); cy.get('#alerts-modal-complete-move-btn').click(); checkActionAlertsModalContent('Alerts moved'); @@ -389,16 +397,20 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => { selectIncident(targetIncidentIdx); cy.get(`@selectedIncidentId_${targetIncidentIdx}`).then((incidentId) => { - cy.get(`[data-incident-header="Num Alerts"][data-incident-cell-id="${incidentId}"]`).within(() => { - cy.get('[aria-haspopup="dialog"]').should('be.visible').should('have.text', '1'); - }); + cy.get(`[data-incident-header="Num Alerts"][data-incident-cell-id="${incidentId}"]`).within( + () => { + cy.get('[aria-haspopup="dialog"]').should('be.visible').should('have.text', '1'); + }, + ); cy.get(`[data-incident-header="Title"][data-incident-cell-id="${incidentId}"]`).within(() => { cy.get('a').invoke('text').as('targetIncidentTitle'); }); }); - cy.get(`[data-incident-header="Num Alerts"][data-incident-row-cell-idx="${sourceIncidentIdx}"]`).within(() => { + cy.get( + `[data-incident-header="Num Alerts"][data-incident-row-cell-idx="${sourceIncidentIdx}"]`, + ).within(() => { cy.get('[aria-haspopup="dialog"]').should('be.visible').should('have.text', '1').click(); }); @@ -415,9 +427,11 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => { waitForIncidentTable(); cy.get(`@selectedIncidentId_${targetIncidentIdx}`).then((incidentId) => { - cy.get(`[data-incident-header="Num Alerts"][data-incident-cell-id="${incidentId}"]`).within(() => { - cy.get('[aria-haspopup="dialog"]').should('be.visible').should('have.text', '2'); - }); + cy.get(`[data-incident-header="Num Alerts"][data-incident-cell-id="${incidentId}"]`).within( + () => { + cy.get('[aria-haspopup="dialog"]').should('be.visible').should('have.text', '2'); + }, + ); }); // Tidy up by resolving the incident with two alerts diff --git a/cypress/e2e/Search/search.spec.js b/cypress/e2e/Search/search.spec.js index a52a5c4d..e3a8f180 100644 --- a/cypress/e2e/Search/search.spec.js +++ b/cypress/e2e/Search/search.spec.js @@ -70,10 +70,17 @@ describe('Search Incidents', { failFast: { enabled: false } }, () => { cy.wait(1000); cy.get('[data-incident-header="Latest Note"]').each(($el) => { // cy.wrap($el).should('have.text', 'foobar'); - cy.wrap($el).find('*').should((subElements) => { - const elementWithFoobar = subElements.toArray().find((el) => el.textContent.includes('foobar')); - assert.isNotNull(elementWithFoobar, 'Expected to find a subelement containing "foobar"'); - }); + cy.wrap($el) + .find('*') + .should((subElements) => { + const elementWithFoobar = subElements + .toArray() + .find((el) => el.textContent.includes('foobar')); + assert.isNotNull( + elementWithFoobar, + 'Expected to find a subelement containing "foobar"', + ); + }); }); }); cy.get('#global-search-input').clear(); @@ -95,10 +102,17 @@ describe('Search Incidents', { failFast: { enabled: false } }, () => { cy.get('#global-search-input').clear().type('foobaz'); cy.wait(1000); cy.get('[data-incident-header="Latest Note"]').each(($el) => { - cy.wrap($el).find('*').should((subElements) => { - const elementWithFoobar = subElements.toArray().find((el) => el.textContent.includes('foobar')); - assert.isNotNull(elementWithFoobar, 'Expected to find a subelement containing "foobar"'); - }); + cy.wrap($el) + .find('*') + .should((subElements) => { + const elementWithFoobar = subElements + .toArray() + .find((el) => el.textContent.includes('foobar')); + assert.isNotNull( + elementWithFoobar, + 'Expected to find a subelement containing "foobar"', + ); + }); }); }); cy.get('#global-search-input').clear(); diff --git a/jest.config.js b/jest.config.js index a844009b..f824c75a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,5 +14,7 @@ module.exports = { '^.+\\.(js|jsx|ts|tsx|mjs)$': 'babel-jest', '^.+\\.svg$': 'jest-transformer-svg', }, - transformIgnorePatterns: ['/node_modules/(?!(somePkg)|react-dnd|dnd-core|@react-dnd|jsonpath-plus)'], + transformIgnorePatterns: [ + '/node_modules/(?!(somePkg)|react-dnd|dnd-core|@react-dnd|jsonpath-plus)', + ], }; diff --git a/package.json b/package.json index 60fe1443..fcefae9f 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "dotenv": "^16.3.1", "eslint": "^8.43.0", "eslint-config-airbnb": "^18.2.1", - "eslint-config-prettier": "^8.8.0", + "eslint-config-prettier": "^9.0.0", "eslint-config-react-app": "^7.0.1", "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-cypress": "^2.14.0", @@ -138,9 +138,9 @@ "jest-environment-node": "^29.7.0", "jest-location-mock": "^1.0.10", "jest-transformer-svg": "^2.0.1", - "prettier": "^2.8.0", - "prettier-eslint": "^15.0.1", - "prettier-eslint-cli": "^7.1.0", + "prettier": "^3.1.0", + "prettier-eslint": "^16.1.2", + "prettier-eslint-cli": "^8.0.1", "redux-mock-store": "^1.5.4", "redux-saga-test-plan": "^4.0.6", "sass": "^1.66.1", diff --git a/src/App.jsx b/src/App.jsx index e63b45a5..92abc5d4 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -206,11 +206,14 @@ const App = () => { // Setup log entry clearing useEffect(() => { - const clearingInterval = setInterval(() => { - if (userAuthorized) { - cleanRecentLogEntriesAsync(); - } - }, 60 * 60 * 1000); + const clearingInterval = setInterval( + () => { + if (userAuthorized) { + cleanRecentLogEntriesAsync(); + } + }, + 60 * 60 * 1000, + ); return () => clearInterval(clearingInterval); }, [userAuthorized]); diff --git a/src/components/IncidentActions/subcomponents/PriorityMenu.jsx b/src/components/IncidentActions/subcomponents/PriorityMenu.jsx index 13a38d66..6712561d 100644 --- a/src/components/IncidentActions/subcomponents/PriorityMenu.jsx +++ b/src/components/IncidentActions/subcomponents/PriorityMenu.jsx @@ -40,11 +40,12 @@ const PriorityMenu = () => { dispatch(updatePriorityConnected(incidents, priorityId)); }; - const enabled = useMemo(() => ( - selectedRows.length > 0 - && Array.isArray(abilities) - && !abilities.includes('disable_edit_priority') - ), [selectedRows]); + const enabled = useMemo( + () => selectedRows.length > 0 + && Array.isArray(abilities) + && !abilities.includes('disable_edit_priority'), + [selectedRows], + ); return (