diff --git a/docs/src/demos/Extensions/Bold/index.spec.js b/docs/src/demos/Extensions/Bold/index.spec.js new file mode 100644 index 00000000..bb910cc4 --- /dev/null +++ b/docs/src/demos/Extensions/Bold/index.spec.js @@ -0,0 +1,26 @@ +context('/api/extensions/bold', () => { + beforeEach(() => { + cy.visit('/api/extensions/bold') + + cy.get('.ProseMirror').window().then(window => { + const { editor } = window + editor.setContent('
Example Text
') + editor.focus().selectAll() + }) + }) + + describe('bold', () => { + it('should make the selected text bold', () => { + cy.get('.demo__preview button:first').click({ force: true }) + cy.get('.ProseMirror').contains('strong', 'Example Text') + + cy.get('.demo__preview button:first').click({ force: true }) + cy.get('.ProseMirror strong').should('not.exist') + }) + + it('should toggle the selected text bold', () => { + cy.get('.demo__preview button:first').dblclick({ force: true }) + cy.get('.ProseMirror strong').should('not.exist') + }) + }) +}) \ No newline at end of file diff --git a/docs/src/demos/Extensions/Bold/index.vue b/docs/src/demos/Extensions/Bold/index.vue index 22510d30..7416151b 100644 --- a/docs/src/demos/Extensions/Bold/index.vue +++ b/docs/src/demos/Extensions/Bold/index.vue @@ -45,6 +45,8 @@ export default {Up to font weight 999!!!
`, }) + + window.editor = this.editor }, beforeDestroy() {