on xenial help sign in
Added another test and comments
commit4f87ed05122211f60a826a0850fdaff07b84f8d8 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateTue 4 Feb 2014, 11:56 (13 years ago) parentc1a9019
3 files changed+20−5
qml/Dash/Previews/TextSummary.qml+4−1 tests/qmltests/Components/tst_SeeMore.qml+4−4 tests/qmltests/Dash/Previews/tst_TextSummary.qml+12
qml/Dash/Previews/TextSummary.qml+4−1
@@ -20,7 +20,10 @@ import "../../Components"
2020
2121/*! \brief Preview widget for text.
2222
23− This widget shows an array */
23+ This widget shows text contained in widgetData["text"]
24+ along with a title that comes from widgetData["title"].
25+
26+ In case the text does not fit in 7 lines a See More / Less widget is also shown */
2427
2528PreviewWidget {
2629 id: root
tests/qmltests/Components/tst_SeeMore.qml+4−4
@@ -37,15 +37,15 @@ Rectangle {
3737 when: windowShown
3838
3939 function test_interaction() {
40− var seeMoreLabel = findChild(seeMore, "seeMoreLabel");
41− var seeLessLabel = findChild(seeMore, "seeLessLabel");
40+ var seeMoreLabel = findChild(seeMore, "seeMoreLabel")
41+ var seeLessLabel = findChild(seeMore, "seeLessLabel")
4242
4343 compare(seeMore.more, false)
4444
45− mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2);
45+ mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2)
4646 compare(seeMore.more, true)
4747
48− mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2);
48+ mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2)
4949 compare(seeMore.more, false)
5050 }
5151 }
tests/qmltests/Dash/Previews/tst_TextSummary.qml+12
@@ -78,6 +78,18 @@ Rectangle {
7878 verify(seeMore.more === false)
7979 verify(textLabel.height < textLabel.contentHeight)
8080
81+ // test interactions with SeeMore
82+ var seeMoreLabel = findChild(seeMore, "seeMoreLabel")
83+ var seeLessLabel = findChild(seeMore, "seeLessLabel")
84+ var initialTextLabelHeight = textLabel.height
85+
86+ mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2)
87+ tryCompare(textLabel, "height", textLabel.contentHeight)
88+
89+ mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2)
90+ tryCompare(textLabel, "height", initialTextLabelHeight)
91+
92+ // text SeeMore automatic hiding
8193 textSummary.widgetData = widgetDataShortText
8294
8395 verify(textLabel.lineCount <= 7)