Opened 12 years ago

Closed 11 years ago

#6943 closed defect (fixed)

[patch] Regression in [13752]: assert failed in Form test

Reported by: haysmark Owned by: haysmark
Priority: high Milestone: 1.2
Component: Dijit Version: 1.1.1
Keywords: Cc:
Blocked By: Blocking:

Description

Probably just need to update the asserts to include ,"submitButton":"Submit". Will do.

Attachments (2)

6943.patch (1.2 KB) - added by haysmark 12 years ago.
Fixes #6943. Updated the asserts in Form's doh test to account for the named submit button.
6943.2.2.patch (2.4 KB) - added by haysmark 11 years ago.
Fixes #6943. Form test did not account for asynchronous nature of Textarea in FF2, especially on the Mac. Added doh.Deferred to address this.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 12 years ago by bill

Great, please fix. This ticket is a dup of #6865 though. I'll close that one.

Changed 12 years ago by haysmark

Attachment: 6943.patch added

Fixes #6943. Updated the asserts in Form's doh test to account for the named submit button.

comment:2 Changed 12 years ago by haysmark

Summary: Regression in [13752]: assert failed in Form test[patch] Regression in [13752]: assert failed in Form test

Here is a patch that updates the JSON doh reads to assert that Form passed. Just as I thought, the submit button's name and value caused the failures.

comment:3 Changed 12 years ago by haysmark

Status: newassigned

comment:4 Changed 12 years ago by bill

(In [14005]) Fixes regression in Form unit test due to [13752]. Still getting a failure on FF2 though. Patch from Mark Hays (IBM, CLA on file). Refs #6943.

comment:5 Changed 11 years ago by haysmark

Bill, I go to this page in FF2:

http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/Form.html

And I get:

------------------------------------------------------------
| TEST SUMMARY:
------------------------------------------------------------
4 tests in 1 groups
0 errors
0 failures

What is failing for you?

comment:6 Changed 11 years ago by bill

I'm getting a failure on the resetTest:

 _AssertFailure: http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/dojo.js:136 doh._AssertFailure: assertEqual() failed: expected {"foo":{"bar":{"baz":{"quux":"2007-12-30"}}},"available":{"from":"2005-01-02","to":"2006-01-02"},"plop":{"combo":"one"},"cb2":["2","3"],"r2":"2","ms1":["VA","WA"],"h1":"hidden","t1":"line 1\nline 2","st1":"simple line 1\nsimple line 2","richtext":"<h1>changed</h1><p>This is the changed content set by setValues</p>","filename":"","submitButton":"Submit"} but got {"foo":{"bar":{"baz":{"quux":"2007-12-30"}}},"available":{"from":"2005-01-02","to":"2006-01-02"},"plop":{"combo":"one"},"cb2":["2","3"],"r2":"2","ms1":["VA","WA"],"h1":"hidden","t1":"new line 1\nnew line 2","st1":"simple line 1\nsimple line 2","richtext":"<h1>changed</h1><p>This is the changed content set by setValues</p>","filename":"","submitButton":"Submit"} dojo.js (line 117)
doh._AssertFailuredojo.js (line 117)
ERROR IN: (function resetTest() {dijit.byId("myForm").reset();doh.is(dojo.toJson(reset), dojo.toJson(dijit.byId("myForm").getValues()));})

Turns out it's only failing on FF2/mac (at least on my machine). Looks like the TextArea isn't getting reset to it's original value.

comment:7 Changed 11 years ago by haysmark

Tried it on FF2/mac and it *sometimes* fails. Hmm.

comment:8 Changed 11 years ago by haysmark

I looked in Firebug and *sometimes* the _resetValue isn't being set.

comment:9 Changed 11 years ago by haysmark

Here is the problem code in TextArea? postCreate:

if(!w || !title){
	this.iframe.postCreate = dojo.hitch(this, this.postCreate);
	return;
}

The code makes postCreate asynchronous because it depends on the iframe onload firing. But doh can sometimes execute the setValues test in Form before the iframe loads! This prevents the _resetValue from being set so the reset test fails.

Since we can't force iframe loading to be synchronous, I've changed the Form test to wait for the _resetValue if it isn't set yet.

comment:10 Changed 11 years ago by haysmark

Bill, you should probably load this several times to make sure it works all the time.

Changed 11 years ago by haysmark

Attachment: 6943.2.2.patch added

Fixes #6943. Form test did not account for asynchronous nature of Textarea in FF2, especially on the Mac. Added doh.Deferred to address this.

comment:11 Changed 11 years ago by haysmark

Ehh had some problems with converted line breaks there. Use 6943.2.2.patch.

comment:12 Changed 11 years ago by bill

Iframe strikes again :-(. OK, I'll check this in temporarily, until we desupport the iframe (see #4988). Thanks for the patch.

comment:13 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

Fixed by [14222]. Thanks Mark!

Note: See TracTickets for help on using tickets.