2017-08-03 23:05:54 +00:00
|
|
|
( function ( $, mw ) {
|
2015-01-15 00:14:12 +00:00
|
|
|
QUnit.module( 'Thanks mobilediff' );
|
|
|
|
|
|
|
|
QUnit.test( 'render button for logged in users', 1, function ( assert ) {
|
|
|
|
var $container = $( '<div>' ),
|
|
|
|
$user = $( '<div>' ).data( 'user-name', 'jon' )
|
|
|
|
.data( 'revision-id', 1 )
|
|
|
|
.data( 'user-gender', 'male' );
|
|
|
|
|
2017-08-03 23:05:54 +00:00
|
|
|
// eslint-disable-next-line no-underscore-dangle
|
2015-01-15 00:14:12 +00:00
|
|
|
mw.thanks._mobileDiffInit( $user, $container );
|
|
|
|
assert.strictEqual( $container.find( 'button' ).length, 1, 'Thanks button was created.' );
|
|
|
|
} );
|
|
|
|
|
2017-08-03 23:05:54 +00:00
|
|
|
}( jQuery, mediaWiki ) );
|