mediawiki-extensions-Thanks/tests/qunit/test_ext.thanks.mobilediff.js
jdlrobson a6fa3c4977 Do not use PNG for thanks button
Instead use mediawiki.ui and ResourceLoaderImageModule

Other changes:
* Add gender support to thanks-button-thanked

Depends-On: I0745e112d11026ed59d8daca990b313305cd094a
Bug: T198151
Change-Id: I82ae596330aff8387653c65a6bab5ff729641a80
2018-08-09 17:13:21 +00:00

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 ) );