r13480 - in Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets: js tests
"Matt Barkau" <[email protected]> Mon, 21 Feb 2011 03:35:05 +0000
| Newsgroups | gmane.comp.web.zope.plone.archetypes.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: rmattb
Date: Mon Feb 21 03:35:05 2011
New Revision: 13480
Modified:
Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/js/keywordmultiselect.js
Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/tests/keywordmultiselecttests.js
Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/tests/keywordtests.html
Log:
Prepare more tests for refactoring and correct arrow key issue in previous commit for keyword multiple select enhancement PLIP. Refs #11017.
Modified: Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/js/keywordmultiselect.js
==============================================================================
--- Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/js/keywordmultiselect.js (original)
+++ Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/js/keywordmultiselect.js Mon Feb 21 03:35:05 2011
@@ -254,6 +254,7 @@
// Initialize selected options list
updateSelected.call(multiSelectA);
+ var allOptions = optionsBox.find('LABEL');
// --- Navigation with Mouse ---
// Handle mouse hover of option, both
Modified: Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/tests/keywordmultiselecttests.js
==============================================================================
--- Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/tests/keywordmultiselecttests.js (original)
+++ Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/tests/keywordmultiselecttests.js Mon Feb 21 03:35:05 2011
@@ -16,13 +16,38 @@
num_tags = existing_tags.length;
checked_input_val = $(".optionsBox input:checked").val();
checked_label = $(".optionsBox label.checked").css("backgroundColor");
+
+ module("Tags multiple select enhancement test (refactored without anchor) - PLIP refs #11017");
+
+ test("Handle selection of options test", function(){
+ $(".optionsBox").selectionDevice = 'mouse';
+ $(".optionsBox").selectionElement = $(".optionsBox label:first");
+ $(".optionsBox").selectionOption = $(".optionsBox label:first");
+ expect(1);
+ equals(
+ $(".optionsBox label:first").hasClass('checked'),
+ false,
+ 'Expected hasClass checked false as the result, result was: ' + $(".optionsBox label:first").hasClass('checked')
+ );
+ //mySelectOrDeselectAnOption.selectAnOption($(".optionsBox"));
+// equals(
+// $(".optionsBox label:first").hasClass('checked'),
+// true,
+// 'Expected hasClass checked true as the result, result was: ' + $(".optionsBox label:first").hasClass('checked')
+// );
+ });
+
+ // Now write tests as array of values,
+ // per http://www.adequatelygood.com/2010/7/Writing-Testable-JavaScript
+ // First set includes label class, checkbox state, focus, focus with tab
- module("Keyword multiple select enhancement test - refs PLIP ticket #11017");
+
+ module("Tags multiple select enhancement test (still contains anchor) - PLIP refs #11017");
test("Div existence test", function(){
expect(1);
equals( $(".optionsBox").length,
1,
- 'Expected 1 as the result, result was: ' + $(".optionsBox").length );
+ 'Expected 1 optionsBox div as the result, result was: ' + $(".optionsBox").length );
});
test("Tag dd count test", function(){
expect(1);
Modified: Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/tests/keywordtests.html
==============================================================================
--- Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/tests/keywordtests.html (original)
+++ Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/tests/keywordtests.html Mon Feb 21 03:35:05 2011
@@ -35,6 +35,7 @@
<ol id="qunit-tests"></ol>
<p>---</p>
+ <h2>Manual Test</h2>
<!-- Keyword Widgets -->
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb