fix:update editor test case

This commit is contained in:
黄云飞
2022-03-15 17:39:12 +08:00
parent 30ee6933f9
commit ffaf52fd27
2 changed files with 31 additions and 21 deletions
+9 -5
View File
@@ -6,8 +6,6 @@ describe('基础功能', () => {
cy.visit('http://localhost:3000/canvas-editor/')
cy.get('canvas').first().as('canvas').should('have.length', 1)
cy.get('@canvas').type(`{ctrl}a{backspace}`)
})
const text = 'canvas-editor'
@@ -17,14 +15,20 @@ describe('基础功能', () => {
editor.listener.saved = function (payload) {
expect(payload.data[0].value).to.eq(text)
}
editor.command.executeSelectAll()
editor.command.executeBackspace()
cy.get('@canvas').type(text)
cy.get('@canvas').type(`{ctrl}s`)
})
cy.get('@canvas').type(text)
cy.get('@canvas').type(`{ctrl}s`)
})
it('模式切换', () => {
cy.get('@canvas').click()
cy.get('.cursor').should('have.css', 'display', 'block')