From 9c0548afbd332de8cd425ddbd3d0e7c7c485ba30 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 8 Oct 2024 11:47:14 +0200 Subject: [PATCH] test(plaintext) add regression test for newlines Signed-off-by: Max --- src/tests/plaintext.spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/tests/plaintext.spec.js b/src/tests/plaintext.spec.js index fdd68fa0eb4..0f6f194d1d2 100644 --- a/src/tests/plaintext.spec.js +++ b/src/tests/plaintext.spec.js @@ -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") + }) })