Skip to content

Commit

Permalink
add invariant condition to match other copy/paste tests
Browse files Browse the repository at this point in the history
  • Loading branch information
redstar504 committed Jan 15, 2025
1 parent 791c8a2 commit e3f9127
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/lexical/src/__tests__/unit/HTMLCopyAndPaste.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
});
Expand Down

0 comments on commit e3f9127

Please sign in to comment.