2017-08-03 23:05:54 +00:00
|
|
|
( function ( $, mw ) {
|
2015-01-15 00:14:12 +00:00
|
|
|
QUnit.module( 'Thanks mobilediff' );
|
|
|
|
|
2017-10-23 20:38:11 +00:00
|
|
|
QUnit.test( 'render button for logged in users', function ( assert ) {
|
2015-01-15 00:14:12 +00:00
|
|
|
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 ) );
|