on xenial help sign in
add test!
2c34dfdAndrea Cimitan
plugins/Dash/CardCreator.js+1
@@ -69,6 +69,7 @@ var kArtUbuntuShapeCode = 'UbuntuShape { \n\
69 }';
69 }';
70
70
71var kArtProportionalShapeCode = 'ProportionalShape { \n\
71var kArtProportionalShapeCode = 'ProportionalShape { \n\
72+ objectName: "artShapeProportionalShape"; \n\
72 anchors.fill: parent; \n\
73 anchors.fill: parent; \n\
73 source: artImage; \n\
74 source: artImage; \n\
74 aspect: UbuntuShape.DropShadow; \n\
75 aspect: UbuntuShape.DropShadow; \n\
plugins/Dash/CardCreatorCache.qml+1−1
@@ -29,7 +29,7 @@ QtObject {
29
29
30 var tString = JSON.stringify(template);
30 var tString = JSON.stringify(template);
31 var cString = JSON.stringify(components);
31 var cString = JSON.stringify(components);
32− var allString = tString + cString + artShapeStyle + isCardTool;
32+ var allString = tString + cString + isCardTool + artShapeStyle;
33 var component = cache[allString];
33 var component = cache[allString];
34 if (component === undefined) {
34 if (component === undefined) {
35 component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, allString);
35 component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, allString);
tests/plugins/Dash/cardcreator/3.res+1
@@ -31,6 +31,7 @@ Item {
31 visible: image.status == Image.Ready;
31 visible: image.status == Image.Ready;
32 readonly property alias image: artImage;
32 readonly property alias image: artImage;
33 ProportionalShape {
33 ProportionalShape {
34+ objectName: "artShapeProportionalShape";
34 anchors.fill: parent;
35 anchors.fill: parent;
35 source: artImage;
36 source: artImage;
36 aspect: UbuntuShape.DropShadow;
37 aspect: UbuntuShape.DropShadow;
tests/plugins/Dash/cardcreator/3.res.cardcreator+1
@@ -30,6 +30,7 @@ Item {
30 visible: image.status == Image.Ready;
30 visible: image.status == Image.Ready;
31 readonly property alias image: artImage;
31 readonly property alias image: artImage;
32 ProportionalShape {
32 ProportionalShape {
33+ objectName: "artShapeProportionalShape";
33 anchors.fill: parent;
34 anchors.fill: parent;
34 source: artImage;
35 source: artImage;
35 aspect: UbuntuShape.DropShadow;
36 aspect: UbuntuShape.DropShadow;
tests/qmltests/Dash/tst_Dash.qml+18−1
@@ -88,7 +88,7 @@ Item {
88 return findChild(genericScopeView, categoryName);
88 return findChild(genericScopeView, categoryName);
89 }
89 }
90
90
91− function clickCategoryDelegate(category, delegate) {
91+ function getCategoryDelegate(category, delegate) {
92 var dashContentList = findChild(dash, "dashContentList");
92 var dashContentList = findChild(dash, "dashContentList");
93 var genericScopeView = dashContentList.currentItem;
93 var genericScopeView = dashContentList.currentItem;
94 if (category === undefined) category = 0;
94 if (category === undefined) category = 0;
@@ -104,6 +104,11 @@ Item {
104 true);
104 true);
105 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
105 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
106 waitForRendering(tile);
106 waitForRendering(tile);
107+ return tile;
108+ }
109+
110+ function clickCategoryDelegate(category, delegate) {
111+ var tile = getCategoryDelegate(category, delegate);
107 mouseClick(tile);
112 mouseClick(tile);
108 }
113 }
109
114
@@ -637,6 +642,18 @@ Item {
637 tryCompare(dashContent, "x", 0);
642 tryCompare(dashContent, "x", 0);
638 }
643 }
639
644
645+ function test_cardIconStyle()
646+ {
647+ dash.setCurrentScope("clickscope");
648+ var dashContent = findChild(dash, "dashContent");
649+ tryCompare(dashContent.currentScope, "id", "clickscope");
650+
651+ scrollToCategory("dashCategorypredefined");
652+ var tile = getCategoryDelegate("predefined", 2);
653+ var proportionalShape = findChild(tile, "artShapeProportionalShape");
654+ verify(proportionalShape != undefined);
655+ }
656+
640 function test_tempScopeItemXOnResize()
657 function test_tempScopeItemXOnResize()
641 {
658 {
642 // Go to a temp scope
659 // Go to a temp scope