2018-11-12 19:22:46 +00:00
|
|
|
( function () {
|
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 );
|
2018-06-13 23:44:50 +00:00
|
|
|
assert.strictEqual( $container.find( '.mw-ui-button' ).length, 1, 'Thanks button was created.' );
|
2015-01-15 00:14:12 +00:00
|
|
|
} );
|
|
|
|
|
2018-11-12 19:22:46 +00:00
|
|
|
}() );
|