Skip to content

Commit

Permalink
add new test for ltr
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-stv committed Feb 15, 2023
1 parent 0de6ecb commit 80181a3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/ckeditor5-mention/tests/mentionui.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,39 @@ describe( 'MentionUI', () => {
] );
} );
} );

describe( 'contextual balloon in ltr', () => {
let contextualBaloonSpy;

beforeEach( async () => {
await editor.destroy();

return createClassicTestEditor( { ...staticConfig } )
.then( () => {
const contextualBalloon = editor.plugins.get( ContextualBalloon );
setData( model, '<paragraph>foo []</paragraph>' );
contextualBaloonSpy = sinon.spy( contextualBalloon, 'add' );

model.change( writer => {
writer.insertText( '@', doc.selection.getFirstPosition() );
} );
} )
.then( waitForDebounce );
} );

it( 'should set proper position list in ltr', () => {
const extractedPositions = contextualBaloonSpy.getCall( 0 ).firstArg.position.positions.map( callback => {
return callback( {}, {} ).name;
} );

expect( extractedPositions ).to.have.ordered.members( [
'caret_se',
'caret_sw',
'caret_ne',
'caret_nw'
] );
} );
} );
} );

describe( 'typing integration', () => {
Expand Down

0 comments on commit 80181a3

Please sign in to comment.