on xenial help sign in
Remove tests, per discussion on IRC with Saviq.
commit064c8dce4be2a1195b06f70e41c670a6ceac69e0 authorMichał Karnicki <michal.karnicki@canonical.com> dateThu 30 Jan 2014, 22:53 (13 years ago) parentbf01534
2 files changed+3−35
qml/Dash/CardHeader.qml+2−5 tests/qmltests/Dash/tst_CardHeader.qml+1−30
qml/Dash/CardHeader.qml+2−5
@@ -48,14 +48,11 @@ Item {
4848
4949 image: Image {
5050 id: mascotImage
51− objectName: "mascotImage"
5251
53− sourceSize {
54− width: mascotShape.maxSize
55− height: mascotShape.maxSize
56− }
52+ sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
5753 fillMode: Image.PreserveAspectCrop
5854 horizontalAlignment: Image.AlignHCenter
55+ verticalAlignmnent: Image.AlignVCenter
5956 }
6057 }
6158
tests/qmltests/Dash/tst_CardHeader.qml+1−30
@@ -44,7 +44,6 @@ Rectangle {
4444 when: windowShown
4545
4646 property Item mascot: findChild(cardHeader, "mascotShape")
47− property Item mascotImage: findChild(cardHeader, "mascotImage")
4847 property Item titleLabel: findChild(cardHeader, "titleLabel")
4948 property Item subtitleLabel: findChild(cardHeader, "subtitleLabel")
5049 property Item prices: findChild(cardHeader, "prices")
@@ -82,25 +81,6 @@ Rectangle {
8281 tryCompare(testCase.mascot, "visible", data.visible);
8382 }
8483
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−
10484 function test_labels_data() {
10585 return [
10686 { tag: "Empty", visible: false },
@@ -143,11 +123,6 @@ Rectangle {
143123 { tag: "Column width", object: column, width: cardHeader.width - testCase.outerRow.spacing * 2 },
144124 { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" },
145125 { 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 },
151126 ]
152127 }
153128
@@ -161,11 +136,7 @@ Rectangle {
161136 }
162137
163138 if (data.hasOwnProperty("height")) {
164− if (typeof data.height === "function") {
165− tryCompareFunction(function() { return data.object.height === data.height() }, true)
166− } else {
167− tryCompare(data.object, "height", data.height)
168− }
139+ tryCompareFunction(function() { return data.object.height === data.height() }, true);
169140 }
170141 }
171142 }