equals(el.children('div').length, el.find('> ul > li').length, 'After creation, number of panels should be equal to number of tabs');
el.tabs('add', '/ajax_html_echo', 'Test');
equals(el.children('div').length, el.find('> ul > li').length, 'After add, number of panels should be equal to number of tabs');
+});
+
+test('length', function() {
+ expect(1);
+ el = $('#tabs1').tabs();
+ equals(el.tabs('length'), $('ul a', el).length, ' should return length');
});
}( jQuery ) );
ok(false, "missing test - untested code is broken code.");
});
-test('length', function() {
- expect(1);
-
- el = $('#tabs1').tabs();
- equals(el.tabs('length'), $('ul a', el).length, ' should return length');
-});
-
})(jQuery);
el = $('<div><ul><li><a href="#tab">Tab</a></li></ul><div id="tab"></div></div>')
.appendTo('#main').tabs();
-
+
equals($('a', el).data('load.tabs'), undefined, 'should not create ajax tab');
});
expect(1);
el = $('#tabs6').tabs();
- equals(el.tabs( "length" ), 2, 'should contain 2 tab');
+ equals(el.data("tabs").anchors.length, 2, 'should contain 2 tab');
});
url: function( index, url ) {
this.anchors.eq( index ).data( "load.tabs", url );
return this;
- },
-
- length: function() {
- return this.anchors.length;
}
});
};
}( jQuery, jQuery.ui.tabs.prototype ) );
+ // length method
+ (function( $, prototype ) {
+ prototype.length = function() {
+ return this.anchors.length;
+ };
+ }( jQuery, jQuery.ui.tabs.prototype ) );
}
})( jQuery );