|
2 | 2 |
|
3 | 3 | module( "tooltip: options" );
|
4 | 4 |
|
5 |
| -test( "items", function() { |
6 |
| - expect( 2 ); |
7 |
| - var element = $( "#qunit-fixture" ).tooltip({ |
8 |
| - items: "#fixture-span" |
9 |
| - }); |
10 |
| - |
11 |
| - var event = $.Event( "mouseenter" ); |
12 |
| - event.target = $( "#fixture-span" )[ 0 ]; |
13 |
| - element.tooltip( "open", event ); |
14 |
| - same( $( "#" + $( "#fixture-span" ).attr( "aria-describedby" ) ).text(), "title-text" ); |
15 |
| - |
16 |
| - // make sure default [title] doesn't get used |
17 |
| - event.target = $( "#tooltipped1" )[ 0 ]; |
18 |
| - element.tooltip( "open", event ); |
19 |
| - same( $( "#tooltipped1" ).attr( "aria-describedby" ), undefined ); |
20 |
| - |
21 |
| - element.tooltip( "destroy" ); |
22 |
| -}); |
23 |
| - |
24 | 5 | test( "content: default", function() {
|
25 | 6 | var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );
|
26 | 7 | same( $( "#" + element.attr( "aria-describedby" ) ).text(), "anchortitle" );
|
@@ -62,4 +43,31 @@ asyncTest( "content: sync + async callback", function() {
|
62 | 43 | }).tooltip( "open" );
|
63 | 44 | });
|
64 | 45 |
|
| 46 | +test( "items", function() { |
| 47 | + expect( 2 ); |
| 48 | + var element = $( "#qunit-fixture" ).tooltip({ |
| 49 | + items: "#fixture-span" |
| 50 | + }); |
| 51 | + |
| 52 | + var event = $.Event( "mouseenter" ); |
| 53 | + event.target = $( "#fixture-span" )[ 0 ]; |
| 54 | + element.tooltip( "open", event ); |
| 55 | + same( $( "#" + $( "#fixture-span" ).attr( "aria-describedby" ) ).text(), "title-text" ); |
| 56 | + |
| 57 | + // make sure default [title] doesn't get used |
| 58 | + event.target = $( "#tooltipped1" )[ 0 ]; |
| 59 | + element.tooltip( "open", event ); |
| 60 | + same( $( "#tooltipped1" ).attr( "aria-describedby" ), undefined ); |
| 61 | + |
| 62 | + element.tooltip( "destroy" ); |
| 63 | +}); |
| 64 | + |
| 65 | +test( "tooltipClass", function() { |
| 66 | + expect( 1 ) |
| 67 | + var element = $( "#tooltipped1" ).tooltip({ |
| 68 | + tooltipClass: "custom" |
| 69 | + }).tooltip( "open" ); |
| 70 | + ok( $( "#" + element.attr( "aria-describedby" ) ).hasClass( "custom" ) ); |
| 71 | +}); |
| 72 | + |
65 | 73 | }( jQuery ) );
|
0 commit comments