From 817a284d7378de502d59e0b69e66c8959d126270 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..e3f60e48fd1 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)) + .toEqual("\n\n\n") + }) })