test(editor): Add more workflow actions tests (#4799)

*  Making workflow actions tests skip setup, changing suite number
* 🔥 Removing unnecessary imports and vars
*  Adding workflow tags and copy/paste tests
*  Added tests for copying and pasting nodes
* Update cypress/support/commands.ts
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
* 👌 Moving paste data to fixtures
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
Milorad FIlipović
2022-12-05 14:31:14 +01:00
committed by GitHub
parent 1b7952a516
commit e07e32f14d
8 changed files with 169 additions and 79 deletions

View File

@@ -128,3 +128,15 @@ Cypress.Commands.add('resetAll', () => {
Cypress.Commands.add('setupOwner', (payload) => {
cy.task('setup-owner', payload);
});
Cypress.Commands.add('paste', { prevSubject: true }, (selector, pastePayload) => {
// https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event
cy.wrap(selector).then($destination => {
const pasteEvent = Object.assign(new Event('paste', { bubbles: true, cancelable: true }), {
clipboardData: {
getData: () => pastePayload
}
});
$destination[0].dispatchEvent(pasteEvent);
});
});