Skip to content

Commit

Permalink
Add clipboard test cases for plain text
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Feb 12, 2024
1 parent 622b68d commit bb3cbc5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/quill/test/unit/modules/clipboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,17 @@ describe('Clipboard', () => {
return quill.clipboard;
};

test('plain text', () => {
test('text with adjacent spaces', () => {
const delta = createClipboard().convert({ text: 'simple text' });
expect(delta).toEqual(new Delta().insert('simple text'));
});

test('text with newlines', () => {
const delta = createClipboard().convert({ text: 'simple\ntext' });
expect(delta).toEqual(new Delta().insert('simple\ntext'));
});

test('only text in html', () => {
const delta = createClipboard().convert({ html: 'simple plain text' });
expect(delta).toEqual(new Delta().insert('simple plain text'));
});
Expand Down

0 comments on commit bb3cbc5

Please sign in to comment.