expected: ''
}, options );
- QUnit.asyncTest( opt.description, 1, function ( assert ) {
- setTimeout( function () {
- opt.$input.appendTo( '#qunit-fixture' );
+ QUnit.test( opt.description, function ( assert ) {
+ opt.$input.appendTo( '#qunit-fixture' );
- // Simulate pressing keys for each of the sample characters
- addChars( opt.$input, opt.sample );
+ // Simulate pressing keys for each of the sample characters
+ addChars( opt.$input, opt.sample );
- assert.equal(
- opt.$input.val(),
- opt.expected,
- 'New value matches the expected string'
- );
-
- QUnit.start();
- } );
+ assert.equal(
+ opt.$input.val(),
+ opt.expected,
+ 'New value matches the expected string'
+ );
} );
}
} );
QUnit.test( 'Confirm properties and attributes set', function ( assert ) {
- var $el, $elA, $elB;
+ var $el;
$el = $( '<input>' ).attr( 'type', 'text' )
.attr( 'maxlength', '7' )
assert.strictEqual( $el.attr( 'maxlength' ), undefined, 'maxlength attribute removed for limit with callback' );
- $elA = $( '<input>' ).attr( 'type', 'text' )
+ $( '<input>' ).attr( 'type', 'text' )
.addClass( 'mw-test-byteLimit-foo' )
.attr( 'maxlength', '7' )
.appendTo( '#qunit-fixture' );
- $elB = $( '<input>' ).attr( 'type', 'text' )
+ $( '<input>' ).attr( 'type', 'text' )
.addClass( 'mw-test-byteLimit-foo' )
.attr( 'maxlength', '12' )
.appendTo( '#qunit-fixture' );
QUnit.test( 'Trim from insertion when limit exceeded', function ( assert ) {
var $el;
- // Use a new <input /> because the bug only occurs on the first time
+ // Use a new <input> because the bug only occurs on the first time
// the limit it reached (T42850)
$el = $( '<input>' ).attr( 'type', 'text' )
.appendTo( '#qunit-fixture' )
} );
QUnit.test( 'bracketedDevicePixelRatio', function ( assert ) {
- var devicePixelRatio = $.devicePixelRatio();
- assert.equal( typeof devicePixelRatio, 'number', '$.bracketedDevicePixelRatio() returns a number' );
+ var ratio = $.bracketedDevicePixelRatio();
+ assert.equal( typeof ratio, 'number', '$.bracketedDevicePixelRatio() returns a number' );
} );
QUnit.test( 'bracketDevicePixelRatio', function ( assert ) {