mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-02 19:26:24 +00:00
40222517ca
Change-Id: I2e000fd884df9113f1810ec1ca2aa1562a88790b
47 lines
1,008 B
JavaScript
47 lines
1,008 B
JavaScript
( function ( $, mw ) {
|
|
|
|
QUnit.module( 'ext.popups' );
|
|
QUnit.test( 'render.article.getProcessedHtml', function ( assert ) {
|
|
QUnit.expect( 6 );
|
|
|
|
function test ( extract, title, expected ) {
|
|
assert.equal(
|
|
mw.popups.render.article.getProcessedHtml( extract, title ),
|
|
expected
|
|
);
|
|
}
|
|
|
|
test(
|
|
'Isaac Newton was born in', 'Isaac Newton',
|
|
'<b>Isaac Newton</b> was born in'
|
|
);
|
|
|
|
test(
|
|
'The C* language not to be confused with C# or C', 'C*',
|
|
'The <b>C*</b> language not to be confused with C# or C'
|
|
);
|
|
|
|
test(
|
|
'Person (was born in Location) is good', 'Person',
|
|
'<b>Person</b> is good'
|
|
);
|
|
|
|
test(
|
|
'Person (was born in Location (at Time)) is good', 'Person',
|
|
'<b>Person</b> is good'
|
|
);
|
|
|
|
test(
|
|
'Person (was born in Location (at Time) ) is good', 'Person',
|
|
'<b>Person</b> is good'
|
|
);
|
|
|
|
test(
|
|
'Brackets ) are funny ( when not used properly', 'Brackets',
|
|
'<b>Brackets</b> ) are funny ( when not used properly'
|
|
);
|
|
|
|
} );
|
|
|
|
} ) ( jQuery, mediaWiki );
|