@@ -28,24 +28,27 @@ Rectangle {
2828
2929 property var widgetDataComplete: {
3030 "title": "Title here longa long long long long long long long long long long",
31− "values": [ [ "Long Label 1", "Value 1"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
31+ "values": [ [ "Long Label 1", "Long Value 1 Long Value 2 Long Value 3 Long Value 4 Long Value 5 Long Value 6 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
3232 }
3333
3434 property var widgetDataNoTitle: {
35− "values": [ [ "Long Label 1", "Value 1"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
35+ "values": [ [ "Long Label 1", "Long Value 1 Long Value 2 Long Value 3 Long Value 4 Long Value 5 Long Value 6 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
3636 }
3737
3838 PreviewWidgetFactory {
3939 id: previewTable
4040 anchors { left: parent.left; right: parent.right }
4141 widgetType: "table"
42− widgetData: widgetDataComplete
4342
4443 Rectangle {
4544 color: "red"
4645 anchors.fill: parent
4746 opacity: 0.5
4847 }
48+
49+ Component.onCompleted: {
50+ previewTable.widgetData = widgetDataComplete
51+ }
4952 }
5053
5154 UT.UnityTestCase {
@@ -56,9 +59,17 @@ Rectangle {
5659 previewTable.widgetData = widgetDataComplete;
5760 }
5861
62+ function test_label_heights() {
63+ verify(findChild(previewTable, "label00").height == findChild(previewTable, "label10").height);
64+ verify(findChild(previewTable, "label01").height == findChild(previewTable, "label11").height);
65+ verify(findChild(previewTable, "label01").height > findChild(previewTable, "label00").height * 3);
66+ verify(findChild(previewTable, "label00").height == findChild(previewTable, "label20").height);
67+ verify(findChild(previewTable, "label20").height == findChild(previewTable, "label21").height);
68+ }
69+
5970 function test_values() {
6071 compare(findChild(previewTable, "label00").text, "Long Label 1");
61− compare(findChild(previewTable, "label01").text, "Value 1");
72+ compare(findChild(previewTable, "label01").text, "Long Value 1 Long Value 2 Long Value 3 Long Value 4 Long Value 5 Long Value 6 Long Value 2 Long Value 2 Long Value 2 Long Value 2");
6273 compare(findChild(previewTable, "label10").text, "Label 2");
6374 compare(findChild(previewTable, "label11").text, "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2");
6475 compare(findChild(previewTable, "label20").text, "Label 3");