on xenial help sign in
Fix unit tests
45c23c5Ying-Chun Liu
plugins/Dash/CardCreator.js+2−1
@@ -319,7 +319,8 @@ function cardString(template, components) {
319 property bool asynchronous: true; \n\
319 property bool asynchronous: true; \n\
320 property bool showHeader: true; \n\
320 property bool showHeader: true; \n\
321 implicitWidth: childrenRect.width; \n\
321 implicitWidth: childrenRect.width; \n\
322− enabled: template == null || (template["non-interactive"] !== undefined ? !template["non-interactive"] : true); \n';
322+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); \n\
323+ \n';
323
324
324 var hasArt = components["art"] && components["art"]["field"] || false;
325 var hasArt = components["art"] && components["art"]["field"] || false;
325 var hasSummary = components["summary"] || false;
326 var hasSummary = components["summary"] || false;
tests/plugins/Dash/cardcreator/1.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
13 property bool asynchronous: true;
13 property bool asynchronous: true;
14 property bool showHeader: true;
14 property bool showHeader: true;
15 implicitWidth: childrenRect.width;
15 implicitWidth: childrenRect.width;
16− enabled: template == null || (template["non-interactive"] !== undefined ? !template["non-interactive"] : true);
16+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
17+
17onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
18onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
18readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
19readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
19Item {
20Item {
tests/plugins/Dash/cardcreator/2.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
13 property bool asynchronous: true;
13 property bool asynchronous: true;
14 property bool showHeader: true;
14 property bool showHeader: true;
15 implicitWidth: childrenRect.width;
15 implicitWidth: childrenRect.width;
16− enabled: template == null || (template["non-interactive"] !== undefined ? !template["non-interactive"] : true);
16+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
17+
17Loader {
18Loader {
18 id: backgroundLoader;
19 id: backgroundLoader;
19 objectName: "backgroundLoader";
20 objectName: "backgroundLoader";
tests/plugins/Dash/cardcreator/3.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
13 property bool asynchronous: true;
13 property bool asynchronous: true;
14 property bool showHeader: true;
14 property bool showHeader: true;
15 implicitWidth: childrenRect.width;
15 implicitWidth: childrenRect.width;
16− enabled: template == null || (template["non-interactive"] !== undefined ? !template["non-interactive"] : true);
16+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
17+
17onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
18onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
18readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
19readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
19Item {
20Item {
tests/plugins/Dash/cardcreator/4.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
13 property bool asynchronous: true;
13 property bool asynchronous: true;
14 property bool showHeader: true;
14 property bool showHeader: true;
15 implicitWidth: childrenRect.width;
15 implicitWidth: childrenRect.width;
16− enabled: template == null || (template["non-interactive"] !== undefined ? !template["non-interactive"] : true);
16+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
17+
17readonly property size artShapeSize: Qt.size(-1, -1);
18readonly property size artShapeSize: Qt.size(-1, -1);
18readonly property int headerHeight: row.height;
19readonly property int headerHeight: row.height;
19Row {
20Row {
tests/plugins/Dash/cardcreator/5.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
13 property bool asynchronous: true;
13 property bool asynchronous: true;
14 property bool showHeader: true;
14 property bool showHeader: true;
15 implicitWidth: childrenRect.width;
15 implicitWidth: childrenRect.width;
16− enabled: template == null || (template["non-interactive"] !== undefined ? !template["non-interactive"] : true);
16+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
17+
17onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
18onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
18readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
19readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
19Item {
20Item {
tests/plugins/Dash/cardcreator/6.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
13 property bool asynchronous: true;
13 property bool asynchronous: true;
14 property bool showHeader: true;
14 property bool showHeader: true;
15 implicitWidth: childrenRect.width;
15 implicitWidth: childrenRect.width;
16− enabled: template == null || (template["non-interactive"] !== undefined ? !template["non-interactive"] : true);
16+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
17+
17Loader {
18Loader {
18 id: backgroundLoader;
19 id: backgroundLoader;
19 objectName: "backgroundLoader";
20 objectName: "backgroundLoader";
tests/plugins/Dash/cardcreator/7.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
13 property bool asynchronous: true;
13 property bool asynchronous: true;
14 property bool showHeader: true;
14 property bool showHeader: true;
15 implicitWidth: childrenRect.width;
15 implicitWidth: childrenRect.width;
16− enabled: template == null || (template["non-interactive"] !== undefined ? !template["non-interactive"] : true);
16+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
17+
17Loader {
18Loader {
18 id: backgroundLoader;
19 id: backgroundLoader;
19 objectName: "backgroundLoader";
20 objectName: "backgroundLoader";
tests/qmltests/Dash/tst_GenericScopeView.qml+6
@@ -622,6 +622,9 @@ Item {
622
622
623 var item0 = findChild(cardGrid, "delegate0");
623 var item0 = findChild(cardGrid, "delegate0");
624 waitForRendering(item0);
624 waitForRendering(item0);
625+ item0.template = cardTool.template;
626+ compare(item0.template["non-interactive"], true);
627+ compare(item0.enabled, false);
625 var touchdown = findChild(item0, "touchdown");
628 var touchdown = findChild(item0, "touchdown");
626
629
627 compare(touchdown.visible, false);
630 compare(touchdown.visible, false);
@@ -630,6 +633,9 @@ Item {
630
633
631 cardTool.template["non-interactive"] = false;
634 cardTool.template["non-interactive"] = false;
632 compare(cardGrid.cardTool.template["non-interactive"], false);
635 compare(cardGrid.cardTool.template["non-interactive"], false);
636+ item0.template = cardTool.template;
637+ compare(item0.template["non-interactive"], false);
638+ compare(item0.enabled, true);
633 }
639 }
634 }
640 }
635 }
641 }