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 Oct 9, 2024
1 parent 07e4bd0 commit 995642e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tests/plaintext.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,14 @@ 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 = createPlainEditor()
tiptap.commands.enter()
tiptap.commands.enter()
tiptap.commands.enter()
expect(serializePlainText(tiptap.state.doc)).toEqual("\n\n\n")
})
})

0 comments on commit 995642e

Please sign in to comment.