mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-12-03 19:06:09 +00:00
0fddc4a258
No longer supported upstream. Was kept compatible via monkey-patch in MW core testrunner.js. While at it, also: * Convert one file from an ad-hoc closure to using the QUnit.module() scop, as per <https://api.qunitjs.com/QUnit/module/>. * Use inline variable declarations per current code conventions. * Remove needless duplication and description from hardcoded assertion message. Bug: T250045 Change-Id: If556b338c6151108aeebd241b828ccb420c8b857
16 lines
491 B
JavaScript
16 lines
491 B
JavaScript
QUnit.module( 'Thanks mobilediff', function () {
|
|
|
|
QUnit.test( 'render button for logged in users', function ( assert ) {
|
|
var $container = $( '<div>' );
|
|
var $user = $( '<div>' )
|
|
.data( 'user-name', 'jon' )
|
|
.data( 'revision-id', 1 )
|
|
.data( 'user-gender', 'male' );
|
|
|
|
// eslint-disable-next-line no-underscore-dangle
|
|
mw.thanks._mobileDiffInit( $user, $container );
|
|
assert.strictEqual( $container.find( '.mw-ui-button' ).length, 1, 'Thanks button was created.' );
|
|
} );
|
|
|
|
} );
|