Author: ben
Date: 2007-08-17 14:27:34 -0700 (Fri, 17 Aug 2007)
New Revision: 6130

Modified:
   
openlaszlo/branches/wafflecone/test/components/base/lzunit-basedatacombobox.lzx
Log:
Change 20070817-ben-0 by [EMAIL PROTECTED] on 2007-08-17 14:24:44 PDT
    in /Users/ben/src/svn/openlaszlo/branches/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Extending the test case for basedatacombobox to show some odd 
behavior. 

New Features:

Bugs Fixed:

Technical Reviewer: none
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:
This adds a test that tries to select items by index. It mostly works,
but fails when the index is -1. 

Release Notes:

Details:
    

Tests:
http://localhost:8080/wafflecone/test/components/base/lzunit-basedatacombobox.lzx
 
fails with 
Tests: 5 Failures: 2 Errors: 0
TestFailure: testSelectItemAt failed: Equals:  expected 2 got ''
TestFailure: testBadSelectionIndex failed: False:  expected false got true



Modified: 
openlaszlo/branches/wafflecone/test/components/base/lzunit-basedatacombobox.lzx
===================================================================
--- 
openlaszlo/branches/wafflecone/test/components/base/lzunit-basedatacombobox.lzx 
    2007-08-17 21:02:33 UTC (rev 6129)
+++ 
openlaszlo/branches/wafflecone/test/components/base/lzunit-basedatacombobox.lzx 
    2007-08-17 21:27:34 UTC (rev 6130)
@@ -1,13 +1,15 @@
 <canvas debug="true" title="lzunit-basedatacombobox.lzx" >
   <include href="lzunit" />
   <include href="base/basedatacombobox.lzx"/>
+  <include href="lz/plainfloatinglist.lzx" />  
 
 <!--
   covers-tags: basedatacombobox smoketest
 -->
 
 
-  <class name="simplecombobox" extends="basedatacombobox" width="100">
+  <class name="simplecombobox" extends="basedatacombobox" width="100"
+      menuclassname="plainfloatinglist">
       <attribute name="_cbtext" value="$once{this._text}"/>
       <view width="100%" height="20" focusable="false" bgcolor="#CCCCCC">
           <handler name="onclick">
@@ -36,11 +38,36 @@
     <item value="3" text="C"/>
   </dataset>
   
-  <simplecombobox itemdatapath="ds1:/"/>
+  <simplecombobox x="100" id="scbox" itemdatapath="ds1:/"/>
   
   <TestSuite>
 
     <TestCase>
+        <method name="testSimpleSetGet">
+            scbox.setValue(3);
+            assertEquals(3, scbox.getValue() ); 
+        </method>
+        <method name="testBadSelectionIndex">
+            scbox.setValue(2);            
+            assertEquals( 2, scbox.getValue() ); 
+            scbox._updateSelectionByIndex( -1, true, false); 
+            // Changing the selection to -1 should make the value become 
undefined, or null,
+            // but it shouldn't just keep the same value as before. 
+            assertFalse( 2 == scbox.getValue() ); 
+        </method>
+        
+        <method name="testSelectItemAt">
+            scbox.setValue(3); 
+            scbox.selectItemAt(1);
+            assertEquals(2, scbox.getValue()); 
+        </method>
+        
+        <method name="testBadSelectItemAt">
+            scbox.setValue(3); 
+            scbox.selectItemAt(-1);
+            assertEquals('', scbox.getValue() ); 
+        </method>
+        
     
     </TestCase>
     
@@ -49,7 +76,7 @@
 </canvas>
 
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2006 Laszlo Systems, Inc. All Rights Reserved.                    *
+* Copyright 2006-2007 Laszlo Systems, Inc. All Rights Reserved.                
    *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 <!-- @LZX_VERSION@                                                         -->


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to