Skip to content

Commit

Permalink
test(plaintext) add regression test for newlines
Browse files Browse the repository at this point in the history
Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Oct 24, 2024
1 parent c3d27a2 commit 3d902ba
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/tests/plaintext.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,17 @@ describe('html as plain text', () => {
expect(plaintextThroughEditor('"\';&.-#><')).toBe('"\';&.-#><')
expect(plaintextThroughEditor(xssFuzzVectors)).toBe(xssFuzzVectors)
})
} )

describe('regression tests', () => {
test('tripple enter creates new lines at end (#6507)', () => {
const tiptap = createEditor({
enableRichEditing: false
})
tiptap.commands.enter()
tiptap.commands.enter()
tiptap.commands.enter()
expect(serializePlainText(tiptap.state.doc))
.toEqual("\n\n\n")
})
})

0 comments on commit 3d902ba

Please sign in to comment.