test:update get editor value

This commit is contained in:
Hufe921
2023-03-18 12:25:20 +08:00
parent 6082ab26d1
commit 436d1de284
19 changed files with 37 additions and 95 deletions
+11 -33
View File
@@ -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')
})