Files
tiptap/docs/src/demos/Extensions/Code/index.spec.js
Philipp Kühn 7350f52392 fix crapcode
2020-09-11 18:35:25 +02:00

25 lines
787 B
JavaScript

context('/api/extensions/code', () => {
before(() => {
cy.visit('/api/extensions/code')
})
beforeEach(() => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.setContent('<p>Example Text</p>')
editor.focus()
editor.selectAll()
})
})
it('should mark the selected text as inline code', () => {
cy.get('.demo__preview button:first').click({ force: true })
cy.get('.ProseMirror').contains('code', 'Example Text')
})
it('should toggle the selected text as inline code', () => {
cy.get('.demo__preview button:first').click({ force: true })
cy.get('.ProseMirror').type('{selectall}', { force: true })
cy.get('.demo__preview button:first').click({ force: true })
cy.get('.ProseMirror code').should('not.exist')
})
})