on xenial help sign in
More robust test
commit21db4b073b923cf1cc317845ce922e073d136a86 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateMon 3 Feb 2014, 23:30 (13 years ago) parent2adef63
2 files changed+11−1
qml/Dash/Previews/TextSummary.qml+4 tests/qmltests/Dash/Previews/tst_TextSummary.qml+7−1
qml/Dash/Previews/TextSummary.qml+4
@@ -18,6 +18,10 @@ import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import "../../Components"
2020
21+/*! \brief Preview widget for text.
22+
23+ This widget shows an array */
24+
2125PreviewWidget {
2226 id: root
2327
tests/qmltests/Dash/Previews/tst_TextSummary.qml+7−1
@@ -56,10 +56,15 @@ Rectangle {
5656 var titleLabel = findChild(textSummary, "titleLabel")
5757
5858 textSummary.widgetData = widgetDataComplete
59+
5960 compare(titleLabel.visible, true)
61+ var mappedTextLabel = root.mapFromItem(textLabel, 0, 0)
62+ compare(mappedTextLabel.y, titleLabel.height)
6063
6164 textSummary.widgetData = widgetDataNoTitle
62− tryCompare(titleLabel, "visible", false)
65+
66+ compare(titleLabel.visible, false)
67+ verify(mappedTextLabel.y, 0)
6368 }
6469
6570 function test_see_more() {
@@ -74,6 +79,7 @@ Rectangle {
7479 verify(textLabel.height < textLabel.contentHeight)
7580
7681 textSummary.widgetData = widgetDataShortText
82+
7783 verify(textLabel.lineCount <= 7)
7884 compare(seeMore.visible, false)
7985 tryCompare(textLabel, "height", textLabel.contentHeight)