tiptap/tests/cypress/integration/Issue4327/index.spec.ts
bdbch d9b6ef5ce2
fix emptyTextBlock detection to handle leaf nodes too (#5838)
* fix: #4327

* merge forked PR

---------

Co-authored-by: Tony Hallett <tonyhallett74@gmail.com>
2024-11-30 14:19:16 +01:00

19 lines
585 B
TypeScript

/// <reference types="cypress" />
import { Editor } from '@tiptap/core'
interface EditorElement extends HTMLElement {
editor: Editor
}
context('/cypress/integration/Issue4327/React/', () => {
before(() => {
cy.visit('/src/Examples/Issue4327/React/')
})
it('should not show menu when node has renderText returning text with length > 0', () => {
cy.get('.tiptap').then(([editorElement]) => {
(editorElement as EditorElement).editor.commands.focus()
}).get('.ProseMirror-focused').get('#app')
.should('not.have.descendants', '[data-tippy-root]')
})
})