You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
800 B
38 lines
800 B
import Editor, { ElementType } from '../../../src/editor'
|
|
|
|
describe('菜单-复选框', () => {
|
|
|
|
beforeEach(() => {
|
|
cy.visit('http://localhost:3000/canvas-editor/')
|
|
|
|
cy.get('canvas').first().as('canvas').should('have.length', 1)
|
|
})
|
|
|
|
const type: ElementType = <ElementType>'checkbox'
|
|
|
|
it('代码块', () => {
|
|
cy.getEditor().then((editor: Editor) => {
|
|
editor.listener.saved = function (payload) {
|
|
const data = payload.data[0]
|
|
|
|
expect(data.checkbox?.value).to.eq(true)
|
|
}
|
|
|
|
editor.command.executeSelectAll()
|
|
|
|
editor.command.executeBackspace()
|
|
|
|
editor.command.executeInsertElementList([{
|
|
type,
|
|
value: '',
|
|
checkbox: {
|
|
value: true
|
|
}
|
|
}])
|
|
|
|
cy.get('@canvas').type('{ctrl}s')
|
|
})
|
|
})
|
|
|
|
})
|