@@ -106,6 +106,10 @@ Rectangle {
106106 "layout": { "template": { "card-layout": "horizontal" },
107107 "components": JSON.parse(fullMapping) }
108108 },
109+ {
110+ "name": "Art, header - vertical",
111+ "layout": { "components": Helpers.update(JSON.parse(root.fullMapping), { "summary": undefined }) }
112+ },
109113 ]
110114
111115 Card {
@@ -189,7 +193,10 @@ Rectangle {
189193 property Item summary: findChild(card, "summaryLabel")
190194
191195 function initTestCase() {
192− verify(testCase.header !== undefined, "Couldn't find header object.");
196+ verify(typeof testCase.header === "object", "Couldn't find header object.");
197+ verify(typeof testCase.art === "object", "Couldn't find art object.");
198+ verify(typeof testCase.artImage === "object", "Couldn't find artImage object.");
199+ verify(typeof testCase.summary === "object", "Couldn't find summary object.");
193200 }
194201
195202 function cleanup() {
@@ -237,6 +244,9 @@ Rectangle {
237244 { tag: "Large", width: units.gu(38), size: "large", index: 0 },
238245 { tag: "Wide", width: units.gu(18.5), aspect: 0.5, index: 0 },
239246 { tag: "Horizontal", width: units.gu(38), index: 5 },
247+ // Make sure card ends with header when there's no summary
248+ { tag: "NoSummary", height: function() { return header.y + header.height }, index: 6 },
249+ { tag: "HorizontalNoSummary", height: function() { return header.height }, card_layout: "horizontal", index: 6 },
240250 ]
241251 }
242252
@@ -248,6 +258,11 @@ Rectangle {
248258 card.templateChanged();
249259 }
250260
261+ if (data.hasOwnProperty("card_layout")) {
262+ card.template['card-layout'] = data.card_layout;
263+ card.templateChanged();
264+ }
265+
251266 if (data.hasOwnProperty("aspect")) {
252267 card.components['art']['aspect-ratio'] = data.aspect;
253268 card.componentsChanged();
@@ -257,7 +272,9 @@ Rectangle {
257272 tryCompare(card, "width", data.width);
258273 }
259274
260− if (data.hasOwnProperty("height")) {
275+ if (typeof data.height === "function") {
276+ tryCompareFunction(function() { return card.height === data.height() }, true);
277+ } else if (data.hasOwnProperty("height")) {
261278 tryCompare(card, "height", data.height);
262279 }
263280 }
@@ -308,7 +325,7 @@ Rectangle {
308325 function test_art_layout_data() {
309326 return [
310327 { tag: "Vertical", left: function() { return 0 }, index: 0},
311− { tag: "Horizontal", left: function() { return art.width }, index: 5 }
328+ { tag: "Horizontal", left: function() { return art.width }, index: 5 },
312329 ];
313330 }
314331
@@ -323,7 +340,7 @@ Rectangle {
323340 { tag: "Vertical", top: function() { return art.y + art.height },
324341 left: function() { return art.x }, index: 0 },
325342 { tag: "Horizontal", top: function() { return art.y },
326− left: function() { return art.x + art.width }, index: 5 }
343+ left: function() { return art.x + art.width }, index: 5 },
327344 ]
328345 }
329346