GsDevKit / glassdb

Automatically exported from code.google.com/p/glassdb
0 stars 0 forks source link

nconsistency Seaside / SeasideTesting #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
After crash recovery (thanks again, guys) I had the time 
to spend on some of my misbehaviour of my application. 
Somehow I wrote tests for a lot of stuff that is green in 
the testrunner but fails on the web application side and 
vice versa. 

The reason is that input fields behave differently in seaside 
and seaside testing. If I submit an empty text field via the 
browser I get an empty string as return value. 
Doing the same by issuing a test I get nil. If I remember 
correct I always got nil back if the input field was empty. 

Atached you find an application and a test that demonstrates 
it. 

! WHSimpleComponent.gs --------------------------- 
doit 

WAComponent subclass: 'WHSimpleComponent' 

    instVarNames: #( string) 

    classVars: #() 

    classInstVars: #( challenge) 

    poolDictionaries: #[] 

    inDictionary: '' 

    category: 'Whooka-Bugs' 

% 

! Remove existing behavior from WHSimpleComponent 

doit 

WHSimpleComponent removeAllMethods. 

WHSimpleComponent class removeAllMethods. 

% 

! ------------------- Class methods for WHSimpleComponent 

! ------------------- Instance methods for WHSimpleComponent 

category: 'as yet unclassified' 

method: WHSimpleComponent 

renderContentOn: html 

    html text: 'string is ', (self string ifNil: [ 'nil' ] ifNotNil: [ 'not
nil' ]). 

    html form with: [ 

        html textInput on: #string of: self. 

        html submitButton.  

    ] 

% 

category: 'as yet unclassified' 

method: WHSimpleComponent 

string 

    ^ string 

% 

category: 'as yet unclassified' 

method: WHSimpleComponent 

string: aString 

    string := aString 

% 

doit 

WHSimpleComponent category: 'Whooka-Bugs' 

% 

! WHSimpleTest.gs --------------------------- 
doit 

SCComponentTestCase subclass: 'WHSimpleTest' 

    instVarNames: #() 

    classVars: #() 

    classInstVars: #() 

    poolDictionaries: #[] 

    inDictionary: '' 

    category: 'Whooka-Bugs' 

% 

! Remove existing behavior from WHSimpleTest 

doit 

WHSimpleTest removeAllMethods. 

WHSimpleTest class removeAllMethods. 

% 

! ------------------- Class methods for WHSimpleTest 

! ------------------- Instance methods for WHSimpleTest 

category: 'as yet unclassified' 

method: WHSimpleTest 

setUp 

    self newApplicationWithRootClass: WHSimpleComponent. 

    self establishSession    

% 

category: 'as yet unclassified' 

method: WHSimpleTest 

testString 

    | form | 

    form := self lastResponse forms first. 

    self submitForm: form pressingButton: form buttons first. 

    self assert: self component string isNil 

% 

doit 

WHSimpleTest category: 'Whooka-Bugs' 

% 

Original issue reported on code.google.com by henrichs...@gmail.com on 24 Mar 2010 at 7:43

GoogleCodeExporter commented 9 years ago

Original comment by henrichs...@gmail.com on 27 Aug 2010 at 6:06

GoogleCodeExporter commented 9 years ago

Original comment by henrichs...@gmail.com on 31 Aug 2010 at 11:01

GoogleCodeExporter commented 9 years ago

Original comment by henrichs...@gmail.com on 31 Aug 2010 at 11:02

GoogleCodeExporter commented 9 years ago

Original comment by henrichs...@gmail.com on 8 Feb 2011 at 9:08