38
38
property var widgetDataShortText: {
39
39
"title": "Title here",
40
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh."
40
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus a mi vitae augue rhoncus lobortis ut rutrum metus."
43
43
PreviewTextSummary {
72
72
tryCompare(textLabel, "y", 0)
75
function test_see_more() {
76
var seeMore = findChild(previewTextSummary, "seeMore")
78
// when it's more than textLabel.maximumCollapsedLineCount lines of text, show SeeMore component
75
function test_show_collapsed() {
79
76
verify(textLabel.lineCount > textLabel.maximumCollapsedLineCount)
80
compare(seeMore.visible, true)
81
verify(seeMore.more === false)
82
verify(textLabel.height < textLabel.contentHeight)
84
// test interactions with SeeMore
85
var seeMoreLabel = findChild(seeMore, "seeMoreLabel")
86
var seeLessLabel = findChild(seeMore, "seeLessLabel")
87
var initialTextLabelHeight = textLabel.height
88
mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2)
89
tryCompare(textLabel, "height", textLabel.contentHeight)
90
mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2)
91
tryCompare(textLabel, "height", initialTextLabelHeight)
93
// text SeeMore automatic hiding
78
previewTextSummary.expanded = false;
79
tryCompareFunction(function() { return textLabel.height < textLabel.contentHeight; }, true)
94
81
previewTextSummary.widgetData = widgetDataShortText
95
82
verify(textLabel.lineCount <= textLabel.maximumCollapsedLineCount)
96
compare(seeMore.visible, false)
97
83
tryCompare(textLabel, "height", textLabel.contentHeight)
98
84
tryCompare(previewTextSummary, "height", titleLabel.height + textLabel.height)