diff --git a/cypress/integration/ui/issues/issue-407.js b/cypress/integration/ui/issues/issue-407.js new file mode 100644 index 00000000..f56e9002 --- /dev/null +++ b/cypress/integration/ui/issues/issue-407.js @@ -0,0 +1,30 @@ +import { + visitAndApproveStorage +} from '../../../support/ui-test-helper.js'; + +// See https://github.com/SVG-Edit/svgedit/issues/407 +describe('Fix issue 407: can enter edit on text child', function () { + beforeEach(() => { + visitAndApproveStorage(); + }); + + it('should set rectangle selection after click', function () { + cy.get('#tool_source').click(); + cy.get('#svg_source_textarea') + .type('{selectall}') + .type(` + + Layer 1 + + + hello + + + `, {parseSpecialCharSequences: false}); + cy.get('#tool_source_save').click(); + cy.get('#svg_1').click().dblclick(); + cy.get('#a_text').should('exist'); + cy.get('#a_text').trigger('mousedown', {which: 1}).trigger('mouseup').dblclick().type('1234'); + cy.get('#a_text').should('have.text', 'he1234llo'); + }); +}); diff --git a/cypress/integration/ui/issues/issue-408.js b/cypress/integration/ui/issues/issue-408.js new file mode 100644 index 00000000..acccc70a --- /dev/null +++ b/cypress/integration/ui/issues/issue-408.js @@ -0,0 +1,29 @@ +import { + visitAndApproveStorage +} from '../../../support/ui-test-helper.js'; + +// See https://github.com/SVG-Edit/svgedit/issues/408 +describe('Fix issue 408: does not throw when showing/saving svg content', function () { + beforeEach(() => { + visitAndApproveStorage(); + }); + + it('should set rectangle selection after click', function () { + cy.get('#tool_source').click(); + cy.get('#svg_source_textarea') + .type('{selectall}') + .type(` + + Layer 1 + + + + + + `, {parseSpecialCharSequences: false}); + cy.get('#tool_source_save').click(); + cy.get('#svg_6').click().dblclick(); // change context + cy.get('#tool_source').click(); // reopen tool_source + cy.get('#tool_source_save').should('exist'); // The save button should be here if it does not throw + }); +});