diff --git a/demos/src/GuideContent/ExportHTML/Vue/index.html b/demos/src/GuideContent/ExportHTML/Vue/index.html new file mode 100644 index 00000000..7444f4cc --- /dev/null +++ b/demos/src/GuideContent/ExportHTML/Vue/index.html @@ -0,0 +1,15 @@ + + +
+ + + + + + + + diff --git a/demos/src/GuideContent/ExportHTML/Vue/index.spec.js b/demos/src/GuideContent/ExportHTML/Vue/index.spec.js new file mode 100644 index 00000000..755542f6 --- /dev/null +++ b/demos/src/GuideContent/ExportHTML/Vue/index.spec.js @@ -0,0 +1,19 @@ +context('/demos/Guide/Content/ExportHTML', () => { + before(() => { + cy.visit('/demos/Guide/Content/ExportHTML') + }) + + beforeEach(() => { + cy.get('.ProseMirror').then(([{ editor }]) => { + editor.commands.setContent('Example Text
') + }) + }) + + it('should return html', () => { + cy.get('.ProseMirror').then(([{ editor }]) => { + const html = editor.getHTML() + + expect(html).to.equal('Example Text
') + }) + }) +}) diff --git a/demos/src/GuideContent/ExportHTML/Vue/index.vue b/demos/src/GuideContent/ExportHTML/Vue/index.vue new file mode 100644 index 00000000..fe761dda --- /dev/null +++ b/demos/src/GuideContent/ExportHTML/Vue/index.vue @@ -0,0 +1,170 @@ + +{{ html }}
+ Example Text
') + }) + }) + + it('should return json', () => { + cy.get('.ProseMirror').then(([{ editor }]) => { + const json = editor.getJSON() + + expect(json).to.deep.equal({ + type: 'doc', + content: [ + { + type: 'paragraph', + content: [ + { + type: 'text', + text: 'Example Text', + }, + ], + }, + ], + }) + }) + }) +}) diff --git a/demos/src/GuideContent/ExportJSON/Vue/index.vue b/demos/src/GuideContent/ExportJSON/Vue/index.vue new file mode 100644 index 00000000..67736f61 --- /dev/null +++ b/demos/src/GuideContent/ExportJSON/Vue/index.vue @@ -0,0 +1,177 @@ + +
+ {{ output }}
+
+
+
diff --git a/demos/src/GuideContent/GenerateJSON/Vue/index.html b/demos/src/GuideContent/GenerateJSON/Vue/index.html
new file mode 100644
index 00000000..c1ff9f6d
--- /dev/null
+++ b/demos/src/GuideContent/GenerateJSON/Vue/index.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demos/src/GuideContent/GenerateJSON/Vue/index.spec.js b/demos/src/GuideContent/GenerateJSON/Vue/index.spec.js
new file mode 100644
index 00000000..78d6813c
--- /dev/null
+++ b/demos/src/GuideContent/GenerateJSON/Vue/index.spec.js
@@ -0,0 +1,7 @@
+context('/demos/Guide/Content/GenerateJSON', () => {
+ before(() => {
+ cy.visit('/demos/Guide/Content/GenerateJSON')
+ })
+
+ // TODO: Write tests
+})
diff --git a/demos/src/GuideContent/GenerateJSON/Vue/index.vue b/demos/src/GuideContent/GenerateJSON/Vue/index.vue
new file mode 100644
index 00000000..aff6599d
--- /dev/null
+++ b/demos/src/GuideContent/GenerateJSON/Vue/index.vue
@@ -0,0 +1,30 @@
+
+ {{ output }}
+
+
+
diff --git a/demos/src/GuideContent/ReadOnly/Vue/index.html b/demos/src/GuideContent/ReadOnly/Vue/index.html
new file mode 100644
index 00000000..8e5822e5
--- /dev/null
+++ b/demos/src/GuideContent/ReadOnly/Vue/index.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demos/src/GuideContent/ReadOnly/Vue/index.spec.js b/demos/src/GuideContent/ReadOnly/Vue/index.spec.js
new file mode 100644
index 00000000..60522041
--- /dev/null
+++ b/demos/src/GuideContent/ReadOnly/Vue/index.spec.js
@@ -0,0 +1,29 @@
+context('/demos/Guide/Content/ReadOnly', () => {
+ before(() => {
+ cy.visit('/demos/Guide/Content/ReadOnly')
+ })
+
+ beforeEach(() => {
+ cy.get('.ProseMirror').then(([{ editor }]) => {
+ editor.commands.clearContent()
+ })
+ })
+
+ it('should be read-only', () => {
+ cy.get('.ProseMirror').then(([{ editor }]) => {
+ editor.setEditable(false)
+ cy.get('.ProseMirror').type('Edited: ')
+
+ cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ')
+ })
+ })
+
+ it('should be editable', () => {
+ cy.get('.ProseMirror').then(([{ editor }]) => {
+ editor.setEditable(true)
+ cy.get('.ProseMirror').type('Edited: ')
+
+ cy.get('.ProseMirror p:first').should('contain', 'Edited: ')
+ })
+ })
+})
diff --git a/demos/src/GuideContent/ReadOnly/Vue/index.vue b/demos/src/GuideContent/ReadOnly/Vue/index.vue
new file mode 100644
index 00000000..c951b600
--- /dev/null
+++ b/demos/src/GuideContent/ReadOnly/Vue/index.vue
@@ -0,0 +1,76 @@
+
+