@@ -52,17 +52,24 @@ Rectangle {
5252
5353 property var textLabel: findChild(previewTextSummary, "textLabel")
5454
55− function test_optional_title() {
56− var titleLabel = findChild(previewTextSummary, "titleLabel")
55+ function init() {
56+ verify(typeof textLabel === "object", "TextLabel object could not be found.")
57+ }
5758
59+ function cleanup() {
5860 previewTextSummary.widgetData = widgetDataComplete
61+ }
62+
63+ function test_optional_title() {
64+ var titleLabel = findChild(previewTextSummary, "titleLabel")
5965
66+ // verify titleLabel is visible and textLabel is anchored below it
6067 compare(titleLabel.visible, true)
6168 var mappedTextLabel = root.mapFromItem(textLabel, 0, 0)
6269 compare(mappedTextLabel.y, titleLabel.height)
6370
71+ // verify titleLabel disappears and textLabel moves up
6472 previewTextSummary.widgetData = widgetDataNoTitle
65−
6673 compare(titleLabel.visible, false)
6774 verify(mappedTextLabel.y, 0)
6875 }
@@ -70,8 +77,6 @@ Rectangle {
7077 function test_see_more() {
7178 var seeMore = findChild(previewTextSummary, "seeMore")
7279
73− previewTextSummary.widgetData = widgetDataComplete
74−
7580 // when it's more than 7 lines of text, show SeeMore component
7681 verify(textLabel.lineCount > 7)
7782 compare(seeMore.visible, true)
@@ -82,16 +87,13 @@ Rectangle {
8287 var seeMoreLabel = findChild(seeMore, "seeMoreLabel")
8388 var seeLessLabel = findChild(seeMore, "seeLessLabel")
8489 var initialTextLabelHeight = textLabel.height
85−
8690 mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2)
8791 tryCompare(textLabel, "height", textLabel.contentHeight)
88−
8992 mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2)
9093 tryCompare(textLabel, "height", initialTextLabelHeight)
9194
9295 // text SeeMore automatic hiding
9396 previewTextSummary.widgetData = widgetDataShortText
94−
9597 verify(textLabel.lineCount <= 7)
9698 compare(seeMore.visible, false)
9799 tryCompare(textLabel, "height", textLabel.contentHeight)