r1063 - in branches/experimental: a11y/tests tabbable/tests

r1063 - in branches/experimental: a11y/tests tabbable/tests


Author: scott.gonzalez
Date: Mon Dec 8 18:54:57 2008
New Revision: 1063
Added:
branches/experimental/a11y/tests/
branches/experimental/a11y/tests/aria.html
branches/experimental/a11y/tests/aria.js
Modified:
branches/experimental/tabbable/tests/core.html
branches/experimental/tabbable/tests/core.js
Log:
Moved tests for ARIA helper methods out of tabbable code.
Added: branches/experimental/a11y/tests/aria.html
==============================================================================
--- (empty file)
+++ branches/experimental/a11y/tests/aria.html    Mon Dec 8 18:54:57 2008
@@ -0,0 +1,35 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <title>ARIA Helper Test Suite</title>
+    
+    <link rel="stylesheet" href="../../tests/qunit/testsuite.css"
type="text/css" media="screen">
+    
+    <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
+    <script type="text/javascript" src="../aria.js"></script>
+    
+    <script type="text/javascript"
src="../../tests/qunit/testrunner.js"></script>
+    <script type="text/javascript" src="aria.js"></script>
+    
+    <style type="text/css">
+        html { border: 0; }
+    </style>
+</head>
+<body class="flora">
+
+<h1 id="header">ARIA Helper Test Suite</h1>
+<h2 id="banner"></h2>
+<h2 id="userAgent"></h2>
+
+<ol id="tests"></ol>
+
+<div id="main" style="position: absolute; top: -10000px; border: 1px solid
black; padding: 10px; margin: 10px;">
+    <div id="wrap7">
+        <div class="label-1"></div>
+        <div id="label-1"></div>
+        <div id="div7-1"></div>7
+    </div>
+</div>
+
+</body>
+</html>
Added: branches/experimental/a11y/tests/aria.js
==============================================================================
--- (empty file)
+++ branches/experimental/a11y/tests/aria.js    Mon Dec 8 18:54:57 2008
@@ -0,0 +1,24 @@
+/*
+ * core unit tests
+ */
+(function($) {
+
+module("aria");
+test("label tests", function(){
+    expect(4);
+    
+    $('#div7-1')
+        .labelWith('div.label-1');
+    var id = $('div.label-1').attr('id');
+    
+    ok(id, 'add new id');
+    ok(($('#div7-1').attr('aria-labelledby') === id), 'labeld with added id');
+    
+    $('#div7-1')
+        .labelWith('#label-1');
+    
+    ok(($('#div7-1').attr('aria-labelledby') === 'label-1'), 'labeld with
existing id');
+    ok(($('#label-1').attr('id') === 'label-1'), 'existing id of label not
changed');
+});
+
+})(jQuery);
Modified: branches/experimental/tabbable/tests/core.html
==============================================================================
--- branches/experimental/tabbable/tests/core.html    (original)
+++ branches/experimental/tabbable/tests/core.html    Mon Dec 8 18:54:57 2008
@@ -89,14 +89,6 @@
        <a href="#" id="anchor6-4" tabindex="foo">anchor</a>
    </div>
    
-    
-    <div id="wrap7">
-        <div class="label-1"></div>
-        <div id="label-1"></div>
-        <div id="div7-1"></div>7
-    </div>
-    
-    
</div>
</body>
Modified: branches/experimental/tabbable/tests/core.js
==============================================================================
--- branches/experimental/tabbable/tests/core.js    (original)
+++ branches/experimental/tabbable/tests/core.js    Mon Dec 8 18:54:57 2008
@@ -142,22 +142,4 @@
    ok($('#anchor6-4').is(':focusable'), 'a, tabindex foo');
});
-module("little label helper");
-test("label tests", function(){
-    expect(4);
-    
-    $('#div7-1')
-        .labelWith('div.label-1');
-    var id = $('div.label-1').attr('id');
-    
-    ok(id, 'add new id');
-    ok(($('#div7-1').attr('aria-labelledby') === id), 'labeld with added id');
-    
-    $('#div7-1')
-        .labelWith('#label-1');
-    
-    ok(($('#div7-1').attr('aria-labelledby') === 'label-1'), 'labeld with
existing id');
-    ok(($('#label-1').attr('id') === 'label-1'), 'existing id of label not
changed');
-});
-
})(jQuery);