Pablo Grass (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373106 )

Change subject: QUnit: Assert amount via method call
......................................................................

QUnit: Assert amount via method call

Set the amount of asserts to expect via assert method instead of via
(optional) test method second parameter - which apparently is not supported
anymore.

Change-Id: I0bce92d112421dbff4924ca8faf8e2f2e9a0b0ce
---
M tests/qunit/dm/SearchModel.test.js
M tests/qunit/ui/NamespaceFilters.test.js
M tests/qunit/ui/NamespacePresets.test.js
M tests/qunit/ui/SearchPreview.test.js
M tests/qunit/ui/TemplateSearch.test.js
5 files changed, 154 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AdvancedSearch 
refs/changes/06/373106/1

diff --git a/tests/qunit/dm/SearchModel.test.js 
b/tests/qunit/dm/SearchModel.test.js
index eedb3b2..54bf3fb 100644
--- a/tests/qunit/dm/SearchModel.test.js
+++ b/tests/qunit/dm/SearchModel.test.js
@@ -13,17 +13,23 @@
 
        QUnit.module( 'ext.advancedSearch.dm.SearchModel' );
 
-       QUnit.test( 'Default model has no options', 1, function ( assert ) {
+       QUnit.test( 'Default model has no options', function ( assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                assert.deepEqual( model.getOptions(), {} );
        } );
 
-       QUnit.test( 'Default model has article namespace', 1, function ( assert 
) {
+       QUnit.test( 'Default model has article namespace', function ( assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                assert.deepEqual( model.getNamespaces(), [ '0' ] );
        } );
 
-       QUnit.test( 'Options that were set can be retrieved', 1, function ( 
assert ) {
+       QUnit.test( 'Options that were set can be retrieved', function ( assert 
) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                model.storeOption( 'not', 'octopi' );
                model.storeOption( 'prefix', 'Page' );
@@ -41,7 +47,9 @@
                return model;
        }
 
-       QUnit.test( 'Setting empty JSON string does nothing', 2, function ( 
assert ) {
+       QUnit.test( 'Setting empty JSON string does nothing', function ( assert 
) {
+               assert.expect( 2 );
+
                var model = createModelWithValues(),
                        expected = createModelWithValues();
                model.setAllFromJSON( '' );
@@ -50,7 +58,9 @@
                assert.deepEqual( model.getNamespaces(), 
expected.getNamespaces() );
        } );
 
-       QUnit.test( 'Setting invalid JSON string does nothing', 2, function ( 
assert ) {
+       QUnit.test( 'Setting invalid JSON string does nothing', function ( 
assert ) {
+               assert.expect( 2 );
+
                var model = createModelWithValues(),
                        expected = createModelWithValues();
                model.setAllFromJSON( '{ "unclosed_string": "str }' );
@@ -59,7 +69,9 @@
                assert.deepEqual( model.getNamespaces(), 
expected.getNamespaces() );
        } );
 
-       QUnit.test( 'Setting valid JSON overrides previous state', 2, function 
( assert ) {
+       QUnit.test( 'Setting valid JSON overrides previous state', function ( 
assert ) {
+               assert.expect( 2 );
+
                var model = createModelWithValues();
                model.setAllFromJSON( '{"options":{"or":[ "fish", "turtle" 
],"prefix":"Sea"},"namespaces":["0","2"]}' );
 
@@ -70,26 +82,34 @@
                assert.deepEqual( model.getNamespaces(), [ '0', '2' ] );
        } );
 
-       QUnit.test( 'Namespaces default to main namespace out of the box', 1, 
function ( assert ) {
+       QUnit.test( 'Namespaces default to main namespace out of the box', 
function ( assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                assert.deepEqual( model.getNamespaces(), [ 
SearchModel.MAIN_NAMESPACE ] );
        } );
 
-       QUnit.test( 'Setting namespaces to empty keeps default namespace', 1, 
function ( assert ) {
+       QUnit.test( 'Setting namespaces to empty keeps default namespace', 
function ( assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                model.setNamespaces( [] );
 
                assert.deepEqual( model.getNamespaces(), [ 
SearchModel.MAIN_NAMESPACE ] );
        } );
 
-       QUnit.test( 'Adding filetype option forces file namespace', 1, function 
( assert ) {
+       QUnit.test( 'Adding filetype option forces file namespace', function ( 
assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                model.storeOption( 'filetype', 'image' );
 
                assert.deepEqual( model.getNamespaces(), [ 
SearchModel.MAIN_NAMESPACE, SearchModel.FILE_NAMESPACE ] );
        } );
 
-       QUnit.test( 'When filetype option is set, file namespace cannot be 
removed', 1, function ( assert ) {
+       QUnit.test( 'When filetype option is set, file namespace cannot be 
removed', function ( assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                model.storeOption( 'filetype', 'image' );
                model.setNamespaces( [] );
@@ -97,7 +117,9 @@
                assert.deepEqual( model.getNamespaces(), [ 
SearchModel.FILE_NAMESPACE ] );
        } );
 
-       QUnit.test( 'File dimension data is reset on filetype change', 2, 
function ( assert ) {
+       QUnit.test( 'File dimension data is reset on filetype change', function 
( assert ) {
+               assert.expect( 2 );
+
                var model = new SearchModel();
                model.storeOption( 'filetype', 'jpeg' );
                model.storeOption( 'filew', [ '>', '1500' ] );
@@ -109,7 +131,9 @@
                assert.deepEqual( model.getOption( 'fileh' ), [ '>', '' ] );
        } );
 
-       QUnit.test( 'File dimension data containers reset on filetype remove', 
2, function ( assert ) {
+       QUnit.test( 'File dimension data containers reset on filetype remove', 
function ( assert ) {
+               assert.expect( 2 );
+
                var model = new SearchModel();
                model.storeOption( 'filetype', 'video' );
                model.storeOption( 'filew', [ '', '800' ] );
@@ -121,7 +145,9 @@
                assert.deepEqual( model.getOption( 'fileh' ), [ '>', '' ] );
        } );
 
-       QUnit.test( 'File types support dimensions configured', 5, function ( 
assert ) {
+       QUnit.test( 'File types support dimensions configured', function ( 
assert ) {
+               assert.expect( 5 );
+
                var model = new SearchModel();
 
                model.storeOption( 'filetype', 'bitmap' );
@@ -140,7 +166,9 @@
                assert.notOk( model.filetypeSupportsDimensions() );
        } );
 
-       QUnit.test( 'Setting namespace to existing value does not trigger 
emitUpdate', 1, function ( assert ) {
+       QUnit.test( 'Setting namespace to existing value does not trigger 
emitUpdate', function ( assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                model.setNamespaces( [ '1', '2', '3' ] );
 
@@ -150,7 +178,9 @@
                assert.notOk( updateSpy.called );
        } );
 
-       QUnit.test( 'Changing namespaces triggers emitUpdate', 2, function ( 
assert ) {
+       QUnit.test( 'Changing namespaces triggers emitUpdate', function ( 
assert ) {
+               assert.expect( 2 );
+
                var model = new SearchModel();
                var updateSpy = sandbox.spy( model, 'emitUpdate' );
 
@@ -161,7 +191,9 @@
                assert.ok( updateSpy.calledTwice );
        } );
 
-       QUnit.test( 'Storing an option triggers emitUpdate', 1, function ( 
assert ) {
+       QUnit.test( 'Storing an option triggers emitUpdate', function ( assert 
) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                var updateSpy = sandbox.spy( model, 'emitUpdate' );
 
@@ -170,7 +202,9 @@
                assert.ok( updateSpy.calledOnce );
        } );
 
-       QUnit.test( 'Storing an option with the same scalar value does not 
trigger emitUpdate', 1, function ( assert ) {
+       QUnit.test( 'Storing an option with the same scalar value does not 
trigger emitUpdate', function ( assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                model.storeOption( 'lorem', 'ipsum' );
 
@@ -181,7 +215,9 @@
                assert.notOk( updateSpy.called );
        } );
 
-       QUnit.test( 'Storing an option with the same array value does not 
trigger emitUpdate', 1, function ( assert ) {
+       QUnit.test( 'Storing an option with the same array value does not 
trigger emitUpdate', function ( assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                model.storeOption( 'lorem', [ 'hakuna', 'matata' ] );
 
@@ -192,7 +228,9 @@
                assert.notOk( updateSpy.called );
        } );
 
-       QUnit.test( 'Removing an option triggers emitUpdate', 1, function ( 
assert ) {
+       QUnit.test( 'Removing an option triggers emitUpdate', function ( assert 
) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                model.storeOption( 'lorem', 'ipsum' );
 
@@ -203,7 +241,9 @@
                assert.ok( updateSpy.calledOnce );
        } );
 
-       QUnit.test( 'Removing an unset option does not trigger emitUpdate', 1, 
function ( assert ) {
+       QUnit.test( 'Removing an unset option does not trigger emitUpdate', 
function ( assert ) {
+               assert.expect( 1 );
+
                var model = new SearchModel();
                model.storeOption( 'lorem', 'ipsum' );
 
diff --git a/tests/qunit/ui/NamespaceFilters.test.js 
b/tests/qunit/ui/NamespaceFilters.test.js
index 8b3441c..7cd62f0 100644
--- a/tests/qunit/ui/NamespaceFilters.test.js
+++ b/tests/qunit/ui/NamespaceFilters.test.js
@@ -5,12 +5,16 @@
        QUnit.module( 'ext.advancedSearch.ui.NamespaceFilters' );
 
        QUnit.test( 'User namespace icons are set by default', function ( 
assert ) {
+               assert.expect( 2 );
+
                var filter = new NamespaceFilters( new Model(), {} );
                assert.equal( filter.getNamespaceIcon( 2 ), 'userAvatar' );
                assert.equal( filter.getNamespaceIcon( 3 ), 'userTalk' );
        } );
 
        QUnit.test( 'When namespace icons are not set, default icons are 
returned', function ( assert ) {
+               assert.expect( 2 );
+
                var filter = new NamespaceFilters( new Model(), {
                        namespaceIcons: {}
                } );
@@ -19,6 +23,8 @@
        } );
 
        QUnit.test( 'Namespace object key-value-pairs are appended to menu 
options', function ( assert ) {
+               assert.expect( 5 );
+
                var filter = new NamespaceFilters( new Model(), {
                                options: [ {
                                        data: 'test',
@@ -43,6 +49,8 @@
        } );
 
        QUnit.test( 'Namespaces without labels are skipped', function ( assert 
) {
+               assert.expect( 3 );
+
                var filter = new NamespaceFilters( new Model(), {
                                namespaces: {
                                        0: '',
@@ -66,6 +74,8 @@
        };
 
        QUnit.test( 'StoreUpdate event handler updates hidden namespace 
fields', function ( assert ) {
+               assert.expect( 2 );
+
                var model = new Model(),
                        filter = new NamespaceFilters( model, {
                                namespaces: {
@@ -81,7 +91,9 @@
                assert.namespaceElementsPresent( filter.$namespaceContainer, [ 
'1', '3' ] );
        } );
 
-       QUnit.test( 'Lonely namespace can not be removed', 1, function ( assert 
) {
+       QUnit.test( 'Lonely namespace can not be removed', function ( assert ) {
+               assert.expect( 1 );
+
                var model = new Model(),
                        filter = new NamespaceFilters( model, {
                                namespaces: {
@@ -96,7 +108,9 @@
                assert.equal( filter.getItems()[ 0 ].isDisabled(), true );
        } );
 
-       QUnit.test( 'On multiple namespaces either one can be removed', 3, 
function ( assert ) {
+       QUnit.test( 'On multiple namespaces either one can be removed', 
function ( assert ) {
+               assert.expect( 3 );
+
                var model = new Model(),
                        filter = new NamespaceFilters( model, {
                                namespaces: {
@@ -113,7 +127,9 @@
                assert.equal( filter.getItems()[ 2 ].isDisabled(), false );
        } );
 
-       QUnit.test( 'Value update propagates to model', 1, function ( assert ) {
+       QUnit.test( 'Value update propagates to model', function ( assert ) {
+               assert.expect( 1 );
+
                var model = new Model(),
                        filter = new NamespaceFilters( model, {
                                namespaces: {
diff --git a/tests/qunit/ui/NamespacePresets.test.js 
b/tests/qunit/ui/NamespacePresets.test.js
index 2eba4e2..4cd66d2 100644
--- a/tests/qunit/ui/NamespacePresets.test.js
+++ b/tests/qunit/ui/NamespacePresets.test.js
@@ -12,6 +12,8 @@
        }
 
        QUnit.test( 'Selecting namespace adds its preset', function ( assert ) {
+               assert.expect( 1 );
+
                var model = new Model(),
                        presets = new NamespacePresets( model, {
                                presets: {
@@ -26,6 +28,8 @@
        } );
 
        QUnit.test( 'Unselecting namespace removes its preset', function ( 
assert ) {
+               assert.expect( 1 );
+
                var model = new Model(),
                        presets = new NamespacePresets( model, {
                                presets: {
@@ -41,6 +45,8 @@
        } );
 
        QUnit.test( 'Changing the store namespaces to the preset namespaces, 
selects preset irrespective of order', function ( assert ) {
+               assert.expect( 4 );
+
                var model = new Model(),
                        presets = new NamespacePresets( model, {
                                presets: {
diff --git a/tests/qunit/ui/SearchPreview.test.js 
b/tests/qunit/ui/SearchPreview.test.js
index 84c89dc..8cdaf1b 100644
--- a/tests/qunit/ui/SearchPreview.test.js
+++ b/tests/qunit/ui/SearchPreview.test.js
@@ -23,7 +23,9 @@
 
        QUnit.module( 'ext.advancedSearch.ui.SearchPreview' );
 
-       QUnit.test( 'Label gets setup', 1, function ( assert ) {
+       QUnit.test( 'Label gets setup', function ( assert ) {
+               assert.expect( 1 );
+
                config = {
                        label: 'something'
                };
@@ -32,7 +34,9 @@
                assert.equal( 'something', searchPreview.label.getLabel() );
        } );
 
-       QUnit.test( 'Store data subscribed to and synced initially', 3, 
function ( assert ) {
+       QUnit.test( 'Store data subscribed to and synced initially', function ( 
assert ) {
+               assert.expect( 3 );
+
                var updatePreviewSpy = sandbox.spy( SearchPreview.prototype, 
'updatePreview' );
 
                var searchPreview = new SearchPreview( store, config );
@@ -42,7 +46,9 @@
                assert.ok( updatePreviewSpy.calledOnce );
        } );
 
-       QUnit.test( 'Store state is reflected in preview', 5, function ( assert 
) {
+       QUnit.test( 'Store state is reflected in preview', function ( assert ) {
+               assert.expect( 5 );
+
                var generateTagSpy = sandbox.spy( SearchPreview.prototype, 
'generateTag' );
 
                store.getOption.withArgs( 'somename' ).returns( 'field one 
value' );
@@ -62,7 +68,9 @@
                assert.ok( generateTagSpy.withArgs( 'another', 'field two 
value' ).calledOnce );
        } );
 
-       QUnit.test( 'Options are correctly selected for preview', 16, function 
( assert ) {
+       QUnit.test( 'Options are correctly selected for preview', function ( 
assert ) {
+               assert.expect( 16 );
+
                var searchPreview = new SearchPreview( store, config );
 
                assert.notOk( searchPreview.skipOptionInPreview( 'plain', 
'searchme' ) );
@@ -85,7 +93,9 @@
                assert.ok( searchPreview.skipOptionInPreview( 'filew', [ '>', 
null ] ) );
        } );
 
-       QUnit.test( 'Tag is generated', 5, function ( assert ) {
+       QUnit.test( 'Tag is generated', function ( assert ) {
+               assert.expect( 5 );
+
                var messageStub = sandbox.stub( mw, 'msg' ).withArgs( 
'advancedsearch-field-somename' ).returns( 'my label:' );
                var searchPreview = new SearchPreview( store, config );
                var tag = searchPreview.generateTag( 'somename', 'my field 
value' );
@@ -100,7 +110,9 @@
                assert.equal( $( '.oo-ui-labelElement-label', element ).html(), 
'my label:' );
        } );
 
-       QUnit.test( 'Tag content is HTML-safe', 1, function ( assert ) {
+       QUnit.test( 'Tag content is HTML-safe', function ( assert ) {
+               assert.expect( 1 );
+
                var searchPreview = new SearchPreview( store, config );
                var tag = searchPreview.generateTag( 'whatever', 
'<script>alert("evil");</script>' );
 
@@ -109,7 +121,9 @@
                assert.equal( $( '.content', element ).html(), 
'<bdi>&lt;script&gt;alert("evil");&lt;/script&gt;</bdi>' );
        } );
 
-       QUnit.test( 'Tag label is HTML-safe', 1, function ( assert ) {
+       QUnit.test( 'Tag label is HTML-safe', function ( assert ) {
+               assert.expect( 1 );
+
                sandbox.stub( mw, 'msg' ).withArgs( 
'advancedsearch-field-whatever' ).returns( '<div>block</div>' );
                var searchPreview = new SearchPreview( store, config );
                var tag = searchPreview.generateTag( 'whatever', 'lorem' );
@@ -119,7 +133,9 @@
                assert.equal( $( '.oo-ui-labelElement-label', element ).html(), 
'&lt;div&gt;block&lt;/div&gt;' );
        } );
 
-       QUnit.test( 'Tag removals clears store', 1, function ( assert ) {
+       QUnit.test( 'Tag removals clears store', function ( assert ) {
+               assert.expect( 1 );
+
                var searchPreview = new SearchPreview( store, config );
                var tag = searchPreview.generateTag( 'somename', 'my field 
value' );
 
@@ -127,7 +143,9 @@
                assert.ok( store.removeOption.withArgs( 'somename' ).calledOnce 
);
        } );
 
-       QUnit.test( 'Showing renders pills', 1, function ( assert ) {
+       QUnit.test( 'Showing renders pills', function ( assert ) {
+               assert.expect( 1 );
+
                config.previewOptions = [ 'one', 'two' ];
 
                store.getOption.withArgs( 'one' ).returns( 'field one value' );
@@ -139,7 +157,9 @@
                assert.equal( searchPreview.$element.find( 
'.mw-advancedSearch-searchPreview-previewPill' ).length, 2 );
        } );
 
-       QUnit.test( 'Hiding removes pills', 1, function ( assert ) {
+       QUnit.test( 'Hiding removes pills', function ( assert ) {
+               assert.expect( 1 );
+
                config.previewOptions = [ 'one', 'two' ];
 
                var searchPreview = new SearchPreview( store, config );
@@ -148,7 +168,9 @@
                assert.equal( searchPreview.$element.find( 
'.mw-advancedSearch-searchPreview-previewPill' ).length, 0 );
        } );
 
-       QUnit.test( 'Scalar values get formatted well', 3, function ( assert ) {
+       QUnit.test( 'Scalar values get formatted well', function ( assert ) {
+               assert.expect( 3 );
+
                var searchPreview = new SearchPreview( store, config );
 
                assert.equal( searchPreview.formatValue( 'someOption', '' ), '' 
);
@@ -156,7 +178,9 @@
                assert.equal( searchPreview.formatValue( 'someOption', ' stray 
whitespace  ' ), 'stray whitespace' );
        } );
 
-       QUnit.test( 'Array values get formatted well', 3, function ( assert ) {
+       QUnit.test( 'Array values get formatted well', function ( assert ) {
+               assert.expect( 3 );
+
                var searchPreview = new SearchPreview( store, config );
 
                assert.equal( searchPreview.formatValue( 'someOption', [ 
'some', 'words', 'in', 'combination' ] ), 'some, words, in, combination' );
@@ -164,7 +188,9 @@
                assert.equal( searchPreview.formatValue( 'someOption', [ '', ' 
stray', 'whitespace  ' ] ), 'stray, whitespace' );
        } );
 
-       QUnit.test( 'Dimension values get formatted well', 5, function ( assert 
) {
+       QUnit.test( 'Dimension values get formatted well', function ( assert ) {
+               assert.expect( 5 );
+
                var searchPreview = new SearchPreview( store, config );
                var translationStub = sandbox.stub( mw, 'msg' );
                translationStub.withArgs( 
'advancedSearch-filesize-equals-symbol' ).returns( '=' );
diff --git a/tests/qunit/ui/TemplateSearch.test.js 
b/tests/qunit/ui/TemplateSearch.test.js
index 86d1f66..8ce7e09 100644
--- a/tests/qunit/ui/TemplateSearch.test.js
+++ b/tests/qunit/ui/TemplateSearch.test.js
@@ -25,7 +25,9 @@
 
        QUnit.module( 'ext.advancedSearch.ui.TemplateSearch' );
 
-       QUnit.test( 'Store data subscribed to and synced initially', 4, 
function ( assert ) {
+       QUnit.test( 'Store data subscribed to and synced initially', function ( 
assert ) {
+               assert.expect( 4 );
+
                var setValueSpy = sandbox.spy( TemplateSearch.prototype, 
'setValue' );
                store.getOption.withArgs( 'hastemplate' ).returns( [ 'Burg' ] );
 
@@ -37,7 +39,9 @@
                assert.deepEqual( templateSearch.getValue(), [ 'Burg' ] );
        } );
 
-       QUnit.test( 'Store update is applied', 1, function ( assert ) {
+       QUnit.test( 'Store update is applied', function ( assert ) {
+               assert.expect( 1 );
+
                store.getOption.withArgs( 'hastemplate' ).returns( [ 'from', 
'beyond' ] );
 
                var templateSearch = new TemplateSearch( store, config );
@@ -47,12 +51,16 @@
                assert.deepEqual( templateSearch.getValue(), [ 'from', 'beyond' 
] );
        } );
 
-       QUnit.test( 'Mixin method overridden to prevent problems', 1, function 
( assert ) {
+       QUnit.test( 'Mixin method overridden to prevent problems', function ( 
assert ) {
+               assert.expect( 1 );
+
                var templateSearch = new TemplateSearch( store, config );
                assert.notOk( templateSearch.isReadOnly() );
        } );
 
-       QUnit.test( 'API response processed correctly', 8, function ( assert ) {
+       QUnit.test( 'API response processed correctly', function ( assert ) {
+               assert.expect( 8 );
+
                var templateSearch = new TemplateSearch( store, config );
 
                var apiData = [
@@ -88,7 +96,9 @@
                assert.equal( result[ 2 ].getData(), 'Johannes' );
        } );
 
-       QUnit.test( 'Items already selected are not suggested', 4, function ( 
assert ) {
+       QUnit.test( 'Items already selected are not suggested', function ( 
assert ) {
+               assert.expect( 4 );
+
                var templateSearch = new TemplateSearch( store, config );
                templateSearch.setValue( [ 'Jochen', 'Johannes' ] );
                var apiData = [
@@ -118,13 +128,17 @@
                assert.equal( result[ 0 ].getData(), 'Jens' );
        } );
 
-       QUnit.test( 'Page titles post-processes nicely', 2, function ( assert ) 
{
+       QUnit.test( 'Page titles post-processes nicely', function ( assert ) {
+               assert.expect( 2 );
+
                var templateSearch = new TemplateSearch( store, config );
                assert.equal( templateSearch.removeNamespace( 'Test' ), 'Test' 
);
                assert.equal( templateSearch.removeNamespace( 'Template:Test' 
), 'Test' );
        } );
 
-       QUnit.test( 'Value picked from menu is added to tags and stored', 6, 
function ( assert ) {
+       QUnit.test( 'Value picked from menu is added to tags and stored', 
function ( assert ) {
+               assert.expect( 6 );
+
                var templateSearch = new TemplateSearch( store, config );
                templateSearch.addTag( 'Preexisting' );
                templateSearch.input.setValue( 'My Templ' );
@@ -147,13 +161,17 @@
                assert.equal( templateSearch.input.getValue(), '' );
        } );
 
-       QUnit.test( 'Native browser autocomplete is not used', 1, function ( 
assert ) {
+       QUnit.test( 'Native browser autocomplete is not used', function ( 
assert ) {
+               assert.expect( 1 );
+
                var templateSearch = new TemplateSearch( store, config );
 
                assert.equal( $( templateSearch.$input ).attr( 'autocomplete' 
), 'off' );
        } );
 
-       QUnit.test( 'Well-formed API request yields result', 4, function ( 
assert ) {
+       QUnit.test( 'Well-formed API request yields result', function ( assert 
) {
+               assert.expect( 4 );
+
                config.api = new mw.Api();
                var getStub = sandbox.stub( config.api, 'get' ).withArgs( {
                        action: 'opensearch',
@@ -186,7 +204,9 @@
                } );
        } );
 
-       QUnit.test( 'Empty query does not trigger API request', 3, function ( 
assert ) {
+       QUnit.test( 'Empty query does not trigger API request', function ( 
assert ) {
+               assert.expect( 3 );
+
                config.api = new mw.Api();
                var getStub = sandbox.stub( config.api, 'get' );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/373106
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bce92d112421dbff4924ca8faf8e2f2e9a0b0ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Pablo Grass (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to