Skip to content

Commit 302ad62

Browse files
committed
Tooltip: Added some tests.
1 parent e77fcaa commit 302ad62

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

tests/unit/tooltip/tooltip_core.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
module( "tooltip: core" );
44

5+
test( "markup structure", function() {
6+
expect( 6 );
7+
var element = $( "#tooltipped1" ).tooltip(),
8+
tooltip = $( ".ui-tooltip" );
59

10+
equal( element.attr( "aria-describedby" ), undefined, "no aria-describedby on init" );
11+
equal( tooltip.length, 0, "no tooltip on init" );
12+
13+
element.tooltip( "open" );
14+
tooltip = $( "#" + element.attr( "aria-describedby" ) );
15+
equal( tooltip.length, 1, "tooltip exists" );
16+
ok( tooltip.hasClass( "ui-tooltip" ), "tooltip is .ui-tooltip" );
17+
equal( tooltip.length, 1, ".ui-tooltip exists" );
18+
equal( tooltip.find( ".ui-tooltip-content" ).length, 1,
19+
".ui-tooltip-content exists" );
20+
});
21+
22+
test( "accessibility", function() {
23+
// TODO: add tests
24+
});
625

726
}( jQuery ) );

tests/unit/tooltip/tooltip_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test( "items", function() {
1616
});
1717

1818
test( "content: default", function() {
19-
var element = $( "#tooltipped1" ).tooltip().tooltip("open");
19+
var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );
2020
same( $( "#" + element.attr( "aria-describedby" ) ).text(), "anchortitle" );
2121
});
2222

0 commit comments

Comments
 (0)