@@ -31,15 +31,38 @@ Item {
3131 DashPreview {
3232 id: preview
3333 anchors.fill: parent
34− title: "Testing rocks, debugging sucks!"
3534
36− buttons: Row {
35+ previewImages: Rectangle {
36+ width: parent.width
37+ height: units.gu(20)
38+ color: "honeydew"
39+ Label {
40+ anchors.centerIn: parent
41+ text: "Preview images"
42+ }
43+ }
44+
45+ header: Rectangle {
46+ width: parent.width
47+ height: units.gu(10)
48+ color: "papayawhip"
49+ Label {
50+ anchors.centerIn: parent
51+ text: "Caption label"
52+ }
53+ }
54+
55+ actions: Row {
3756 width: parent.width
3857 height: units.gu(5)
3958 Rectangle {
4059 width: parent.width / 3
4160 height: parent.height
4261 color: "blue"
62+ Label {
63+ anchors.centerIn: parent
64+ text: "Button 1"
65+ }
4366 MouseArea {
4467 id: buttonMouseArea
4568 objectName: "buttonMouseArea"
@@ -51,12 +74,15 @@ Item {
5174 width: parent.width / 3
5275 height: parent.height
5376 color: "green"
77+ Label {
78+ anchors.centerIn: parent
79+ text: "Button 2"
80+ }
81+
5482 }
5583 }
5684
57− header: Label { text: "Caption label" }
58−
59− body: Column {
85+ description: Column {
6086 id: testContent
6187 objectName: "testContent"
6288 width: parent.width
@@ -65,16 +91,38 @@ Item {
6591 width: parent.width
6692 height: parent.height / 3
6793 color: "green"
94+ Label {
95+ anchors.centerIn: parent
96+ text: "Description part 1"
97+ }
6898 }
6999 Rectangle {
70100 width: parent.width
71101 height: parent.height / 3
72102 color: "red"
103+ Label {
104+ anchors.centerIn: parent
105+ text: "Description part 2"
106+ }
73107 }
74108 Rectangle {
75109 width: parent.width
76110 height: parent.height / 3
77111 color: "blue"
112+ Label {
113+ anchors.centerIn: parent
114+ text: "Description part 3"
115+ }
116+ }
117+ }
118+
119+ ratings: Rectangle {
120+ objectName: "ratings"
121+ width: parent.width
122+ height: units.gu(20)
123+ Label {
124+ anchors.centerIn: parent
125+ text: "Ratings"
78126 }
79127 }
80128 }
@@ -95,42 +143,41 @@ Item {
95143 name: "DashPreview"
96144 when: windowShown
97145
98− function test_close() {
99− var title = findChild(preview, "titleLabel")
100− mouseClick(title, 1, 1)
101− compare(closeSpy.count, 1, "Close signal not emitted")
102− }
103−
104146 function test_columns_data() {
105147 return [
106148 {tag: "1 columns", width: units.gu(5), height: units.gu(10), columns: 1},
107− {tag: "2 columns", width: units.gu(50), height: units.gu(10), columns: 2}
149+ {tag: "3 columns", width: units.gu(50), height: units.gu(10), columns: 3}
108150 ]
109151 }
110152
111153 function test_columns(data) {
112154 var leftCol = findChild(preview, "leftColumn")
155+ var centerCol = findChild(preview, "centerColumn")
113156 var rightCol = findChild(preview, "rightColumn")
114157
115158 root.width = data.width
116159 root.height = data.height
117160
118− // there are 2 columns in DashPreview. On portrait form factors
119− // only the left one is used and the right one should be empty.
120− // to find out if the content is in the correct column, we get a
161+ // there are 3 columns in DashPreview. On portrait form factors
162+ // only the left one is used and the center and right ones should be empty.
163+ // To find out if the content is in the correct column, we get a
121164 // reference to the column objects and search only the subtree
122165 // to see if the content is in the correct column.
123− // 1 colum -> content should be in leftColumn
124− // 2 colums -> content should be in rightColumn
166+ // 1 colum -> all content should be in leftColumn
167+ // 3 colums -> content should be in centerColumn, rating in rightColumn
125168
126169 switch(data.columns) {
127170 case 1:
128171 var testContent = findChild(leftCol, "testContent")
129172 compare(testContent.objectName, "testContent")
173+ testContent = findChild(leftCol, "ratings")
174+ compare(testContent.objectName, "ratings")
130175 break
131− case 2:
132− var testContent = findChild(rightCol, "testContent")
176+ case 3:
177+ var testContent = findChild(centerCol, "testContent")
133178 compare(testContent.objectName, "testContent")
179+ testContent = findChild(rightCol, "ratings")
180+ compare(testContent.objectName, "ratings")
134181 break
135182 }
136183