mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-24 00:05:50 +00:00
tests/qunit: Change assert.ok to assert.true
Avoid loose assertion Change-Id: I6fd398ef2608c836fd59e0a48271f11c5e0d78a9
This commit is contained in:
parent
082a59b991
commit
1a4bd424b4
|
@ -19,7 +19,7 @@
|
|||
|
||||
model = new CardModel( {} );
|
||||
model.on( 'change', function () {
|
||||
assert.ok( false, 'It doesn\'t emit an event when silenced.' );
|
||||
assert.true( false, 'It doesn\'t emit an event when silenced.' );
|
||||
} );
|
||||
|
||||
model.set( 'foo', 'bar', true );
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
this.sandbox.stub( this.api, 'get' ).returns( $.Deferred().resolve( relatedPages ) );
|
||||
|
||||
return gateway.getForCurrentPage( 1 ).then( function ( results ) {
|
||||
assert.ok( Array.isArray( results ), 'Results must be an array' );
|
||||
assert.true( Array.isArray( results ), 'Results must be an array' );
|
||||
assert.strictEqual( results[ 0 ].title, 'Oh noes' );
|
||||
} );
|
||||
} );
|
||||
|
@ -42,7 +42,7 @@
|
|||
this.sandbox.stub( this.api, 'get' ).returns( $.Deferred().resolve( emptyRelatedPages ) );
|
||||
|
||||
return gateway.getForCurrentPage( 1 ).then( function ( results ) {
|
||||
assert.ok( Array.isArray( results ), 'Results must be an array' );
|
||||
assert.true( Array.isArray( results ), 'Results must be an array' );
|
||||
assert.strictEqual( results.length, 0 );
|
||||
} );
|
||||
} );
|
||||
|
@ -52,8 +52,8 @@
|
|||
spy = this.sandbox.stub( this.api, 'get' ).returns( $.Deferred().resolve( relatedPages ) );
|
||||
|
||||
return gateway.getForCurrentPage( 1 ).then( function ( results ) {
|
||||
assert.ok( Array.isArray( results ), 'Results must be an array' );
|
||||
assert.notOk( spy.called, 'API is not invoked' );
|
||||
assert.true( Array.isArray( results ), 'Results must be an array' );
|
||||
assert.false( spy.called, 'API is not invoked' );
|
||||
assert.strictEqual( results.length, 0 );
|
||||
} );
|
||||
} );
|
||||
|
@ -97,7 +97,7 @@
|
|||
.returns( $.Deferred().resolve( relatedPages ) );
|
||||
|
||||
return gateway.getForCurrentPage( 1 ).then( function ( results ) {
|
||||
assert.ok( Array.isArray( results ), 'Results must be an array' );
|
||||
assert.true( Array.isArray( results ), 'Results must be an array' );
|
||||
assert.strictEqual( results.length, 1, 'API is invoked to source articles.' );
|
||||
} );
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue