Skip to content

Commit

Permalink
Removed unnecessary asynchronous code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekbogdanski authored and Dumluregn committed Aug 5, 2020
1 parent cfd11b1 commit 35cb0ac
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions src/ckeditor/ckeditor.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ describe( 'CKEditorComponent', () => {
return eventPromise;
} );

it( 'drag/drop events should emit component dragStart, dragEnd and drop', done => {
it( 'drag/drop events should emit component dragStart, dragEnd and drop', () => {
fixture.detectChanges();

const spyDragStart = jasmine.createSpy( 'dragstart' );
Expand All @@ -428,30 +428,26 @@ describe( 'CKEditorComponent', () => {
const spyDrop = jasmine.createSpy( 'drop' );
component.drop.subscribe( spyDrop );

whenDataReady( component.instance, () => {
const dropEvent = mockDropEvent();
const paragraph = component.instance.editable().findOne( 'p' );
const dropEvent = mockDropEvent();
const paragraph = component.instance.editable().findOne( 'p' );

component.instance.getSelection().selectElement( paragraph );
component.instance.getSelection().selectElement( paragraph );

fireDragEvent( 'dragstart', component.instance, dropEvent );
fireDragEvent( 'dragstart', component.instance, dropEvent );

expect( spyDragStart ).toHaveBeenCalledTimes( 1 );
expect( spyDragStart ).toHaveBeenCalledTimes( 1 );

fireDragEvent( 'dragend', component.instance, dropEvent );
fireDragEvent( 'dragend', component.instance, dropEvent );

expect( spyDragEnd ).toHaveBeenCalledTimes( 1 );
expect( spyDragEnd ).toHaveBeenCalledTimes( 1 );

// There is some issue in Firefox with simulating drag-drop flow. The drop event
// is not fired making this assertion fail. Let's skip it for now.
if ( !CKEDITOR.env.gecko ) {
fireDragEvent( 'drop', component.instance, dropEvent );
// There is some issue in Firefox with simulating drag-drop flow. The drop event
// is not fired making this assertion fail. Let's skip it for now.
if ( !CKEDITOR.env.gecko ) {
fireDragEvent( 'drop', component.instance, dropEvent );

expect( spyDrop ).toHaveBeenCalledTimes( 1 );
}

done();
} );
expect( spyDrop ).toHaveBeenCalledTimes( 1 );
}
} );

it( 'fileUploadRequest should emit component fileUploadRequest', () => {
Expand Down

0 comments on commit 35cb0ac

Please sign in to comment.