-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12065 from ckeditor/ck/11972
Internal (image): Prevent getClosestSelectedImageWidget() from throwing when view selection is empty. Closes #11972. Internal (table): Prevent getTableWidgetAncestor() from throwing when view selection is empty. Closes #11972.
- Loading branch information
Showing
4 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
import ViewSelection from '@ckeditor/ckeditor5-engine/src/view/selection'; | ||
import { getTableWidgetAncestor } from '../../../src/utils/ui/widget'; | ||
|
||
describe( 'table utils', () => { | ||
describe( 'widget', () => { | ||
describe( 'getTableWidgetAncestor()', () => { | ||
// See https://github.com/ckeditor/ckeditor5/issues/11972. | ||
it( 'should return null if view selection is empty', () => { | ||
const selection = new ViewSelection(); | ||
|
||
expect( getTableWidgetAncestor( selection ) ).to.be.null; | ||
} ); | ||
} ); | ||
} ); | ||
} ); |