blob: af17e6df35096fce4e3b6402c2d2592e50cb98c4 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<UnitTester testDir="spark/components/Form/Properties/" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:m="http://ns.adobe.com/mxml/2009" xmlns="*" testSWF="CustomFormItemSkin_main.mxml">
<!-- this set of lines form a template that must be in each unit test -->
<fx:Script>
<![CDATA[
public static function init(o:DisplayObject):void { }
]]>
</fx:Script>
<fx:Metadata>
<![CDATA[
[Mixin]
]]>
</fx:Metadata>
<!-- end of set of lines that must be in each unit test -->
<fx:Script>
<![CDATA[
import spark.layouts.*;
import comps.*;
import spark.components.Group;
import flash.utils.getQualifiedClassName;
private var myGrp:GroupMultiElements;
private function initGrp():void{
myGrp = new GroupMultiElements();
}
]]>
</fx:Script>
<testCases>
<TestCase testID="CustomFormItemSkin_left_right_ConstraintColumn_explicitWidth" keywords="[Form, ConstraintColumn, left, right]" description="FormItemSkin label width adjusts to accomodate constraints">
<setup>
<ResetComponent target="fi" className="comps.MyFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="width" target="fi.labelDisplay" value="90"/>
</body>
</TestCase>
<TestCase testID="CustomFormItemSkin_left_right_ConstraintColumn_contentWidth" keywords="[Form, ConstraintColumn, left, right]" description="FormItemSkin label width adjusts to accomodate constraints">
<setup>
<ResetComponent target="fi" className="comps.MyFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="width" target="fi.contentGroup" value="185"/>
<AssertPropertyValue propertyName="width" target="fi.skin.contentCol" value="185"/>
</body>
</TestCase>
<TestCase testID="CustomFormItemSkin_ConstraintColumn_contentWidth" keywords="[Form, ConstraintColumn, contentWidth]" description="FormItemSkin column width adjusts to accomodate elements">
<setup>
<ResetComponent target="fi" className="comps.MyFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="width" target="fi2.contentGroup" value="270"/>
<AssertPropertyValue propertyName="width" target="fi2.skin.contentGroup" value="270"/>
</body>
</TestCase>
<TestCase testID="CustomFormItemSkin_top_bottom_ConstraintRow_explicitWidth" keywords="[Form, ConstraintRow, top, bottom]" description="FormItemSkin label height adjusts to accomodate constraints">
<setup>
<ResetComponent target="fi2" className="comps.ContentFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="height" target="fi2.labelDisplay" value="90"/>
</body>
</TestCase>
<TestCase testID="CustomFormItemSkin_FormHeading_width_FormItem_width" keywords="[Form, FormHeading, FormItem, width]" description="Change FormItem width at runtime verify FormHeading width expands to same width">
<setup>
<ResetComponent target="fi" className="comps.MyFormItem" waitEvent="updateComplete"/>
</setup>
<body>
<SetProperty propertyName="width" value="500" target="fi" waitEvent="updateComplete"/>
<SetProperty propertyName="label" value="FormHeading Label" target="fh" waitEvent="updateComplete"/>
<AssertPropertyValue propertyName="width" value="500" target="fi"/>
<!-- SDK-26768 -->
<!--<AssertPropertyValue propertyName="width" value="500" target="fh"/>-->
<AssertPropertyValue propertyName="width" value="520" target="frm"/>
</body>
</TestCase>
<TestCase testID="CustomFormItemSkin_FormHeading_width_greater_Form_width" keywords="[Form, FormHeading, FormItem, width]" description="Change FormItem width at runtime verify FormHeading width expands to same width">
<setup>
<ResetComponent target="fi" className="comps.MyFormItem" waitEvent="updateComplete"/>
</setup>
<body>
<SetProperty propertyName="width" value="400" target="fhWidth" waitEvent="updateComplete"/>
<AssertPropertyValue propertyName="width" value="420" target="frmWidth"/>
<AssertPropertyValue propertyName="width" value="400" target="fhWidth"/>
<AssertPropertyValue propertyName="width" value="58" target="fiWidth"/>
</body>
</TestCase>
<TestCase testID="CustomFormItemSkin_ConstraintRow_contentHeight" keywords="[Form, ConstraintRow, contentHeight]" description="FormItemSkin column height adjusts to accomodate elements">
<setup>
<ResetComponent target="fi2" className="comps.ContentFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="height" target="fi2.skin.rowLabel" value="150"/>
<AssertPropertyValue propertyName="height" target="fi2.skin.row2" value="150"/>
</body>
</TestCase>
<TestCase testID="MultipleFormItemSkin_multiple_ConstraintColumn_spanning" keywords="[Form, ConstraintColumn, multiple]" description="Multiple column spanned label spans 55 pixels into the next column">
<setup>
<ResetComponent target="fi2" className="comps.ContentFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="width" target="fiMulti.skin.sequenceCol" value="100"/>
<AssertPropertyValue propertyName="width" target="fiMulti.skin.labelCol" value="55"/>
</body>
</TestCase>
<TestCase testID="MultipleFormItemSkin_multiple_ConstraintRow_spanning" keywords="[Form, ConstraintRow, multiple]" description="Multiple row spanned label spans 55 pixels into the next row">
<setup>
<ResetComponent target="fi2" className="comps.ContentFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="height" target="fiMulti.skin.row1" value="100"/>
<AssertPropertyValue propertyName="height" target="fiMulti.skin.row2" value="55"/>
</body>
</TestCase>
<TestCase testID="MultipleFormItemSkin_multiple_ConstraintRow_spanning_baseline" keywords="[Form, ConstraintRow, multiple]" description="Multiple row spanned label spans 55 pixels into the next row">
<setup>
<ResetComponent target="fi2" className="comps.ContentFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="height" target="fiMulti.skin.row3" value="100"/>
<AssertPropertyValue propertyName="height" target="fiMulti.skin.row4" value="55"/>
</body>
</TestCase>
<TestCase testID="MultipleFormItemSkin_multiple_ConstraintColumn_spanning_contentsizedcolumn" keywords="[Form, ConstraintRow, multiple]" description="Multiple row spanned label spans 55 pixels into the next row">
<setup>
<ResetComponent target="fi2" className="comps.ContentFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="width" target="fiMulti.skin.contentCol" value="100"/>
<AssertPropertyValue propertyName="width" target="fiMulti.skin.helpCol" value="100"/>
</body>
</TestCase>
<TestCase testID="MultipleFormItemSkin_multiple_ConstraintColumn_spanning_fixedsizedcolumn" keywords="[Form, ConstraintRow, multiple]" description="Multiple row spanned label spans 55 pixels into the next row">
<setup>
<ResetComponent target="fi2" className="comps.ContentFormItem" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue propertyName="width" target="fiMulti.skin.myContent" value="155"/>
</body>
</TestCase>
</testCases>
</UnitTester>