mediawiki-extensions-Thanks/tests/qunit/test_ext.thanks.mobilediff.js
Timo Tijhof 0fddc4a258 tests: Remove use of QUnit 1.x setup()/teardown()
No longer supported upstream. Was kept compatible via monkey-patch
in MW core testrunner.js. While at it, also:

* Convert one file from an ad-hoc closure to using the QUnit.module()
  scop, as per <https://api.qunitjs.com/QUnit/module/>.

* Use inline variable declarations per current code conventions.

* Remove needless duplication and description from hardcoded
  assertion message.

Bug: T250045
Change-Id: If556b338c6151108aeebd241b828ccb420c8b857
2022-05-04 10:46:10 +02:00

16 lines
491 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( '.mw-ui-button' ).length, 1, 'Thanks button was created.' );
} );
} );