on xenial help sign in
Remove tests, per discussion on IRC with Saviq.
064c8dcMichał Karnicki
qml/Dash/CardHeader.qml+2−5
@@ -48,14 +48,11 @@ Item {
48
48
49 image: Image {
49 image: Image {
50 id: mascotImage
50 id: mascotImage
51− objectName: "mascotImage"
52
51
53− sourceSize {
54− width: mascotShape.maxSize
55− height: mascotShape.maxSize
52+ sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
56− }
57 fillMode: Image.PreserveAspectCrop
53 fillMode: Image.PreserveAspectCrop
58 horizontalAlignment: Image.AlignHCenter
54 horizontalAlignment: Image.AlignHCenter
55+ verticalAlignmnent: Image.AlignVCenter
59 }
56 }
60 }
57 }
61
58
tests/qmltests/Dash/tst_CardHeader.qml+1−30
@@ -44,7 +44,6 @@ Rectangle {
44 when: windowShown
44 when: windowShown
45
45
46 property Item mascot: findChild(cardHeader, "mascotShape")
46 property Item mascot: findChild(cardHeader, "mascotShape")
47− property Item mascotImage: findChild(cardHeader, "mascotImage")
48 property Item titleLabel: findChild(cardHeader, "titleLabel")
47 property Item titleLabel: findChild(cardHeader, "titleLabel")
49 property Item subtitleLabel: findChild(cardHeader, "subtitleLabel")
48 property Item subtitleLabel: findChild(cardHeader, "subtitleLabel")
50 property Item prices: findChild(cardHeader, "prices")
49 property Item prices: findChild(cardHeader, "prices")
@@ -82,25 +81,6 @@ Rectangle {
82 tryCompare(testCase.mascot, "visible", data.visible);
81 tryCompare(testCase.mascot, "visible", data.visible);
83 }
82 }
84
83
85− function test_mascot_image_source_data() {
86− return [
87− { tag: "Mascot source width", width: Math.max(mascot.width, mascot.height) },
88− { tag: "Mascot source height", height: Math.max(mascot.width, mascot.height) },
89− ]
90− }
91−
92− function test_mascot_image_source(data) {
93− cardHeader.mascot = Qt.resolvedUrl("artwork/avatar.png")
94−
95− if (data.hasOwnProperty("width")) {
96− tryCompare(testCase.mascotImage.sourceSize, "width", data.width)
97− }
98−
99− if (data.hasOwnProperty("height")) {
100− tryCompare(testCase.mascotImage.sourceSize, "height", data.height)
101− }
102− }
103−
104 function test_labels_data() {
84 function test_labels_data() {
105 return [
85 return [
106 { tag: "Empty", visible: false },
86 { tag: "Empty", visible: false },
@@ -143,11 +123,6 @@ Rectangle {
143 { tag: "Column width", object: column, width: cardHeader.width - testCase.outerRow.spacing * 2 },
123 { tag: "Column width", object: column, width: cardHeader.width - testCase.outerRow.spacing * 2 },
144 { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" },
124 { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" },
145 { tag: "Header height", object: cardHeader, height: function() { return subtitleLabel.y + subtitleLabel.height + outerRow.spacing * 2 } },
125 { tag: "Header height", object: cardHeader, height: function() { return subtitleLabel.y + subtitleLabel.height + outerRow.spacing * 2 } },
146− { tag: "Mascot width", object: mascot,
147− "mascot": Qt.resolvedUrl("artwork/avatar.png"), width: units.gu(6), },
148− { tag: "Mascot height", object: mascot,
149− // mascot (icon) aspect-ratio is 8:7.5
150− "mascot": Qt.resolvedUrl("artwork/avatar.png"), height: units.gu(6)*7.5/8.0 },
151 ]
126 ]
152 }
127 }
153
128
@@ -161,11 +136,7 @@ Rectangle {
161 }
136 }
162
137
163 if (data.hasOwnProperty("height")) {
138 if (data.hasOwnProperty("height")) {
164− if (typeof data.height === "function") {
165− tryCompareFunction(function() { return data.object.height === data.height() }, true)
139+ tryCompareFunction(function() { return data.object.height === data.height() }, true);
166− } else {
167− tryCompare(data.object, "height", data.height)
168− }
169 }
140 }
170 }
141 }
171 }
142 }