test:update get editor value
This commit is contained in:
@@ -28,9 +28,7 @@ describe('菜单-内容块', () => {
|
||||
.eq(1)
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].type).to.eq('block')
|
||||
|
||||
|
||||
@@ -24,9 +24,7 @@ describe('菜单-复选框', () => {
|
||||
}
|
||||
}])
|
||||
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data[0]
|
||||
const data = editor.command.getValue().data.main[0]
|
||||
|
||||
expect(data.checkbox?.value).to.eq(true)
|
||||
})
|
||||
|
||||
@@ -24,9 +24,7 @@ describe('菜单-代码块', () => {
|
||||
.eq(1)
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data[2]
|
||||
const data = editor.command.getValue().data.main[2]
|
||||
|
||||
expect(data.value).to.eq('log')
|
||||
|
||||
|
||||
@@ -20,9 +20,7 @@ describe('菜单-日期选择器', () => {
|
||||
.first()
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].type).to.eq('date')
|
||||
})
|
||||
|
||||
@@ -28,9 +28,7 @@ describe('菜单-清除格式', () => {
|
||||
cy.get('.menu-item__format')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].italic).to.eq(false)
|
||||
|
||||
|
||||
@@ -27,9 +27,7 @@ describe('菜单-超链接', () => {
|
||||
.eq(1)
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].type).to.eq('hyperlink')
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ describe('菜单-图片', () => {
|
||||
cy.get('#image').attachFile('test.png')
|
||||
|
||||
cy.wait(200).then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].type).to.eq('image')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -24,9 +24,7 @@ describe('菜单-LaTeX', () => {
|
||||
.eq(1)
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].type).to.eq('latex')
|
||||
|
||||
|
||||
@@ -36,9 +36,7 @@ describe('菜单-格式刷', () => {
|
||||
|
||||
editor.command.executeApplyPainterStyle()
|
||||
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data.length).to.eq(1)
|
||||
|
||||
|
||||
@@ -23,9 +23,7 @@ describe('菜单-行处理', () => {
|
||||
cy.get('.menu-item__left')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].rowFlex).to.eq('left')
|
||||
})
|
||||
@@ -45,9 +43,7 @@ describe('菜单-行处理', () => {
|
||||
cy.get('.menu-item__center')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].rowFlex).to.eq('center')
|
||||
})
|
||||
@@ -67,9 +63,7 @@ describe('菜单-行处理', () => {
|
||||
cy.get('.menu-item__right')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].rowFlex).to.eq('right')
|
||||
})
|
||||
@@ -93,9 +87,7 @@ describe('菜单-行处理', () => {
|
||||
.eq(1)
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].rowMargin).to.eq(1.25)
|
||||
})
|
||||
|
||||
@@ -93,9 +93,7 @@ describe('菜单-搜索', () => {
|
||||
.find('button')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
// 普通文本
|
||||
expect(data[0].value).to.be.eq(replaceText)
|
||||
|
||||
@@ -20,9 +20,7 @@ describe('菜单-分割线', () => {
|
||||
.eq(1)
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].type).to.eq('separator')
|
||||
|
||||
|
||||
@@ -16,9 +16,7 @@ describe('菜单-表格', () => {
|
||||
|
||||
editor.command.executeInsertTable(8, 8)
|
||||
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].type).to.eq('table')
|
||||
|
||||
|
||||
@@ -30,9 +30,7 @@ describe('菜单-文本处理', () => {
|
||||
.eq(1)
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].font).to.eq('宋体')
|
||||
})
|
||||
@@ -54,9 +52,7 @@ describe('菜单-文本处理', () => {
|
||||
cy.get('.menu-item__size-add')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].size).to.eq(18)
|
||||
})
|
||||
@@ -78,9 +74,7 @@ describe('菜单-文本处理', () => {
|
||||
cy.get('.menu-item__size-minus')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].size).to.eq(14)
|
||||
})
|
||||
@@ -102,9 +96,7 @@ describe('菜单-文本处理', () => {
|
||||
cy.get('.menu-item__bold')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].bold).to.eq(true)
|
||||
})
|
||||
@@ -126,9 +118,7 @@ describe('菜单-文本处理', () => {
|
||||
cy.get('.menu-item__italic')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].italic).to.eq(true)
|
||||
})
|
||||
@@ -150,9 +140,7 @@ describe('菜单-文本处理', () => {
|
||||
cy.get('.menu-item__underline')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].underline).to.eq(true)
|
||||
})
|
||||
@@ -174,9 +162,7 @@ describe('菜单-文本处理', () => {
|
||||
cy.get('.menu-item__strikeout')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].strikeout).to.eq(true)
|
||||
})
|
||||
@@ -198,9 +184,7 @@ describe('菜单-文本处理', () => {
|
||||
cy.get('.menu-item__superscript')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].type).to.eq('superscript')
|
||||
})
|
||||
@@ -220,9 +204,7 @@ describe('菜单-文本处理', () => {
|
||||
editor.command.executeSetRange(0, textLength)
|
||||
|
||||
cy.get('.menu-item__subscript').click().then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].type).to.eq('subscript')
|
||||
})
|
||||
@@ -243,9 +225,7 @@ describe('菜单-文本处理', () => {
|
||||
|
||||
editor.command.executeColor('red')
|
||||
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].color).to.eq('red')
|
||||
})
|
||||
@@ -265,9 +245,7 @@ describe('菜单-文本处理', () => {
|
||||
|
||||
editor.command.executeHighlight('red')
|
||||
|
||||
const payload = editor.command.getValue()
|
||||
|
||||
const data = payload.data
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(data[0].highlight).to.eq('red')
|
||||
})
|
||||
|
||||
@@ -21,9 +21,9 @@ describe('菜单-撤销&重做', () => {
|
||||
cy.get('.menu-item__undo')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(payload.data[0].value).to.eq(text)
|
||||
expect(data[0].value).to.eq(text)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -41,9 +41,9 @@ describe('菜单-撤销&重做', () => {
|
||||
cy.get('.menu-item__redo')
|
||||
.click()
|
||||
.then(() => {
|
||||
const payload = editor.command.getValue()
|
||||
const data = editor.command.getValue().data.main
|
||||
|
||||
expect(payload.data[0].value).to.eq(`${text}1`)
|
||||
expect(data[0].value).to.eq(`${text}1`)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user