Index: tests/functional/fixtures/tabs-iframe.html
===================================================================
--- tests/functional/fixtures/tabs-iframe.html	(revision 1737)
+++ tests/functional/fixtures/tabs-iframe.html	(revision 1737)
@@ -0,0 +1,1 @@
+<iframe id="testtab" src="fixtures/tabs-inframe.html"/>
Index: tests/functional/fixtures/tabs-inframe.html
===================================================================
--- tests/functional/fixtures/tabs-inframe.html	(revision 1737)
+++ tests/functional/fixtures/tabs-inframe.html	(revision 1737)
@@ -0,0 +1,14 @@
+
+<!-- page tabs -->
+<script type="text/javascript" src="../../../admin/js/jquery/jquery.js"></script>
+<script type="text/javascript" src="../../../admin/js/jquery/jquery.pageTabs.js"></script>   
+
+<div id="tab-1" class="multi-part" title="Tab 1">
+	<h3>Tab 1 - content</h3>
+</div>
+<div id="tab-2" class="multi-part" title="Tab 2">
+	<h3>Tab 2 - content</h3>
+</div>
+<div id="tab-3" class="multi-part" title="Tab 3">
+	<h3>Tab 3 - content</h3>
+</div>
Index: tests/functional/fixtures/tabs.html
===================================================================
--- tests/functional/fixtures/tabs.html	(revision 1737)
+++ tests/functional/fixtures/tabs.html	(revision 1737)
@@ -0,0 +1,13 @@
+
+<!-- page tabs -->
+<script type="text/javascript" src="../../admin/js/jquery/jquery.pageTabs.js"></script>   
+
+<div id="tab-1" class="multi-part" title="Tab 1">
+	<h3>Tab 1 - content</h3>
+</div>
+<div id="tab-2" class="multi-part" title="Tab 2">
+	<h3>Tab 2 - content</h3>
+</div>
+<div id="tab-3" class="multi-part" title="Tab 3">
+	<h3>Tab 3 - content</h3>
+</div>
Index: tests/functional/index.html
===================================================================
--- tests/functional/index.html	(revision 1724)
+++ tests/functional/index.html	(revision 1737)
@@ -34,4 +34,8 @@
     <script type="text/javascript" src="spec/common.js"></script>
     <script type="text/javascript" src="spec/media_manager.js"></script>
+    
+    <!-- page tabs -->
+    <script type="text/javascript" src="spec/page_tabs.js"></script>
+    
   </head>
   <body>
Index: tests/functional/spec/page_tabs.js
===================================================================
--- tests/functional/spec/page_tabs.js	(revision 1737)
+++ tests/functional/spec/page_tabs.js	(revision 1737)
@@ -0,0 +1,92 @@
+describe("tabs method (admin/js/pageTabs.js)", function() {
+	
+	it("Construct tabs using div content", function() {
+		
+		loadFixtures('tabs.html');
+		
+		expect($('#tab-1')).toBeVisible();
+		expect($('#tab-2')).toBeVisible();
+		expect($('#tab-3')).toBeVisible();
+		
+		expect($('.part-tabs')).not.toExist();
+		
+		$.pageTabs('tab-1');
+		
+		expect($('#tab-1')).toBeVisible();
+		expect($('#tab-2')).not.toBeVisible();
+		expect($('#tab-3')).not.toBeVisible();
+		
+		expect($('.part-tabs ul li#part-tabs-tab-1 a[href=#tab-1]')).toExist();
+		expect($('.part-tabs ul li#part-tabs-tab-2 a[href=#tab-2]')).toExist();
+		expect($('.part-tabs ul li#part-tabs-tab-3 a[href=#tab-3]')).toExist();
+	
+		expect($('.part-tabs ul li#part-tabs-tab-1')).toHaveClass('part-tabs-active');
+		
+	});
+	
+	it("Change tabs when changing the hash", function() {
+		
+		runs(function() {        
+            loadFixtures('tabs-iframe.html');
+        });
+		
+		waitsFor(function() {
+            return $("#testtab").contents().find('#tab-3').get(0);
+        }, 10000);
+		
+		runs(function() {
+			f$ = $("#testtab").get(0).contentWindow.$;
+			f$.pageTabs('tab-1');
+
+			expect(f$('#tab-1').get(0)).toBeVisible();
+			expect(f$('#tab-2').get(0)).not.toBeVisible();
+			
+			expect(f$('.part-tabs ul li#part-tabs-tab-1').get(0)).toHaveClass('part-tabs-active');
+			expect(f$('.part-tabs ul li#part-tabs-tab-2').get(0)).not.toHaveClass('part-tabs-active');
+
+            $("#testtab").attr('src', $("#testtab").attr('src')+'#tab-2');
+        });
+		
+		waitsFor(function() {
+			f$ = $("#testtab").get(0).contentWindow.$;
+            return f$('#tab-1').is(':not(:visible)');
+        }, 10000);
+		
+		runs(function() {
+			f$ = $("#testtab").get(0).contentWindow.$;
+			
+    		expect(f$('#tab-2').get(0)).toBeVisible();
+
+			expect(f$('.part-tabs ul li#part-tabs-tab-1').get(0)).not.toHaveClass('part-tabs-active');
+			expect(f$('.part-tabs ul li#part-tabs-tab-2').get(0)).toHaveClass('part-tabs-active');
+			
+        });
+		
+	});
+	
+	it("Load the correct tab with the correct hash", function() {
+		
+		runs(function() {        
+            loadFixtures('tabs-iframe.html');
+            $("#testtab").attr('src', $("#testtab").attr('src')+'#tab-3');
+        });
+		
+		waitsFor(function() {
+			cond1 = $("#testtab").attr('src').split('#')[1] != '';
+			cond2 = $("#testtab").contents().find('#tab-3').get(0);
+            return cond1 && cond2;
+        }, 10000);
+		
+		runs(function() {
+			f$ = $("#testtab").get(0).contentWindow.$;
+			f$.pageTabs('tab-1');
+			
+			expect(f$('#tab-1').get(0)).not.toBeVisible();
+			expect(f$('#tab-3').get(0)).toBeVisible();
+			
+			expect(f$('.part-tabs ul li#part-tabs-tab-1').get(0)).not.toHaveClass('part-tabs-active');
+			expect(f$('.part-tabs ul li#part-tabs-tab-3').get(0)).toHaveClass('part-tabs-active');
+        });
+		
+	});
+});
