mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-28 02:00:57 +00:00
parser.test.js: New test for each case, as in modifier.test.js
Explicitly skip the old parser tests as these are not yet working. Change-Id: I1a8fbb9b177acd97db9c42250dd6f5226f879ac0
This commit is contained in:
parent
045b020ca4
commit
6d03608b7c
|
@ -53,11 +53,39 @@ QUnit.test( '#getTimestampParser (at DST change)', function ( assert ) {
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QUnit.test( '#getThreads', function ( assert ) {
|
require( '../cases/comments.json' ).forEach( function ( caseItem ) {
|
||||||
var cases = require( '../cases/comments.json' );
|
|
||||||
|
|
||||||
var fixture = document.getElementById( 'qunit-fixture' );
|
var testName = '#getThreads (' + caseItem.name + ')';
|
||||||
cases.forEach( function ( caseItem ) {
|
|
||||||
|
// Old parser tests are currently broken
|
||||||
|
var skipTests = [
|
||||||
|
'plwiki oldparser',
|
||||||
|
'enwiki oldparser',
|
||||||
|
'ckbwiki oldparser',
|
||||||
|
'arwiki no-paragraph oldparser',
|
||||||
|
'arwiki nbsp-timezone oldparser',
|
||||||
|
'frwiki fr-unsigned oldparser',
|
||||||
|
'itwiki it-unsigned oldparser',
|
||||||
|
'srwiki sr-ec variant',
|
||||||
|
'srwiki sr-el variant',
|
||||||
|
'Accidental dt tags (old parser)',
|
||||||
|
'Single comment, heading',
|
||||||
|
'Single comment with heading',
|
||||||
|
'Manually added signature with LRM',
|
||||||
|
'Signature which is just a selflink',
|
||||||
|
'Comments inside references (old parser)',
|
||||||
|
'Link using fallback 8-bit encoding (invalid UTF-8)',
|
||||||
|
'Fake headings using \';\' syntax in wikitext (<dt> tags)',
|
||||||
|
'Signatures in funny places',
|
||||||
|
'Timestamp format switch behavior'
|
||||||
|
];
|
||||||
|
if ( skipTests.indexOf( caseItem.name ) !== -1 ) {
|
||||||
|
QUnit.skip( testName );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QUnit.test( testName, function ( assert ) {
|
||||||
|
var fixture = document.getElementById( 'qunit-fixture' );
|
||||||
var $dom = mw.template.get( 'test.DiscussionTools', caseItem.dom ).render(),
|
var $dom = mw.template.get( 'test.DiscussionTools', caseItem.dom ).render(),
|
||||||
expected = require( caseItem.expected ),
|
expected = require( caseItem.expected ),
|
||||||
config = require( caseItem.config ),
|
config = require( caseItem.config ),
|
||||||
|
|
Loading…
Reference in a new issue