From 09e8070edd6378c356de5ded6082e56825be36d4 Mon Sep 17 00:00:00 2001 From: mimidotuser Date: Tue, 14 Sep 2021 17:54:24 +0300 Subject: [PATCH] feat: add tests for embed button option --- cypress/integration/advance-options.spec.js | 18 ++++++++++++++++++ test/advance-options.html | 11 +++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/cypress/integration/advance-options.spec.js b/cypress/integration/advance-options.spec.js index 1ecc05cd..2bea0636 100644 --- a/cypress/integration/advance-options.spec.js +++ b/cypress/integration/advance-options.spec.js @@ -22,4 +22,22 @@ describe('single', () => { expect(iframe.contents().find('.h5p-download-button')).to.exist; }); }); + + it('should display embed code dialog', () => { + + cy.visit('test/advance-options.html'); + cy.get('.h5p-iframe').should((iframe) => { + + expect(iframe.contents().find('.h5p-actions').find('.h5p-embed')).to.exist; + + iframe.contents() + .find('.h5p-actions') + .find('.h5p-embed') + .click(); + + expect(iframe.contents().find('.h5p-embed-code-container')).to.exist; + expect(iframe.contents().find('.h5p-embed-size')).to.exist; + }) + + }); }); \ No newline at end of file diff --git a/test/advance-options.html b/test/advance-options.html index d120a9be..8e7d2a51 100644 --- a/test/advance-options.html +++ b/test/advance-options.html @@ -10,18 +10,17 @@