@@ -31,6 +31,8 @@ Rectangle {
31 property Item subtitleLabel: findChild(cardHeader, "subtitleLabel")
31 property Item subtitleLabel: findChild(cardHeader, "subtitleLabel")
32 property Item prices: findChild(cardHeader, "prices")
32 property Item prices: findChild(cardHeader, "prices")
33 property Item oldPriceLabel: findChild(cardHeader, "oldPriceLabel")
33 property Item oldPriceLabel: findChild(cardHeader, "oldPriceLabel")
34+ property Item outerRow: findChild(cardHeader, "outerRow")
35+ property Item column: findChild(cardHeader, "column")
35 function initTestCase() {
37 function initTestCase() {
36 verify(testCase.mascot !== undefined, "Couldn't find mascot object.");
38 verify(testCase.mascot !== undefined, "Couldn't find mascot object.");
@@ -101,5 +103,22 @@ Rectangle {
101 compare(testCase.oldPriceLabel.horizontalAlignment, data.oldAlign, "Old price label is aligned wrong.")
103 compare(testCase.oldPriceLabel.horizontalAlignment, data.oldAlign, "Old price label is aligned wrong.")
107+ function test_dimensions_data() {
109+ { tag: "Column width", object: column, width: cardHeader.width - testCase.outerRow.spacing * 2 },
110+ { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" }
114+ function test_dimensions(data) {
115+ if (data.hasOwnProperty("mascot")) {
116+ cardHeader.mascot = data.mascot;
119+ if (data.hasOwnProperty("width")) {
120+ tryCompare(data.object, "width", data.width);