mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 09:25:29 +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/')
|
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/')
|
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/')
|
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', () => {
|
context('/src/Extensions/CollaborationCursor/React', () => {
|
||||||
before(() => {
|
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', () => {
|
context('/src/Extensions/CollaborationCursor/Vue', () => {
|
||||||
before(() => {
|
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
|
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.
|
* and will take precedence over other extensions with a lower priority.
|
||||||
* @default 100
|
* @default 100
|
||||||
* @example 101
|
* @example 101
|
||||||
|
@ -35,7 +35,7 @@ declare module '@tiptap/core' {
|
|||||||
name: string
|
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.
|
* and will take precedence over other extensions with a lower priority.
|
||||||
* @default 100
|
* @default 100
|
||||||
* @example 101
|
* @example 101
|
||||||
|
@ -36,7 +36,7 @@ declare module '@tiptap/core' {
|
|||||||
name: string
|
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.
|
* and will take precedence over other extensions with a lower priority.
|
||||||
* @default 100
|
* @default 100
|
||||||
* @example 101
|
* @example 101
|
||||||
|
@ -96,7 +96,7 @@ const defaultOnUpdate = () => null
|
|||||||
export const CollaborationCursor = Extension.create<CollaborationCursorOptions, CollaborationCursorStorage>({
|
export const CollaborationCursor = Extension.create<CollaborationCursorOptions, CollaborationCursorStorage>({
|
||||||
name: 'collaborationCursor',
|
name: 'collaborationCursor',
|
||||||
|
|
||||||
priority: 1001,
|
priority: 999,
|
||||||
|
|
||||||
addOptions() {
|
addOptions() {
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user