aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKlaus Hartl <klaus.hartl@googlemail.com>2009-02-18 21:44:34 +0000
committerKlaus Hartl <klaus.hartl@googlemail.com>2009-02-18 21:44:34 +0000
commit07809340c843f9cb6c0f8ad2d8d8746970ff09c9 (patch)
treeecbcc5930d8d46b8370bb51d7066c92c5da25098 /tests
parentc748a543c4faa4d116af5b830cd2fdf126e41a10 (diff)
downloadjquery-ui-07809340c843f9cb6c0f8ad2d8d8746970ff09c9.tar.gz
jquery-ui-07809340c843f9cb6c0f8ad2d8d8746970ff09c9.zip
Tabs: solved spinner issues and ajax loading not being stopped when selecting a static page tab, fixes #4109, #3929
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/tabs/spinner.gifbin0 -> 2530 bytes
-rw-r--r--tests/unit/tabs/tabs.html12
-rw-r--r--tests/unit/tabs/tabs_core.js29
-rw-r--r--tests/unit/tabs/tabs_defaults.js2
-rw-r--r--tests/unit/tabs/test.html1
5 files changed, 37 insertions, 7 deletions
diff --git a/tests/unit/tabs/spinner.gif b/tests/unit/tabs/spinner.gif
new file mode 100644
index 000000000..85b99d46b
--- /dev/null
+++ b/tests/unit/tabs/spinner.gif
Binary files differ
diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html
index d9cb4d138..69cd8f481 100644
--- a/tests/unit/tabs/tabs.html
+++ b/tests/unit/tabs/tabs.html
@@ -24,9 +24,9 @@
<div id="main">
<div id="tabs1">
<ul>
- <li><a href="#fragment-1">1</a></li>
- <li><a href="#fragment-2">2</a></li>
- <li><a href="#fragment-3">3</a></li>
+ <li><a href="#fragment-1"><span>1</span></a></li>
+ <li><a href="#fragment-2"><span>2</span></a></li>
+ <li><a href="#fragment-3"><span>3</span></a></li>
</ul>
<div id="fragment-1"></div>
<div id="fragment-2"></div>
@@ -34,9 +34,9 @@
</div>
<div id="tabs2">
<ul>
- <li><a href="#colon:test">1</a></li>
- <li><a href="#inline-style">2</a></li>
- <li><a href="test.html#test">1</a></li>
+ <li><a href="#colon:test"><span>1</span></a></li>
+ <li><a href="#inline-style"><span>2</span></a></li>
+ <li><a href="test.html#test"><span>3</span></a></li>
</ul>
<div id="colon:test"></div>
<div style="height: 300px;" id="inline-style"></div>
diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js
index ba5f3d014..79e95ea41 100644
--- a/tests/unit/tabs/tabs_core.js
+++ b/tests/unit/tabs/tabs_core.js
@@ -7,4 +7,33 @@ var el;
module("tabs: core");
+test('ajax', function() {
+ expect(4);
+ stop();
+
+ el = $('#tabs2');
+
+ el.tabs({
+ selected: 2,
+ load: function() {
+ // spinner: default spinner
+ 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");
+ el.tabs('destroy');
+ el.tabs({
+ selected: 2,
+ spinner: '<img src="spinner.gif" alt="">',
+ load: function() {
+ // 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).html(), '3', "should restore tab label after spinner is removed");
+ start();
+ }
+ });
+ }
+ });
+
+});
+
+
})(jQuery);
diff --git a/tests/unit/tabs/tabs_defaults.js b/tests/unit/tabs/tabs_defaults.js
index 306e8c86e..f5a583e2c 100644
--- a/tests/unit/tabs/tabs_defaults.js
+++ b/tests/unit/tabs/tabs_defaults.js
@@ -12,7 +12,7 @@ var tabs_defaults = {
fx: null,
idPrefix: 'ui-tabs-',
panelTemplate: '<div></div>',
- spinner: 'Loading&#8230;',
+ spinner: '<em>Loading&#8230;</em>',
tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>'
};
diff --git a/tests/unit/tabs/test.html b/tests/unit/tabs/test.html
new file mode 100644
index 000000000..cd59e6415
--- /dev/null
+++ b/tests/unit/tabs/test.html
@@ -0,0 +1 @@
+<p>&#8230;content loaded via Ajax.</p> \ No newline at end of file