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

Commit

Permalink
Tests: Fixed to.be.equal() use.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Apr 24, 2020
1 parent 6037d17 commit 33b0228
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion tests/model/operation/attributeoperation.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ describe( 'AttributeOperation', () => {
const clone = op.clone();

// New instance rather than a pointer to the old instance.
expect( clone ).not.to.be.equal( op );
expect( clone ).not.to.equal( op );

expect( clone ).to.be.instanceof( AttributeOperation );
expect( clone.range.isEqual( range ) ).to.be.true;
Expand Down
2 changes: 1 addition & 1 deletion tests/model/operation/insertoperation.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ describe( 'InsertOperation', () => {
const clone = op.clone();

// New instance rather than a pointer to the old instance.
expect( clone ).not.to.be.equal( op );
expect( clone ).not.to.equal( op );

expect( clone ).to.be.instanceof( InsertOperation );
expect( clone.position.isEqual( position ) ).to.be.true;
Expand Down
2 changes: 1 addition & 1 deletion tests/model/operation/mergeoperation.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ describe( 'MergeOperation', () => {
const clone = op.clone();

// New instance rather than a pointer to the old instance.
expect( clone ).not.to.be.equal( op );
expect( clone ).not.to.equal( op );

expect( clone ).to.be.instanceof( MergeOperation );
expect( clone.sourcePosition.isEqual( sourcePosition ) ).to.be.true;
Expand Down
2 changes: 1 addition & 1 deletion tests/model/operation/moveoperation.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe( 'MoveOperation', () => {
const clone = op.clone();

// New instance rather than a pointer to the old instance.
expect( clone ).not.to.be.equal( op );
expect( clone ).not.to.equal( op );

expect( clone ).to.be.instanceof( MoveOperation );
expect( clone.sourcePosition.isEqual( sourcePosition ) ).to.be.true;
Expand Down
2 changes: 1 addition & 1 deletion tests/model/operation/renameoperation.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe( 'RenameOperation', () => {
const clone = op.clone();

// New instance rather than a pointer to the old instance.
expect( clone ).not.to.be.equal( op );
expect( clone ).not.to.equal( op );

expect( clone ).to.be.instanceof( RenameOperation );
expect( clone.baseVersion ).to.equal( op.baseVersion );
Expand Down
2 changes: 1 addition & 1 deletion tests/model/operation/rootattributeoperation.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe( 'RootAttributeOperation', () => {
const clone = op.clone();

// New instance rather than a pointer to the old instance.
expect( clone ).not.to.be.equal( op );
expect( clone ).not.to.equal( op );

expect( clone ).to.be.instanceof( RootAttributeOperation );
expect( clone.root ).to.equal( root );
Expand Down
4 changes: 2 additions & 2 deletions tests/model/operation/splitoperation.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe( 'SplitOperation', () => {
const clone = op.clone();

// New instance rather than a pointer to the old instance.
expect( clone ).not.to.be.equal( op );
expect( clone ).not.to.equal( op );

expect( clone ).to.be.instanceof( SplitOperation );
expect( clone.splitPosition.isEqual( position ) ).to.be.true;
Expand All @@ -191,7 +191,7 @@ describe( 'SplitOperation', () => {
const clone = op.clone();

// New instance rather than a pointer to the old instance.
expect( clone ).not.to.be.equal( op );
expect( clone ).not.to.equal( op );

expect( clone ).to.be.instanceof( SplitOperation );
expect( clone.splitPosition.isEqual( position ) ).to.be.true;
Expand Down
4 changes: 2 additions & 2 deletions tests/model/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe( 'Range', () => {
it( 'should create a new instance of Range that is equal to passed range', () => {
const clone = range.clone();

expect( clone ).not.to.be.equal( range ); // clone is not pointing to the same object as position
expect( clone ).not.to.equal( range ); // clone is not pointing to the same object as position
expect( clone.isEqual( range ) ).to.be.true; // but they are equal in the position-sense
} );
} );
Expand Down Expand Up @@ -242,7 +242,7 @@ describe( 'Range', () => {
const range = Range._createFromRanges( [ original ] );

expect( range.isEqual( original ) ).to.be.true;
expect( range ).not.to.be.equal( original );
expect( range ).not.to.equal( original );
} );

it( 'should combine ranges with reference range', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/model/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ describe( 'Selection', () => {
expect( ranges.length ).to.equal( 2 );
expect( ranges[ 0 ].isEqual( liveRange ) ).to.be.true;
expect( ranges[ 1 ].isEqual( range ) ).to.be.true;
expect( ranges[ 0 ] ).not.to.be.equal( liveRange );
expect( ranges[ 1 ] ).not.to.be.equal( range );
expect( ranges[ 0 ] ).not.to.equal( liveRange );
expect( ranges[ 1 ] ).not.to.equal( range );
} );

it( 'should set anchor and focus to the start and end of the last added range', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/view/domconverter/uielement.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe( 'DOMConverter UIElement integration', () => {
const domSpan = domParagraph.childNodes[ 0 ];

expect( converter.domToView( domParagraph ) ).to.equal( uiElement );
expect( converter.domToView( domSpan ) ).to.be.equal( uiElement );
expect( converter.domToView( domSpan ) ).to.equal( uiElement );
expect( converter.domToView( domParagraph.childNodes[ 0 ] ) ).equal( uiElement );
expect( converter.domToView( domSpan.childNodes[ 0 ] ) ).equal( uiElement );
} );
Expand Down
2 changes: 1 addition & 1 deletion tests/view/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ describe( 'Element', () => {

parent._insertChild( 0, anotherEl );

expect( anotherEl.document ).to.be.equal( document );
expect( anotherEl.document ).to.equal( document );
} );
} );

Expand Down
4 changes: 2 additions & 2 deletions tests/view/observer/mutationobserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ describe( 'MutationObserver', () => {

mutationObserver.flush();

expect( renderStub.callCount ).to.be.equal( 0 );
expect( renderStub.callCount ).to.equal( 0 );
} );

it( 'should not collect child mutations from UIElement', () => {
Expand All @@ -587,7 +587,7 @@ describe( 'MutationObserver', () => {

mutationObserver.flush();

expect( renderStub.callCount ).to.be.equal( 0 );
expect( renderStub.callCount ).to.equal( 0 );
} );
} );

Expand Down
8 changes: 4 additions & 4 deletions tests/view/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ describe( 'Renderer', () => {
selection._setTo( selection.getRanges(), { fake: true, label } );
renderer.render();

expect( createRangeSpy.callCount ).to.be.equal( 1 );
expect( createRangeSpy.callCount ).to.equal( 1 );
} );

it( 'different subsequent fake selections sets do change native selection', () => {
Expand All @@ -1829,7 +1829,7 @@ describe( 'Renderer', () => {
selection._setTo( selection.getRanges(), { fake: true, label: 'selection 2' } );
renderer.render();

expect( createRangeSpy.callCount ).to.be.equal( 2 );
expect( createRangeSpy.callCount ).to.equal( 2 );
} );

it( 'rerenders selection if disturbed externally', () => {
Expand All @@ -1849,7 +1849,7 @@ describe( 'Renderer', () => {
selection._setTo( selection.getRanges(), { fake: true, label } );
renderer.render();

expect( createRangeSpy.callCount ).to.be.equal( 2 );
expect( createRangeSpy.callCount ).to.equal( 2 );
} );

it( 'correctly maps fake selection ', () => {
Expand All @@ -1868,7 +1868,7 @@ describe( 'Renderer', () => {
const fakeSelectionContainer = domRoot.childNodes[ 1 ];
const mappedSelection = renderer.domConverter.fakeSelectionToView( fakeSelectionContainer );

expect( stringify( viewRoot, mappedSelection ) ).to.be.equal( '<div><p>foo bar</p><p>[baz]</p></div>' );
expect( stringify( viewRoot, mappedSelection ) ).to.equal( '<div><p>foo bar</p><p>[baz]</p></div>' );
} );
} );

Expand Down

0 comments on commit 33b0228

Please sign in to comment.