mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-08-06 13:38:49 +08:00
move test to example
This commit is contained in:
parent
49d3b25c66
commit
fcbc925d9a
@ -1,6 +1,6 @@
|
||||
context('basic', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/tests/basic')
|
||||
cy.visit('/basic')
|
||||
})
|
||||
|
||||
describe('export', () => {
|
||||
@ -12,7 +12,7 @@ context('basic', () => {
|
||||
expect(html).to.equal('<p>foo</p>')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
it('should return json', () => {
|
||||
cy.get('.ProseMirror').window().then(window => {
|
||||
const { editor } = window
|
@ -24,6 +24,8 @@ export default {
|
||||
extensions: extensions(),
|
||||
renderer: Renderer,
|
||||
})
|
||||
|
||||
window.editor = this.editor
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
|
1
docs/src/docPages/basic.md
Normal file
1
docs/src/docPages/basic.md
Normal file
@ -0,0 +1 @@
|
||||
<demo name="Basic" />
|
@ -1,44 +0,0 @@
|
||||
<template>
|
||||
<Layout>
|
||||
<editor-content :editor="editor" />
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Editor } from '@tiptap/core'
|
||||
import { EditorContent } from '@tiptap/vue'
|
||||
import Document from '@tiptap/extension-document'
|
||||
import Paragraph from '@tiptap/extension-paragraph'
|
||||
import Text from '@tiptap/extension-text'
|
||||
import History from '@tiptap/extension-history'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
EditorContent,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
editor: null,
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.editor = new Editor({
|
||||
content: '<p>foo</p>',
|
||||
extensions: [
|
||||
new Document(),
|
||||
new Paragraph(),
|
||||
new Text(),
|
||||
new History(),
|
||||
],
|
||||
})
|
||||
|
||||
window.editor = this.editor
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.editor.destroy()
|
||||
},
|
||||
}
|
||||
</script>
|
@ -1,3 +1,5 @@
|
||||
{
|
||||
"baseUrl": "http://localhost:3000"
|
||||
"baseUrl": "http://localhost:3000",
|
||||
"integrationFolder": "../docs/src/",
|
||||
"testFiles": "**/*.spec.js"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user