1 QUnit
.module( 'jquery.tabIndex', QUnit
.newMwEnvironment() );
3 QUnit
.test( 'firstTabIndex', 2, function ( assert
) {
6 '<input tabindex="7" />' +
7 '<input tabindex="9" />' +
8 '<textarea tabindex="2">Foobar</textarea>' +
9 '<textarea tabindex="5">Foobar</textarea>' +
12 var $testA
= $( '<div>' ).html( testEnvironment
).appendTo( '#qunit-fixture' );
13 assert
.strictEqual( $testA
.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' );
15 var $testB
= $( '<div>' );
16 assert
.strictEqual( $testB
.firstTabIndex(), null, 'Return null if none available.' );
19 QUnit
.test( 'lastTabIndex', 2, function ( assert
) {
22 '<input tabindex="7" />' +
23 '<input tabindex="9" />' +
24 '<textarea tabindex="2">Foobar</textarea>' +
25 '<textarea tabindex="5">Foobar</textarea>' +
28 var $testA
= $( '<div>' ).html( testEnvironment
).appendTo( '#qunit-fixture' );
29 assert
.strictEqual( $testA
.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' );
31 var $testB
= $( '<div>' );
32 assert
.strictEqual( $testB
.lastTabIndex(), null, 'Return null if none available.' );