Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Other: Remove env.isEdge. Closes ckeditor/ckeditor5#6202.
Browse files Browse the repository at this point in the history
Remove some special cases for Edge, as since it's Chromium-based now, it behaves closer to others.
  • Loading branch information
tomalec committed Apr 17, 2020
1 parent 4d678d3 commit 125c04d
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions tests/mentionui.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,29 +440,20 @@ describe( 'MentionUI', () => {
expect( panelView.isVisible ).to.be.true;
expectChildViewsIsOnState( [ true, false, false, false, false, false, false, false, false, false ] );

// Edge browser always tries to scroll in tests environment: See ckeditor5-utils#282.
if ( !env.isEdge ) {
sinon.assert.callCount( mentionElementSpy.set, 0 );
}
sinon.assert.callCount( mentionElementSpy.set, 0 );

fireKeyDownEvent( arrowDownEvtData );

expectChildViewsIsOnState( [ false, true, false, false, false, false, false, false, false, false ] );
// Edge browser always tries to scroll in tests environment: See ckeditor5-utils#282.
if ( !env.isEdge ) {
expect( mentionsView.element.scrollTop ).to.equal( 0 );
sinon.assert.callCount( mentionElementSpy.set, 0 );
}
expect( mentionsView.element.scrollTop ).to.equal( 0 );
sinon.assert.callCount( mentionElementSpy.set, 0 );

fireKeyDownEvent( arrowUpEvtData );

expectChildViewsIsOnState( [ true, false, false, false, false, false, false, false, false, false ] );
expect( mentionsView.element.scrollTop ).to.equal( 0 );

// Edge browser always tries to scroll in tests environment: See ckeditor5-utils#282.
if ( !env.isEdge ) {
sinon.assert.callCount( mentionElementSpy.set, 0 );
}
sinon.assert.callCount( mentionElementSpy.set, 0 );

fireKeyDownEvent( arrowUpEvtData );

Expand All @@ -471,10 +462,7 @@ describe( 'MentionUI', () => {
// We want 150, but sometimes we get e.g. 151.
expect( mentionsView.element.scrollTop ).to.be.within( 140, 160, 'last item highlighted' );

// Edge browser always tries to scroll in tests environment: See ckeditor5-utils#282.
if ( !env.isEdge ) {
sinon.assert.callCount( mentionElementSpy.set, 1 );
}
sinon.assert.callCount( mentionElementSpy.set, 1 );

fireKeyDownEvent( arrowDownEvtData );

Expand All @@ -483,10 +471,7 @@ describe( 'MentionUI', () => {
// We want 0, but sometimes we get e.g. 1. (Firefox)
expect( mentionsView.element.scrollTop ).to.be.within( 0, 10 );

// Edge browser always tries to scroll in tests environment: See ckeditor5-utils#282.
if ( !env.isEdge ) {
sinon.assert.callCount( mentionElementSpy.set, 2 );
}
sinon.assert.callCount( mentionElementSpy.set, 2 );
} );
} );
} );
Expand Down

0 comments on commit 125c04d

Please sign in to comment.