~ci-train-bot/unity8/unity8-ubuntu-zesty-2404

« back to all changes in this revision

Viewing changes to tests/qmltests/Dash/Previews/tst_PreviewTable.qml

  • Committer: Nick Dedekind
  • Date: 2016-11-28 13:46:55 UTC
  • mfrom: (2704 unity8)
  • mto: This revision was merged to the branch mainline in revision 2752.
  • Revision ID: nick.dedekind@canonical.com-20161128134655-vd70a64pbci1b4oc
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
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"] ]
32
32
    }
33
33
 
 
34
    property var widgetDataComplete2: {
 
35
        "title": "Short Title here",
 
36
        "values": [ [ "Publisher/Creator", "Unity8 team" ], [ "Label A", "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"],  [ "Author", "Best 3v3r"],  [ "Summary", "If i knew how to write summaries i'd be working somewhere else"] ]
 
37
    }
 
38
 
34
39
    property var widgetDataNoTitle: {
35
40
        "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"] ]
36
41
    }
51
56
        }
52
57
    }
53
58
 
 
59
    PreviewWidgetFactory {
 
60
        id: previewTable2
 
61
        anchors { left: parent.left; right: parent.right; top: previewTable.bottom; topMargin: units.gu(4) }
 
62
        widgetType: "table"
 
63
 
 
64
        Rectangle {
 
65
            color: "red"
 
66
            anchors.fill: parent
 
67
            opacity: 0.5
 
68
        }
 
69
 
 
70
        Component.onCompleted: {
 
71
            previewTable2.widgetData = widgetDataComplete2
 
72
        }
 
73
    }
 
74
 
54
75
    UT.UnityTestCase {
55
76
        name: "PreviewTableTest"
56
77
        when: windowShown
62
83
        function test_label_heights() {
63
84
            verify(findChild(previewTable, "label00").height == findChild(previewTable, "label10").height);
64
85
            verify(findChild(previewTable, "label01").height == findChild(previewTable, "label11").height);
65
 
            verify(findChild(previewTable, "label01").height > findChild(previewTable, "label00").height * 3);
 
86
            verify(findChild(previewTable, "label01").contentHeight > findChild(previewTable, "label00").contentHeight * 3);
66
87
            verify(findChild(previewTable, "label00").height == findChild(previewTable, "label20").height);
67
88
            verify(findChild(previewTable, "label20").height == findChild(previewTable, "label21").height);
68
89
        }