test:optimize the method of get editor value
This commit is contained in:
@@ -10,18 +10,17 @@ describe('菜单-图片', () => {
|
||||
|
||||
it('图片', () => {
|
||||
cy.getEditor().then((editor: Editor) => {
|
||||
editor.listener.saved = function (payload) {
|
||||
const data = payload.data
|
||||
expect(data[0].type).to.eq('image')
|
||||
}
|
||||
|
||||
editor.command.executeSelectAll()
|
||||
|
||||
editor.command.executeBackspace()
|
||||
|
||||
cy.get('#image').attachFile('test.png')
|
||||
|
||||
cy.get('@canvas').type('{ctrl}s')
|
||||
cy.wait(200).then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
const data = payload.data
|
||||
expect(data[0].type).to.eq('image')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user