on xenial help sign in
add test!
commit2c34dfd9862ada8b585f094e19165c35a8737627 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 2 Jun 2016, 15:31 (10 years ago) parent3598567
5 files changed+22−2
plugins/Dash/CardCreator.js+1 plugins/Dash/CardCreatorCache.qml+1−1 tests/plugins/Dash/cardcreator/3.res+1 tests/plugins/Dash/cardcreator/3.res.cardcreator+1 tests/qmltests/Dash/tst_Dash.qml+18−1
plugins/Dash/CardCreator.js+1
@@ -69,6 +69,7 @@ var kArtUbuntuShapeCode = 'UbuntuShape { \n\
6969 }';
7070
7171var kArtProportionalShapeCode = 'ProportionalShape { \n\
72+ objectName: "artShapeProportionalShape"; \n\
7273 anchors.fill: parent; \n\
7374 source: artImage; \n\
7475 aspect: UbuntuShape.DropShadow; \n\
plugins/Dash/CardCreatorCache.qml+1−1
@@ -29,7 +29,7 @@ QtObject {
2929
3030 var tString = JSON.stringify(template);
3131 var cString = JSON.stringify(components);
32− var allString = tString + cString + artShapeStyle + isCardTool;
32+ var allString = tString + cString + isCardTool + artShapeStyle;
3333 var component = cache[allString];
3434 if (component === undefined) {
3535 component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, allString);
tests/plugins/Dash/cardcreator/3.res+1
@@ -31,6 +31,7 @@ Item {
3131 visible: image.status == Image.Ready;
3232 readonly property alias image: artImage;
3333 ProportionalShape {
34+ objectName: "artShapeProportionalShape";
3435 anchors.fill: parent;
3536 source: artImage;
3637 aspect: UbuntuShape.DropShadow;
tests/plugins/Dash/cardcreator/3.res.cardcreator+1
@@ -30,6 +30,7 @@ Item {
3030 visible: image.status == Image.Ready;
3131 readonly property alias image: artImage;
3232 ProportionalShape {
33+ objectName: "artShapeProportionalShape";
3334 anchors.fill: parent;
3435 source: artImage;
3536 aspect: UbuntuShape.DropShadow;
tests/qmltests/Dash/tst_Dash.qml+18−1
@@ -88,7 +88,7 @@ Item {
8888 return findChild(genericScopeView, categoryName);
8989 }
9090
91− function clickCategoryDelegate(category, delegate) {
91+ function getCategoryDelegate(category, delegate) {
9292 var dashContentList = findChild(dash, "dashContentList");
9393 var genericScopeView = dashContentList.currentItem;
9494 if (category === undefined) category = 0;
@@ -104,6 +104,11 @@ Item {
104104 true);
105105 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
106106 waitForRendering(tile);
107+ return tile;
108+ }
109+
110+ function clickCategoryDelegate(category, delegate) {
111+ var tile = getCategoryDelegate(category, delegate);
107112 mouseClick(tile);
108113 }
109114
@@ -637,6 +642,18 @@ Item {
637642 tryCompare(dashContent, "x", 0);
638643 }
639644
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+
640657 function test_tempScopeItemXOnResize()
641658 {
642659 // Go to a temp scope