|
@@ -108,6 +108,8 @@ describe( 'MentionUI', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should properly calculate position data', () => {
|
|
it( 'should properly calculate position data', () => {
|
|
|
|
|
+ const editableElement = editingView.document.selection.editableElement;
|
|
|
|
|
+
|
|
|
setData( model, '<paragraph>foo []</paragraph>' );
|
|
setData( model, '<paragraph>foo []</paragraph>' );
|
|
|
stubSelectionRects( [ caretRect ] );
|
|
stubSelectionRects( [ caretRect ] );
|
|
|
|
|
|
|
@@ -120,10 +122,14 @@ describe( 'MentionUI', () => {
|
|
|
return waitForDebounce()
|
|
return waitForDebounce()
|
|
|
.then( () => {
|
|
.then( () => {
|
|
|
const pinArgument = pinSpy.firstCall.args[ 0 ];
|
|
const pinArgument = pinSpy.firstCall.args[ 0 ];
|
|
|
- const { target, positions } = pinArgument;
|
|
|
|
|
|
|
+ const { target, positions, limiter, fitInViewport } = pinArgument;
|
|
|
|
|
|
|
|
|
|
+ expect( fitInViewport ).to.be.true;
|
|
|
expect( positions ).to.have.length( 4 );
|
|
expect( positions ).to.have.length( 4 );
|
|
|
|
|
|
|
|
|
|
+ // Mention UI should set limiter to the editable area.
|
|
|
|
|
+ expect( limiter() ).to.equal( editingView.domConverter.mapViewToDom( editableElement ) );
|
|
|
|
|
+
|
|
|
expect( editor.model.markers.has( 'mention' ) ).to.be.true;
|
|
expect( editor.model.markers.has( 'mention' ) ).to.be.true;
|
|
|
const mentionMarker = editor.model.markers.get( 'mention' );
|
|
const mentionMarker = editor.model.markers.get( 'mention' );
|
|
|
const focus = doc.selection.focus;
|
|
const focus = doc.selection.focus;
|