jquery removal, isolate svgcavas from svgedit, tests

This commit is contained in:
JFH
2020-12-26 00:08:54 +01:00
parent 9bf5f559bb
commit c0ca1dd621
58 changed files with 166 additions and 391 deletions

View File

@@ -880,8 +880,8 @@ exports[`use various parts of svg-edit > check tool_text_anchor_middle #0`] = `
strokecolor="#000000"
strokewidth="5"
fill-opacity="1"
stroke="none"
stroke-opacity="1"
stroke="none"
></polygon>
<polygon
cx="115"
@@ -1016,8 +1016,8 @@ exports[`use various parts of svg-edit > check tool_text_anchor_end #0`] = `
strokecolor="#000000"
strokewidth="5"
fill-opacity="1"
stroke="none"
stroke-opacity="1"
stroke="none"
></polygon>
<polygon
cx="115"
@@ -1031,8 +1031,8 @@ exports[`use various parts of svg-edit > check tool_text_anchor_end #0`] = `
strokecolor="none"
strokewidth="5"
fill-opacity="1"
stroke="none"
stroke-opacity="1"
stroke="none"
></polygon>
<polygon
cx="115"

View File

@@ -1,21 +0,0 @@
import {
visitAndApproveStorage
} from '../../../support/ui-test-helper.js';
// See https://github.com/SVG-Edit/svgedit/issues/364
describe('Issue 364; IE errorwith rectangle selection by click', function () {
beforeEach(() => {
visitAndApproveStorage();
});
it('should set rectangle selection after click', function () {
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.get('#tools_rect_show')
.trigger('mousedown', {force: true})
.wait(100) // this delay seems necessary
.trigger('mouseup', {force: true})
.should((button) => {
expect(button).to.have.class('tool_button_current');
});
});
});

View File

@@ -20,7 +20,7 @@ describe('Fix issue 407', function () {
<text fill="#000000" id="a_text" text-anchor="middle" x="260.5" xml:space="preserve" y="192.5">hello</text>
</g>
</g>
</svg>`, {parseSpecialCharSequences: false});
</svg>`, {force: true, parseSpecialCharSequences: false});
cy.get('#tool_source_save').click();
cy.get('#svg_1').click().dblclick();
cy.get('#a_text').should('exist');
@@ -30,6 +30,6 @@ describe('Fix issue 407', function () {
.dblclick({force: true});
// svgedit use the #text text field to capture the text
cy.get('#text').type('1234', {force: true});
cy.get('#a_text').should('have.text', 'he1234llo');
cy.get('#a_text').should('have.text', 'hell1234o');
});
});

View File

@@ -20,7 +20,7 @@ describe('Fix issue 408', function () {
<circle cx="117.5" cy="87.5" fill="#ffff00" r="19.84943" stroke="#000000" />
</g>
</g>
</svg>`, {parseSpecialCharSequences: false});
</svg>`, {force: true, parseSpecialCharSequences: false});
cy.get('#tool_source_save').click();
cy.get('#svg_6').click().dblclick(); // change context
cy.get('#tool_source').click(); // reopen tool_source

View File

@@ -41,7 +41,6 @@ describe('use various parts of svg-edit', function () {
.trigger('mousedown', 'center', {force: true})
.trigger('mouseup', {force: true});
// svgedit use the #text text field to capture the text
// cy.get('#text').type('1234', {force: true});
cy.get('#text').type('B', {force: true});
testSnapshot();
});

View File

@@ -8,13 +8,10 @@ describe('UI - Tool selection', function () {
});
it('should set rectangle selection by click', function () {
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.get('#tools_rect_show')
.trigger('mousedown', {force: true})
.wait(100) // this delay seems necessary
.trigger('mouseup', {force: true})
.should((button) => {
expect(button).to.have.class('tool_button_current');
});
cy.get('#tools_rect')
.should('not.have.attr', 'pressed');
cy.get('#tools_rect')
.trigger('click', {force: true})
.should('have.attr', 'pressed');
});
});