corrade-http-templates – Blame information for rev 57
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
57 | office | 1 | define( [ |
2 | "qunit", |
||
3 | "jquery", |
||
4 | "ui/safe-active-element", |
||
5 | "ui/widgets/button" |
||
6 | ], function( QUnit, $ ) { |
||
7 | |||
8 | QUnit.module( "Button: core" ); |
||
9 | |||
10 | QUnit.test( "Disabled button loses focus", function( assert ) { |
||
11 | var ready = assert.async(); |
||
12 | assert.expect( 2 ); |
||
13 | var element = $( "#button" ).button(); |
||
14 | |||
15 | element.focus(); |
||
16 | setTimeout( function() { |
||
17 | |||
18 | assert.equal( element[ 0 ], $.ui.safeActiveElement( document ), "Button is focused" ); |
||
19 | |||
20 | element.button( "disable" ); |
||
21 | assert.notEqual( element[ 0 ], $.ui.safeActiveElement( document ), "Button has had focus removed" ); |
||
22 | ready(); |
||
23 | } ); |
||
24 | } ); |
||
25 | |||
26 | } ); |