assert.strictEqual($('.mw-mlb-image-category > span').length,4,'Only valid categories have an element created for them');
for(i=0;i<categoryNames.length;i++){
categoryName=categoryNames[i];
if(!categoryName||!categoryName.length){
continue;
}
assert.strictEqual($('.mw-mlb-image-category > span').eq(j).find('.comma-container').length,j>0?1:0,'Comma is properly set inside of them');
assert.strictEqual($('.mw-mlb-image-category > span').eq(j).find('a').text(),categoryName,'Category elements have correct text inside of them');
assert.strictEqual($('.mw-mlb-image-category > span').eq(j).find('a').prop('href'),'http://example.net/wiki/Category:'+categoryName,'Category links are set to the right target');
j++;
}
for(i=0;i<3;i++){
assert.ok(!$('.mw-mlb-image-category > span').eq(i).hasClass('extra'),'Categories before the fourth are not marked as extra');
}
assert.ok($('.mw-mlb-image-category > span').eq(3).hasClass('extra'),'Categories after the third are marked as extra');