test:optimize the method of get editor value

This commit is contained in:
Hufe921
2023-02-21 21:07:52 +08:00
parent 63487d4f90
commit 708d57812e
20 changed files with 288 additions and 302 deletions
+7 -9
View File
@@ -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)
})
})