separate svgcanvas from svgedit
now you can use directlt svgcanvas. see readme.md * configure workspaces * move svgcanvas to packages folder * move utils to common and paint to svgcanvas * make svgcanvas a dependency of svgedit * update deps * workspaces requires npm 7 at least so the ci needs a new node version * update github actions to V3 * update snapshots using custom svg exports * remove unmaintained cypress snapshot plugin * new github action to add coverage in PR * Update onpushandpullrequest.yml * svgcanvas v7.1.6
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
visitAndApproveStorage, testSnapshot
|
||||
visitAndApproveStorage
|
||||
} from '../../support/ui-test-helper.js'
|
||||
|
||||
describe('use all parts of svg-edit', function () {
|
||||
describe('check tool shape and image of svg-edit', function () {
|
||||
before(() => {
|
||||
visitAndApproveStorage()
|
||||
})
|
||||
@@ -17,27 +17,33 @@ describe('use all parts of svg-edit', function () {
|
||||
</g>
|
||||
</svg>`, { force: true, parseSpecialCharSequences: false })
|
||||
cy.get('#tool_source_save').click({ force: true })
|
||||
testSnapshot()
|
||||
cy.svgSnapshot()
|
||||
})
|
||||
it('check tool_shape', function () {
|
||||
cy.get('#tool_shapelib').shadow().find('.overall').eq(0).click({ force: true })
|
||||
cy.get('[data-shape="heart"]').click({ force: true })
|
||||
cy.get('#svgcontent')
|
||||
.trigger('mousemove', 200, 200, { force: true })
|
||||
.trigger('mousedown', 200, 200, { force: true })
|
||||
.trigger('mousemove', 20, 20, { force: true })
|
||||
cy.get('#svgroot')
|
||||
.trigger('mousemove', { clientX: 400, clientY: 400, force: true })
|
||||
.trigger('mousedown', { clientX: 400, clientY: 400, force: true })
|
||||
.trigger('mousemove', { clientX: 20, clientY: 20, force: true })
|
||||
.trigger('mouseup', { force: true })
|
||||
cy.get('#selectorGrip_rotate')
|
||||
.trigger('mousedown')
|
||||
.trigger('mousemove', 20, 20, { force: true })
|
||||
.trigger('mousedown', { force: true })
|
||||
.trigger('mousemove', { clientX: 20, clientY: 20, force: true })
|
||||
.trigger('mouseup', { force: true })
|
||||
testSnapshot()
|
||||
// issue with snapshot not being consistent on CI/Interactive
|
||||
// cy.svgSnapshot()
|
||||
// so we use typical DOM tests to validate
|
||||
cy.get('#svg_1').should('have.attr', 'd')
|
||||
|
||||
// cy.get('#a_text').should('have.attr', 'transform')
|
||||
// .and('equal', 'matrix(1 0 0 4.54639 0 -540.825)') // Chrome 96 is matrix(1 0 0 4.17431 0 -325.367)
|
||||
})
|
||||
it('check tool_image', function () {
|
||||
cy.get('#tool_image').click({ force: true })
|
||||
cy.get('#svgcontent')
|
||||
.trigger('mousedown', 100, 100, { force: true })
|
||||
.trigger('mousemove', 120, 120, { force: true })
|
||||
cy.get('#svgroot')
|
||||
.trigger('mousedown', { clientX: 100, clientY: 100, force: true })
|
||||
.trigger('mousemove', { clientX: 120, clientY: 120, force: true })
|
||||
.trigger('mouseup', { force: true })
|
||||
// eslint-disable-next-line promise/catch-or-return
|
||||
cy.window()
|
||||
@@ -46,6 +52,9 @@ describe('use all parts of svg-edit', function () {
|
||||
cy.stub($win, 'prompt').returns('./images/logo.svg')
|
||||
cy.contains('OK')
|
||||
})
|
||||
testSnapshot()
|
||||
// issue with snapshot not being consistent on CI/Interactive
|
||||
// cy.svgSnapshot()
|
||||
// so we use typical DOM tests to validate
|
||||
cy.get('#svg_2').should('have.attr', 'xlink:href').and('equal', './images/logo.svg')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user