test:optimize the method of get editor value
This commit is contained in:
@@ -10,21 +10,19 @@ describe('菜单-表格', () => {
|
||||
|
||||
it('表格', () => {
|
||||
cy.getEditor().then((editor: Editor) => {
|
||||
editor.listener.saved = function (payload) {
|
||||
const data = payload.data
|
||||
|
||||
expect(data[0].type).to.eq('table')
|
||||
|
||||
expect(data[0].trList?.length).to.eq(8)
|
||||
}
|
||||
|
||||
editor.command.executeSelectAll()
|
||||
|
||||
editor.command.executeBackspace()
|
||||
|
||||
editor.command.executeInsertTable(8, 8)
|
||||
|
||||
cy.get('@canvas').type('{ctrl}s')
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
|
||||
expect(data[0].type).to.eq('table')
|
||||
|
||||
expect(data[0].trList?.length).to.eq(8)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user