mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-12-04 19:28:19 +00:00
a6fa3c4977
Instead use mediawiki.ui and ResourceLoaderImageModule Other changes: * Add gender support to thanks-button-thanked Depends-On: I0745e112d11026ed59d8daca990b313305cd094a Bug: T198151 Change-Id: I82ae596330aff8387653c65a6bab5ff729641a80
16 lines
519 B
JavaScript
16 lines
519 B
JavaScript
( function ( $, mw ) {
|
|
QUnit.module( 'Thanks mobilediff' );
|
|
|
|
QUnit.test( 'render button for logged in users', function ( assert ) {
|
|
var $container = $( '<div>' ),
|
|
$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.' );
|
|
} );
|
|
|
|
}( jQuery, mediaWiki ) );
|