diff --git a/packages/lexical/src/__tests__/unit/HTMLCopyAndPaste.test.ts b/packages/lexical/src/__tests__/unit/HTMLCopyAndPaste.test.ts index 73a4c05923d..0a6cd197873 100644 --- a/packages/lexical/src/__tests__/unit/HTMLCopyAndPaste.test.ts +++ b/packages/lexical/src/__tests__/unit/HTMLCopyAndPaste.test.ts @@ -125,6 +125,10 @@ describe('HTMLCopyAndPaste tests', () => { // to compensate, the clipboard content will only be inserted as HTML if the `text/html` content differs from the `text/plain` content await editor.update(() => { const selection = $getSelection(); + invariant( + $isRangeSelection(selection), + 'isRangeSelection(selection)', + ); $patchStyleText(selection, { 'background-color': 'rgb(255,170,45)', });