mediawiki-extensions-Thanks/tests/qunit/test_ext.thanks.mobilediff.js
bwang b6a7933544 Update Thanks extension to use IconButton.js from MobileFrontend
Bug: T340262
Change-Id: Id177ce9a11b2f5e82bd1099613fd7a9c4cde6dc5
2023-07-28 11:17:43 -07:00

16 lines
489 B
JavaScript

QUnit.module( 'Thanks mobilediff', function () {
QUnit.test( 'render button for logged in users', function ( assert ) {
var $container = $( '<div>' );
var $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( '.cdx-button' ).length, 1, 'Thanks button was created.' );
} );
} );