@@ -394,10 +394,15 @@ test( "select", function() {
394
394
module ( "tabs (deprecated): methods" ) ;
395
395
396
396
test ( "add" , function ( ) {
397
- expect ( 27 ) ;
397
+ expect ( 28 ) ;
398
398
399
399
var tab , anchor ,
400
400
element = $ ( "#tabs1" ) . tabs ( ) ;
401
+
402
+ function stripLeadingSlash ( str ) {
403
+ return str . substr ( str . charAt ( 0 ) === "/" ? 1 : 0 ) ;
404
+ }
405
+
401
406
state ( element , 1 , 0 , 0 ) ;
402
407
403
408
// add without index
@@ -411,7 +416,8 @@ test( "add", function() {
411
416
tab = element . find ( ".ui-tabs-nav li" ) . last ( ) ;
412
417
anchor = tab . find ( "a" ) ;
413
418
equal ( tab . text ( ) , "New" , "label" ) ;
414
- equal ( anchor . attr ( "href" ) , "#new" , "href" ) ;
419
+ equal ( stripLeadingSlash ( anchor [ 0 ] . pathname ) , stripLeadingSlash ( location . pathname ) , "href pathname" ) ;
420
+ equal ( anchor [ 0 ] . hash , "#new" , "href hash" ) ;
415
421
equal ( anchor . attr ( "aria-controls" ) , "new" , "aria-controls" ) ;
416
422
ok ( ! tab . hasClass ( "ui-state-hover" ) , "not hovered" ) ;
417
423
anchor . simulate ( "mouseover" ) ;
@@ -430,7 +436,9 @@ test( "add", function() {
430
436
tab = element . find ( ".ui-tabs-nav li" ) . eq ( 1 ) ;
431
437
anchor = tab . find ( "a" ) ;
432
438
equal ( tab . text ( ) , "New Remote" , "label" ) ;
433
- equal ( anchor . attr ( "href" ) , "data/test.html" , "href" ) ;
439
+ equal ( stripLeadingSlash ( stripLeadingSlash (
440
+ anchor [ 0 ] . pathname . replace ( stripLeadingSlash ( location . pathname ) . split ( "/" ) . slice ( 0 , - 1 ) . join ( "/" ) , "" )
441
+ ) ) , "data/test.html" , "href" ) ;
434
442
ok ( / ^ u i - t a b s - \d + $ / . test ( anchor . attr ( "aria-controls" ) ) , "aria controls" ) ;
435
443
ok ( ! tab . hasClass ( "ui-state-hover" ) , "not hovered" ) ;
436
444
anchor . simulate ( "mouseover" ) ;
@@ -573,6 +581,10 @@ asyncTest( "abort", function() {
573
581
start ( ) ;
574
582
} ) ;
575
583
} ) ;
584
+ // prevent IE from caching the request, so that it won't resolve before we call abort
585
+ element . find ( ".ui-tabs-nav li:eq(2) a" ) . attr ( "href" , function ( href ) {
586
+ return href + "?" + ( + new Date ( ) ) ;
587
+ } ) ;
576
588
element . tabs ( "option" , "active" , 2 ) ;
577
589
element . tabs ( "abort" ) ;
578
590
} ) ;
0 commit comments