Skip to content

Commit

Permalink
Merge pull request #158 from ral-facilities/DSEGOG-33-cypress-v12
Browse files Browse the repository at this point in the history
DSEGOG-33 Upgrading to Cypress v12
  • Loading branch information
louise-davies authored Nov 3, 2023
2 parents 3c47734 + 13a2f26 commit 96fd1ee
Show file tree
Hide file tree
Showing 26 changed files with 148 additions and 140 deletions.
108 changes: 59 additions & 49 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 18 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { defineConfig } = require('cypress');

module.exports = defineConfig({
chromeWebSecurity: false,
video: false,
retries: {
runMode: 3,
openMode: 0,
},
e2e: {
setupNodeEvents(on) {
// https://github.com/bahmutov/cypress-failed-log
require('cypress-failed-log/on')(on);
},
baseUrl: 'http://127.0.0.1:3000',
},
});
9 changes: 0 additions & 9 deletions cypress.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions cypress/plugins/index.js

This file was deleted.

40 changes: 19 additions & 21 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,25 @@ Cypress.Commands.add('dragAndDrop', (subject, target) => {
.first()
.then((subject) => {
const coordsDrag = subject[0].getBoundingClientRect();
cy.wrap(subject)
.trigger('mousedown', {
button: BUTTON_INDEX,
clientX: coordsDrag.x,
clientY: coordsDrag.y,
force: true,
})
.trigger('mousemove', {
button: BUTTON_INDEX,
clientX: coordsDrag.x + SLOPPY_CLICK_THRESHOLD,
clientY: coordsDrag.y,
force: true,
});
cy.get('body')
.trigger('mousemove', {
button: BUTTON_INDEX,
clientX: coordsDrop.x + SLOPPY_CLICK_THRESHOLD,
clientY: coordsDrop.y + SLOPPY_CLICK_THRESHOLD,
force: true,
})
.trigger('mouseup');
cy.wrap(subject).trigger('mousedown', {
button: BUTTON_INDEX,
clientX: coordsDrag.x,
clientY: coordsDrag.y,
force: true,
});
cy.wrap(subject).trigger('mousemove', {
button: BUTTON_INDEX,
clientX: coordsDrag.x + SLOPPY_CLICK_THRESHOLD,
clientY: coordsDrag.y,
force: true,
});
cy.get('body').trigger('mousemove', {
button: BUTTON_INDEX,
clientX: coordsDrop.x + SLOPPY_CLICK_THRESHOLD,
clientY: coordsDrop.y + SLOPPY_CLICK_THRESHOLD,
force: true,
});
cy.get('body').trigger('mouseup');
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/index.js → cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import './commands';

import './util';

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"chart.js": "4.3.0",
"chartjs-plugin-zoom": "2.0.0",
"cross-env": "7.0.3",
"cypress": "9.7.0",
"cypress": "12.17.3",
"cypress-failed-log": "2.10.0",
"eslint": "8.44.0",
"eslint-config-prettier": "8.8.0",
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function domElementGetter(): HTMLElement {
const reactLifecycles = singleSpaReact({
React,
ReactDOMClient,
rootComponent: () => document.getElementById(pluginName) ? <App /> : null,
rootComponent: () => (document.getElementById(pluginName) ? <App /> : null),
domElementGetter,
errorBoundary: (error) => {
log.error(`${pluginName} failed with error: ${error}`);
Expand Down
Loading

0 comments on commit 96fd1ee

Please sign in to comment.