Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bmakuh committed Jan 30, 2025
1 parent ad0734e commit db41867
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/quill/src/modules/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ class Keyboard extends Module<KeyboardOptions> {
}

handleDelete(range: Range, context: Context) {
// const text = context.suffix;
// Check for astral symbols
const length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix)
? 2
Expand Down
3 changes: 2 additions & 1 deletion packages/quill/test/unit/core/composition.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ describe('Composition', () => {
const scroll = new Scroll(createRegistry(), document.createElement('div'), {
emitter,
});
new Composition(scroll, emitter);
const composition = new Composition(scroll, emitter);

vitest.spyOn(emitter, 'emit');

const event = new CompositionEvent('compositionstart');
scroll.domNode.dispatchEvent(event);
composition.isComposing = false;
const updateEvent = new CompositionEvent('compositionupdate');
scroll.domNode.dispatchEvent(updateEvent);
expect(emitter.emit).toHaveBeenCalledWith(
Expand Down
6 changes: 3 additions & 3 deletions packages/quill/test/unit/core/editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1257,17 +1257,17 @@ describe('Editor', () => {
0,
11,
),
).toEqual('<strong>123&nbsp;</strong>123<em>&nbsp;123</em>');
).toEqual('<strong>123 </strong>123<em> 123</em>');

expect(createEditor(new Delta().insert('1 2\n')).getHTML(0, 5)).toEqual(
'1&nbsp;&nbsp;&nbsp;2',
'1 2',
);

expect(
createEditor(
new Delta().insert(' 123', { bold: true }).insert('\n'),
).getHTML(0, 5),
).toEqual('<strong>&nbsp;&nbsp;123</strong>');
).toEqual('<strong> 123</strong>');
});

test('mixed list', () => {
Expand Down

0 comments on commit db41867

Please sign in to comment.