-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #638 testcase for radiobutton issue in IE7
radio button needs a name to get selected by a click. As there is no need for a name in this widget, the workaround is to call the onbind method on every radio button bound to the model.
- Loading branch information
1 parent
cd6a255
commit 06baf62
Showing
6 changed files
with
153 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright 2012 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
Aria.classDefinition({ | ||
$classpath : "test.aria.html.radioButton.IEbug.RadioButtonTestCase", | ||
$extends : "aria.jsunit.RobotTestCase", | ||
$dependencies : ["aria.utils.Dom", "aria.html.RadioButton"], | ||
$constructor : function () { | ||
this.$TemplateTestCase.constructor.call(this); | ||
this.setTestEnv({ | ||
data : { | ||
selectedValue : "" | ||
} | ||
}); | ||
}, | ||
$prototype : { | ||
runTemplateTest : function () { | ||
|
||
var document = Aria.$window.document; | ||
var selectWidgets = this.testDiv.getElementsByTagName("input"); | ||
|
||
var widget1 = selectWidgets[0]; | ||
var widget2 = selectWidgets[1]; | ||
var widget3 = selectWidgets[2]; | ||
|
||
this.assertEquals(widget1.checked, false, "Check before click on widget 1: " + widget1.checked); | ||
this.assertEquals(widget2.checked, false, "Check before click on widget 2: " + widget2.checked); | ||
this.assertEquals(widget3.checked, false, "Check before click on widget 3: " + widget3.checked); | ||
|
||
this.widget1 = widget1; | ||
this.widget2 = widget2; | ||
this.widget3 = widget3; | ||
|
||
this.synEvent.click(widget1, { | ||
fn : this.afterFirstClick, | ||
scope : this | ||
}); | ||
}, | ||
|
||
afterFirstClick : function () { | ||
|
||
this.assertEquals(this.widget1.checked, true, "Check after click on widget 1: " + this.widget1.checked); | ||
this.assertEquals(this.widget2.checked, false, "Check after click on widget 2: " + this.widget2.checked); | ||
this.assertEquals(this.widget3.checked, false, "Check after click on widget 3: " + this.widget3.checked); | ||
|
||
this.assertEquals(this.templateCtxt.data.selectedValue, "a", "Check click on data: expected value was %2 but got %1."); | ||
|
||
this.end(); | ||
} | ||
|
||
} | ||
}); |
60 changes: 60 additions & 0 deletions
60
test/aria/html/radioButton/IEbug/RadioButtonTestCaseTpl.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2012 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
{Template { | ||
$classpath : "test.aria.html.radioButton.IEbug.RadioButtonTestCaseTpl", | ||
$wlibs : { | ||
html : "aria.html.HtmlLibrary" | ||
} | ||
}} | ||
|
||
{macro main()} | ||
|
||
{@html:RadioButton { | ||
value : "a", | ||
bind : { | ||
selectedValue : { | ||
inside : data, | ||
to : "selectedValue" | ||
} | ||
} | ||
}/} | ||
label 1 associated to value 'a'<br> | ||
|
||
{@html:RadioButton { | ||
value : "b", | ||
bind : { | ||
selectedValue : { | ||
inside : data, | ||
to : "selectedValue" | ||
} | ||
} | ||
}/} | ||
label 2 associated to value 'b'<br> | ||
|
||
{@html:RadioButton { | ||
value : "c", | ||
bind : { | ||
selectedValue : { | ||
inside : data, | ||
to : "selectedValue" | ||
} | ||
} | ||
}/} | ||
label 3 associated to value 'c'<br> | ||
|
||
|
||
{/macro} | ||
{/Template} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters