mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
fix: update docs and add tests for collaboration and priority docs
This commit is contained in:
parent
e11aa0de22
commit
2c6590b3d4
@ -3,5 +3,22 @@ context('/src/Demos/CollaborationSplitPane/React/', () => {
|
||||
cy.visit('/src/Demos/CollaborationSplitPane/React/')
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
it('should have a working tiptap instance', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
// eslint-disable-next-line
|
||||
expect(editor).to.not.be.null
|
||||
})
|
||||
})
|
||||
|
||||
it('should have a ydoc', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
/**
|
||||
* @type {import('yjs').Doc}
|
||||
*/
|
||||
const yDoc = editor.extensionManager.extensions.find(a => a.name === 'collaboration').options.document
|
||||
|
||||
// eslint-disable-next-line
|
||||
expect(yDoc).to.not.be.null
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -3,5 +3,22 @@ context('/src/Extensions/Collaboration/React/', () => {
|
||||
cy.visit('/src/Extensions/Collaboration/React/')
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
it('should have a working tiptap instance', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
// eslint-disable-next-line
|
||||
expect(editor).to.not.be.null
|
||||
})
|
||||
})
|
||||
|
||||
it('should have a ydoc', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
/**
|
||||
* @type {import('yjs').Doc}
|
||||
*/
|
||||
const yDoc = editor.extensionManager.extensions.find(a => a.name === 'collaboration').options.document
|
||||
|
||||
// eslint-disable-next-line
|
||||
expect(yDoc).to.not.be.null
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -3,5 +3,22 @@ context('/src/Extensions/Collaboration/Vue/', () => {
|
||||
cy.visit('/src/Extensions/Collaboration/Vue/')
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
it('should have a working tiptap instance', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
// eslint-disable-next-line
|
||||
expect(editor).to.not.be.null
|
||||
})
|
||||
})
|
||||
|
||||
it('should have a ydoc', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
/**
|
||||
* @type {import('yjs').Doc}
|
||||
*/
|
||||
const yDoc = editor.extensionManager.extensions.find(a => a.name === 'collaboration').options.document
|
||||
|
||||
// eslint-disable-next-line
|
||||
expect(yDoc).to.not.be.null
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -1,7 +1,24 @@
|
||||
context('/src/Extensions/CollaborationCursor/React', () => {
|
||||
before(() => {
|
||||
cy.visit('/src/Extensions/CollaborationCursor/React')
|
||||
cy.visit('/src/Extensions/CollaborationCursor/React/')
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
it('should have a working tiptap instance', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
// eslint-disable-next-line
|
||||
expect(editor).to.not.be.null
|
||||
})
|
||||
})
|
||||
|
||||
it('should have a ydoc', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
/**
|
||||
* @type {import('yjs').Doc}
|
||||
*/
|
||||
const yDoc = editor.extensionManager.extensions.find(a => a.name === 'collaboration').options.document
|
||||
|
||||
// eslint-disable-next-line
|
||||
expect(yDoc).to.not.be.null
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -1,7 +1,24 @@
|
||||
context('/src/Extensions/CollaborationCursor/Vue', () => {
|
||||
before(() => {
|
||||
cy.visit('/src/Extensions/CollaborationCursor/Vue')
|
||||
cy.visit('/src/Extensions/CollaborationCursor/Vue/')
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
it('should have a working tiptap instance', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
// eslint-disable-next-line
|
||||
expect(editor).to.not.be.null
|
||||
})
|
||||
})
|
||||
|
||||
it('should have a ydoc', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
/**
|
||||
* @type {import('yjs').Doc}
|
||||
*/
|
||||
const yDoc = editor.extensionManager.extensions.find(a => a.name === 'collaboration').options.document
|
||||
|
||||
// eslint-disable-next-line
|
||||
expect(yDoc).to.not.be.null
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -32,7 +32,7 @@ declare module '@tiptap/core' {
|
||||
name: string
|
||||
|
||||
/**
|
||||
* The priority of your extension. The higher, the later it will be called
|
||||
* The priority of your extension. The higher, the earlier it will be called
|
||||
* and will take precedence over other extensions with a lower priority.
|
||||
* @default 100
|
||||
* @example 101
|
||||
|
@ -35,7 +35,7 @@ declare module '@tiptap/core' {
|
||||
name: string
|
||||
|
||||
/**
|
||||
* The priority of your extension. The higher, the later it will be called
|
||||
* The priority of your extension. The higher, the earlier it will be called
|
||||
* and will take precedence over other extensions with a lower priority.
|
||||
* @default 100
|
||||
* @example 101
|
||||
|
@ -36,7 +36,7 @@ declare module '@tiptap/core' {
|
||||
name: string
|
||||
|
||||
/**
|
||||
* The priority of your extension. The higher, the later it will be called
|
||||
* The priority of your extension. The higher, the earlier it will be called
|
||||
* and will take precedence over other extensions with a lower priority.
|
||||
* @default 100
|
||||
* @example 101
|
||||
|
@ -96,7 +96,7 @@ const defaultOnUpdate = () => null
|
||||
export const CollaborationCursor = Extension.create<CollaborationCursorOptions, CollaborationCursorStorage>({
|
||||
name: 'collaborationCursor',
|
||||
|
||||
priority: 1001,
|
||||
priority: 999,
|
||||
|
||||
addOptions() {
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user