on xenial help sign in
Add mascotShape test.
2cf686fMichał Sawicz
qml/Dash/CardHeader.qml+1
@@ -69,6 +69,7 @@ Item {
69
69
70 Image {
70 Image {
71 id: mascotImage
71 id: mascotImage
72+ objectName: "mascotImage"
72
73
73 width: source ? mascotShape.width : 0
74 width: source ? mascotShape.width : 0
74 height: mascotShape.height
75 height: mascotShape.height
tests/qmltests/Dash/tst_Card.qml+27
@@ -458,5 +458,32 @@ Rectangle {
458 verify(Qt.colorEqual(header.fontColor, "white"), "Header color should be white.");
458 verify(Qt.colorEqual(header.fontColor, "white"), "Header color should be white.");
459 }
459 }
460 }
460 }
461+
462+ function test_mascotShape_data() {
463+ return [
464+ { tag: "Art and summary", shape: false, index: 0 },
465+ { tag: "No Summary", shape: true, index: 6 },
466+ { tag: "With background", shape: false, index: 10 },
467+ ];
468+ }
469+
470+ function test_mascotShape(data) {
471+ selector.selectedIndex = data.index;
472+ wait(200)
473+
474+ var shape = findChild(card, "mascotShape");
475+ var image = findChild(card, "mascotImage");
476+
477+ verify(shape, "Could not find shape.");
478+ verify(image, "Could not find image.");
479+
480+ if (data.shape) {
481+ verify(shape.visible, "Shape should be visible");
482+ verify(!image.visible, "Image should not be visible");
483+ } else {
484+ verify(!shape.visible, "Shape should not be visible");
485+ verify(image.visible, "Image should be visible");
486+ }
487+ }
461 }
488 }
462}
489}