tabs: core ajax unit test - more refactoring, seems IE7 needs a quick setTimeout for the first async test to work on first load

This commit is contained in:
Richard D. Worth 2010-04-02 12:43:22 -04:00
parent 178c3b5b6e
commit 9ba45f3b76

View File

@ -35,21 +35,21 @@ test('ajax', function() {
selected: 2, selected: 2,
load: function() { load: function() {
// spinner: default spinner // spinner: default spinner
start(); setTimeout(function() {
stop(); equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed");
equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed"); equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed");
equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed"); el.tabs('destroy');
el.tabs('destroy'); el.tabs({
el.tabs({ selected: 2,
selected: 2, spinner: '<img src="spinner.gif" alt="">',
spinner: '<img src="spinner.gif" alt="">', load: function() {
load: function() { // spinner: image
// spinner: image equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed");
equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed"); equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed");
equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed"); start();
start(); }
} });
}); }, 1);
} }
}); });