@@ -31,15 +31,38 @@ Item {
31 DashPreview {
31 DashPreview {
32 id: preview
32 id: preview
33 anchors.fill: parent
33 anchors.fill: parent
34− title: "Testing rocks, debugging sucks!"
36− buttons: Row {
35+ previewImages: Rectangle {
40+ anchors.centerIn: parent
41+ text: "Preview images"
50+ anchors.centerIn: parent
51+ text: "Caption label"
37 width: parent.width
56 width: parent.width
38 height: units.gu(5)
57 height: units.gu(5)
39 Rectangle {
58 Rectangle {
40 width: parent.width / 3
59 width: parent.width / 3
41 height: parent.height
60 height: parent.height
42 color: "blue"
61 color: "blue"
63+ anchors.centerIn: parent
43 MouseArea {
66 MouseArea {
44 id: buttonMouseArea
67 id: buttonMouseArea
45 objectName: "buttonMouseArea"
68 objectName: "buttonMouseArea"
@@ -51,12 +74,15 @@ Item {
51 width: parent.width / 3
74 width: parent.width / 3
52 height: parent.height
75 height: parent.height
53 color: "green"
76 color: "green"
78+ anchors.centerIn: parent
57− header: Label { text: "Caption label" }
59− body: Column {
85+ description: Column {
60 id: testContent
86 id: testContent
61 objectName: "testContent"
87 objectName: "testContent"
62 width: parent.width
88 width: parent.width
@@ -65,16 +91,38 @@ Item {
65 width: parent.width
91 width: parent.width
66 height: parent.height / 3
92 height: parent.height / 3
67 color: "green"
93 color: "green"
95+ anchors.centerIn: parent
96+ text: "Description part 1"
69 Rectangle {
99 Rectangle {
70 width: parent.width
100 width: parent.width
71 height: parent.height / 3
101 height: parent.height / 3
72 color: "red"
102 color: "red"
104+ anchors.centerIn: parent
105+ text: "Description part 2"
74 Rectangle {
108 Rectangle {
75 width: parent.width
109 width: parent.width
76 height: parent.height / 3
110 height: parent.height / 3
77 color: "blue"
111 color: "blue"
113+ anchors.centerIn: parent
114+ text: "Description part 3"
119+ ratings: Rectangle {
120+ objectName: "ratings"
122+ height: units.gu(20)
124+ anchors.centerIn: parent
@@ -95,42 +143,41 @@ Item {
95 name: "DashPreview"
143 name: "DashPreview"
96 when: windowShown
144 when: windowShown
98− function test_close() {
99− var title = findChild(preview, "titleLabel")
100− mouseClick(title, 1, 1)
101− compare(closeSpy.count, 1, "Close signal not emitted")
104 function test_columns_data() {
146 function test_columns_data() {
106 {tag: "1 columns", width: units.gu(5), height: units.gu(10), columns: 1},
148 {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}
111 function test_columns(data) {
153 function test_columns(data) {
112 var leftCol = findChild(preview, "leftColumn")
154 var leftCol = findChild(preview, "leftColumn")
155+ var centerCol = findChild(preview, "centerColumn")
113 var rightCol = findChild(preview, "rightColumn")
156 var rightCol = findChild(preview, "rightColumn")
115 root.width = data.width
158 root.width = data.width
116 root.height = data.height
159 root.height = data.height
118− // there are 2 columns in DashPreview. On portrait form factors
161+ // there are 3 columns in DashPreview. On portrait form factors
119− // only the left one is used and the right one should be empty.
162+ // only the left one is used and the center and right ones should be empty.
120− // to find out if the content is in the correct column, we get a
163+ // To find out if the content is in the correct column, we get a
121 // reference to the column objects and search only the subtree
164 // reference to the column objects and search only the subtree
122 // to see if the content is in the correct column.
165 // to see if the content is in the correct column.
123− // 1 colum -> content should be in leftColumn
166+ // 1 colum -> all content should be in leftColumn
124− // 2 colums -> content should be in rightColumn
167+ // 3 colums -> content should be in centerColumn, rating in rightColumn
126 switch(data.columns) {
169 switch(data.columns) {
128 var testContent = findChild(leftCol, "testContent")
171 var testContent = findChild(leftCol, "testContent")
129 compare(testContent.objectName, "testContent")
172 compare(testContent.objectName, "testContent")
173+ testContent = findChild(leftCol, "ratings")
174+ compare(testContent.objectName, "ratings")
132− var testContent = findChild(rightCol, "testContent")
177+ var testContent = findChild(centerCol, "testContent")
133 compare(testContent.objectName, "testContent")
178 compare(testContent.objectName, "testContent")
179+ testContent = findChild(rightCol, "ratings")
180+ compare(testContent.objectName, "ratings")