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 <max@nextcloud.com>
  • Loading branch information
max-nextcloud committed Dec 10, 2024
1 parent 0696c1d commit 817a284
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))
.toEqual("\n\n\n")
})
})

0 comments on commit 817a284

Please sign in to comment.