on xenial help sign in
Added test for height
892f184Andrea Cimitan
tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml+3−3
@@ -42,7 +42,7 @@ Rectangle {
42
42
43 PreviewTextSummary {
43 PreviewTextSummary {
44 id: previewTextSummary
44 id: previewTextSummary
45− anchors.fill: parent
45+ anchors { left: parent.left; right: parent.right }
46 widgetData: widgetDataComplete
46 widgetData: widgetDataComplete
47 }
47 }
48
48
@@ -51,6 +51,7 @@ Rectangle {
51 when: windowShown
51 when: windowShown
52
52
53 property var textLabel: findChild(previewTextSummary, "textLabel")
53 property var textLabel: findChild(previewTextSummary, "textLabel")
54+ property var titleLabel: findChild(previewTextSummary, "titleLabel")
54
55
55 function init() {
56 function init() {
56 verify(typeof textLabel === "object", "TextLabel object could not be found.")
57 verify(typeof textLabel === "object", "TextLabel object could not be found.")
@@ -61,8 +62,6 @@ Rectangle {
61 }
62 }
62
63
63 function test_optional_title() {
64 function test_optional_title() {
64− var titleLabel = findChild(previewTextSummary, "titleLabel")
65−
66 // verify titleLabel is visible and textLabel is anchored below it
65 // verify titleLabel is visible and textLabel is anchored below it
67 compare(titleLabel.visible, true)
66 compare(titleLabel.visible, true)
68 tryCompare(textLabel, "y", titleLabel.height)
67 tryCompare(textLabel, "y", titleLabel.height)
@@ -96,6 +95,7 @@ Rectangle {
96 verify(textLabel.lineCount <= textLabel.maximumCollapsedLineCount)
95 verify(textLabel.lineCount <= textLabel.maximumCollapsedLineCount)
97 compare(seeMore.visible, false)
96 compare(seeMore.visible, false)
98 tryCompare(textLabel, "height", textLabel.contentHeight)
97 tryCompare(textLabel, "height", textLabel.contentHeight)
98+ tryCompare(previewTextSummary, "height", titleLabel.height + textLabel.height)
99 }
99 }
100 }
100 }
101}
101}