QUnit: Remove all code for counting tests

Change-Id: Ifc20282a4da1aed9be2a9215c13f9a4e3e30168f
This commit is contained in:
Ed Sanders 2017-04-28 16:48:52 +01:00
parent 323f2479ea
commit 381f143a27
13 changed files with 4 additions and 51 deletions

View file

@ -39,7 +39,7 @@ QUnit.test( 'getRenderedContents', function ( assert ) {
'd<span rel="ve:Alien" class="ve-ce-focusableNode" contenteditable="false">e</span>' +
'</b>'
} ];
QUnit.expect( cases.length );
for ( i = 0, len = cases.length; i < len; i++ ) {
doc = new ve.dm.Document( ve.dm.example.preprocessAnnotations( cases[ i ].data ) );
$wrapper = $( new ve.ce.ParagraphNode( doc.getDocumentNode().getChildren()[ 0 ] ).getRenderedContents() );

View file

@ -53,8 +53,6 @@ QUnit.test( 'handleLinearDelete', function ( assert ) {
}
];
QUnit.expect( cases.length * 2 );
for ( i = 0; i < cases.length; i++ ) {
ve.test.utils.runSurfaceHandleSpecialKeyTest(
assert, cases[ i ].htmlOrDoc, cases[ i ].rangeOrSelection, cases[ i ].keys,
@ -64,7 +62,7 @@ QUnit.test( 'handleLinearDelete', function ( assert ) {
} );
QUnit.test( 'beforePaste/afterPaste', function ( assert ) {
var i, expected = 0,
var i,
cases = [
{
documentHtml: '<p></p>',
@ -77,19 +75,6 @@ QUnit.test( 'beforePaste/afterPaste', function ( assert ) {
}
];
for ( i = 0; i < cases.length; i++ ) {
if ( cases[ i ].expectedOps ) {
expected++;
}
if ( cases[ i ].expectedRangeOrSelection ) {
expected++;
}
if ( cases[ i ].expectedHtml ) {
expected++;
}
}
QUnit.expect( expected );
for ( i = 0; i < cases.length; i++ ) {
ve.test.utils.runSurfacePasteTest(
assert, cases[ i ].documentHtml,

View file

@ -102,7 +102,7 @@ QUnit.test( 'getWikitext', function ( assert ) {
},
wikitext: '{{foo|bar=[[baz|quux]]}}'
} ];
QUnit.expect( cases.length );
for ( i = 0; i < cases.length; i++ ) {
node = new ve.dm.MWTransclusionNode(
{ type: 'mwTransclusion', attributes: { mw: cases[ i ].mw } }

View file

@ -11,8 +11,6 @@ QUnit.test( 'getModelFromDom', function ( assert ) {
var msg, caseItem,
cases = ve.dm.mwExample.domToDataCases;
QUnit.expect( ve.test.utils.countGetModelFromDomTests( cases ) );
for ( msg in cases ) {
caseItem = ve.copy( cases[ msg ] );
if ( caseItem.mwConfig ) {
@ -27,8 +25,6 @@ QUnit.test( 'getDomFromModel', function ( assert ) {
var msg, caseItem,
cases = ve.dm.mwExample.domToDataCases;
QUnit.expect( 3 * Object.keys( cases ).length );
for ( msg in cases ) {
caseItem = ve.copy( cases[ msg ] );
if ( caseItem.mwConfig ) {

View file

@ -12,7 +12,6 @@ QUnit.module( 've.dm.Document (MW)', ve.test.utils.mwEnvironment );
// FIXME runner copypasted from core, use data provider
QUnit.test( 'getRelativeRange (mwBlockImage / mwInlineImage)', function ( assert ) {
var documentModel, i, j,
expectCount = 0,
store = new ve.dm.IndexValueStore(),
storeItems = [
ve.dm.mwExample.MWBlockImage.storeItems,
@ -237,7 +236,6 @@ QUnit.test( 'getRelativeRange (mwBlockImage / mwInlineImage)', function ( assert
for ( i = 0; i < tests.length; i++ ) {
documentModel = new ve.dm.Document( new ve.dm.ElementLinearData( store, tests[ i ].data ) );
for ( j = 0; j < tests[ i ].cases.length; j++ ) {
expectCount++;
assert.equalRange(
documentModel.getRelativeRange(
tests[ i ].cases[ j ].given,
@ -252,5 +250,4 @@ QUnit.test( 'getRelativeRange (mwBlockImage / mwInlineImage)', function ( assert
);
}
}
QUnit.expect( expectCount );
} );

View file

@ -11,7 +11,6 @@ QUnit.module( 've.dm.MWImageModel', ve.test.utils.mwEnvironment );
QUnit.test( 'Create and manipulate image nodes', function ( assert ) {
var i, imageType, imageModel, value, result, expected, expectedAlignment, method, dir, dummyDoc,
expect = 0,
imageNode = {},
images = {
mwInlineImage: {
@ -116,21 +115,6 @@ QUnit.test( 'Create and manipulate image nodes', function ( assert ) {
}
};
for ( imageType in images ) {
// Type test
expect++;
for ( i = 0; i < images[ imageType ].tests.length; i++ ) {
// Method tests
expect += Object.keys( images[ imageType ].tests[ i ].results.expect ).length;
if ( images[ imageType ].tests[ i ].results.position ) {
// Position test
expect++;
}
}
}
QUnit.expect( expect );
for ( imageType in images ) {
// Create the node
imageNode[ imageType ] = ve.dm.MWImageModel.static.createImageNode(

View file

@ -55,8 +55,6 @@ QUnit.test( 'toDataElement', function ( assert ) {
converter.internalList = doc.getInternalList();
converter.contextStack = [];
QUnit.expect( cases.length );
for ( i = 0, l = cases.length; i < l; i++ ) {
assert.deepEqual( ve.dm.MWInternalLinkAnnotation.static.toDataElement( [ cases[ i ].element ], converter ), cases[ i ].expected, cases[ i ].msg );
}
@ -102,8 +100,6 @@ QUnit.test( 'getFragment', function ( assert ) {
}
];
QUnit.expect( cases.length );
for ( i = 0, l = cases.length; i < l; i++ ) {
assert.deepEqual( ve.dm.MWInternalLinkAnnotation.static.getFragment( cases[ i ].original ), cases[ i ].expected, cases[ i ].msg );
}

View file

@ -9,7 +9,7 @@ QUnit.module( 've.dm.SurfaceFragment (MW)', ve.test.utils.mwEnvironment );
/* Tests */
QUnit.test( 'isolateAndUnwrap (MWheading)', 2, function ( assert ) {
QUnit.test( 'isolateAndUnwrap (MWheading)', function ( assert ) {
ve.test.utils.runIsolateTest( assert, 'mwHeading', new ve.Range( 12, 20 ), function ( data ) {
data.splice( 11, 0, { type: '/list' } );
data.splice( 12, 1 );

View file

@ -173,7 +173,6 @@ QUnit.test( 'compatibility', function ( assert ) {
blacklist: mw.libs.ve.blacklist
};
QUnit.expect( cases.length );
for ( i = 0; i < cases.length; i++ ) {
profile = $.client.profile( { userAgent: cases[ i ].userAgent, platform: '' } );
matches = [];

View file

@ -69,7 +69,6 @@ QUnit.test( 'convert (MW-specific types)', function ( assert ) {
}
];
QUnit.expect( ve.test.utils.countActionTests( cases ) );
for ( i = 0; i < cases.length; i++ ) {
ve.test.utils.runActionTest(
'format', assert, cases[ i ].html || ve.dm.example.isolationHtml, false, 'convert',

View file

@ -121,7 +121,6 @@ QUnit.test( 'MW autolink', function ( assert ) {
}
];
QUnit.expect( ve.test.utils.countActionTests( cases ) );
for ( i = 0; i < cases.length; i++ ) {
ve.test.utils.runActionTest(
'link', assert, cases[ i ].html, false, cases[ i ].method, [], cases[ i ].rangeOrSelection, cases[ i ].msg,

View file

@ -230,7 +230,6 @@ QUnit.test( 'convert', function ( assert ) {
}
];
QUnit.expect( cases.length * 2 );
for ( i = 0; i < cases.length; i++ ) {
ve.test.utils.runWikitextStringHandlerTest(
assert, this.server, cases[ i ].pasteString, cases[ i ].pasteType, cases[ i ].parsoidResponse,

View file

@ -36,7 +36,6 @@ QUnit.test( 'paste', function ( assert ) {
}
];
QUnit.expect( cases.length );
for ( i = 0; i < cases.length; i++ ) {
runUrlStringHandlerTest( assert, cases[ i ].pasteString, cases[ i ].pasteHtml, cases[ i ].pasteType, cases[ i ].expectedData, cases[ i ].msg );
}