mediawiki-extensions-Thanks/tests/qunit/test_ext.thanks.mobilediff.js
James D. Forrester 6bf8fd0b11 tests: Make compartible with QUnit 2
Change-Id: I726d7f75e37a759e1b1f6372710cb06f754fc94b
2017-10-23 13:38:11 -07:00

16 lines
512 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( 'button' ).length, 1, 'Thanks button was created.' );
} );
}( jQuery, mediaWiki ) );