From 0a897500365776c30d2a45e4dc9e1e0ea086f264 Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Fri, 28 Mar 2025 19:23:41 +0100 Subject: [PATCH] start tests on components --- cypress/e2e/ui/seComponents.cy.js | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 cypress/e2e/ui/seComponents.cy.js diff --git a/cypress/e2e/ui/seComponents.cy.js b/cypress/e2e/ui/seComponents.cy.js new file mode 100644 index 00000000..aec946d2 --- /dev/null +++ b/cypress/e2e/ui/seComponents.cy.js @@ -0,0 +1,44 @@ +describe('Editor Web Components', () => { + context('seButton', () => { + it('renders and reacts to click', () => { + const onClick = cy.stub().as('seButtonClick') + + cy.document().then(doc => { + const el = doc.createElement('se-button') + el.addEventListener('click', onClick) + doc.body.appendChild(el) + }) + + cy.get('se-button').should('exist').click({ force: true }) + cy.get('@seButtonClick').should('have.been.called') + }) + }) + + context('seFlyingButton', () => { + it('renders and reacts to click', () => { + const onClick = cy.stub().as('seFlyingClick') + cy.document().then(doc => { + const el = doc.createElement('se-flying-button') + el.addEventListener('click', onClick) + doc.body.appendChild(el) + }) + + cy.get('se-flying-button').should('exist').click({ force: true }) + cy.get('@seFlyingClick').should('have.been.called') + }) + }) + + context('seExplorerButton', () => { + it('renders and reacts to click', () => { + const onClick = cy.stub().as('seExplorerClick') + cy.document().then(doc => { + const el = doc.createElement('se-explorer-button') + el.addEventListener('click', onClick) + doc.body.appendChild(el) + }) + + cy.get('se-explorer-button').should('exist').click({ force: true }) + cy.get('@seExplorerClick').should('have.been.called') + }) + }) +})