2022-05-04 08:43:32 +00:00
|
|
|
QUnit.module( 'Thanks mobilediff', function () {
|
2015-01-15 00:14:12 +00:00
|
|
|
|
2017-10-23 20:38:11 +00:00
|
|
|
QUnit.test( 'render button for logged in users', function ( assert ) {
|
2022-05-04 08:43:32 +00:00
|
|
|
var $container = $( '<div>' );
|
|
|
|
var $user = $( '<div>' )
|
|
|
|
.data( 'user-name', 'jon' )
|
|
|
|
.data( 'revision-id', 1 )
|
|
|
|
.data( 'user-gender', 'male' );
|
2015-01-15 00:14:12 +00:00
|
|
|
|
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
|
|
|
} );
|
|
|
|
|
2022-05-04 08:43:32 +00:00
|
|
|
} );
|