( function ( $, mw ) { QUnit.module( 'ext.popups' ); QUnit.test( 'render.article.getProcessedHtml', function ( assert ) { QUnit.expect( 7 ); function test ( extract, title, expected ) { assert.equal( mw.popups.render.article.getProcessedHtml( extract, title ), expected ); } test( 'Isaac Newton was born in', 'Isaac Newton', 'Isaac Newton was born in' ); test( 'The C* language not to be confused with C# or C', 'C*', 'The C* language not to be confused with C# or C' ); test( 'Person (was born in Location) is good', 'Person', 'Person is good' ); test( 'Person (was born in Location (at Time)) is good', 'Person', 'Person is good' ); test( 'Person (was born in Location (at Time) ) is good', 'Person', 'Person is good' ); test( 'Brackets ) are funny ( when not used properly', 'Brackets', 'Brackets ) are funny ( when not used properly' ); test( 'Epic XSS is epic', 'Epic XSS', 'Epic XSS <script>alert</script> is epic' ); } ); } ) ( jQuery, mediaWiki );