on xenial help sign in
Simplify tests.
9a27624Michał Sawicz
tests/qmltests/Dash/tst_Card.qml+6−14
@@ -450,13 +450,10 @@ Rectangle {
450
450
451 background.color = data.tag;
451 background.color = data.tag;
452
452
453− if (data.dark) {
453+ var fontColor = data.dark ? "grey" : "white";
454− tryCompareFunction(function() { return Qt.colorEqual(summary.color, "grey"); }, true);
454+
455− tryCompareFunction(function() { return Qt.colorEqual(header.fontColor, "grey"); }, true);
456− } else {
457− tryCompareFunction(function() { return Qt.colorEqual(summary.color, "white"); }, true);
455+ tryCompareFunction(function() { return Qt.colorEqual(summary.color, fontColor); }, true);
458− tryCompareFunction(function() { return Qt.colorEqual(header.fontColor, "white"); }, true);
456+ tryCompareFunction(function() { return Qt.colorEqual(header.fontColor, fontColor); }, true);
459− }
460 }
457 }
461
458
462 function test_mascotShape_data() {
459 function test_mascotShape_data() {
@@ -476,13 +473,8 @@ Rectangle {
476 verify(shape, "Could not find shape.");
473 verify(shape, "Could not find shape.");
477 verify(image, "Could not find image.");
474 verify(image, "Could not find image.");
478
475
479− if (data.shape) {
480− tryCompare(shape, "visible", true);
476+ tryCompare(shape, "visible", data.shape);
481− tryCompare(image, "visible", false);
477+ tryCompare(image, "visible", !data.shape);
482− } else {
483− tryCompare(shape, "visible", false);
484− tryCompare(image, "visible", true);
485− }
486 }
478 }
487 }
479 }
488}
480}