on xenial help sign in
Fix unit tests
commit45c23c58b370711e46241f1756dc07b56f0410dc authorYing-Chun Liu <paul.liu@canonical.com> dateMon 20 Oct 2014, 23:30 (12 years ago) parent4e4313b
9 files changed+22−8
plugins/Dash/CardCreator.js+2−1 tests/plugins/Dash/cardcreator/1.res+2−1 tests/plugins/Dash/cardcreator/2.res+2−1 tests/plugins/Dash/cardcreator/3.res+2−1 tests/plugins/Dash/cardcreator/4.res+2−1 tests/plugins/Dash/cardcreator/5.res+2−1 tests/plugins/Dash/cardcreator/6.res+2−1 tests/plugins/Dash/cardcreator/7.res+2−1 tests/qmltests/Dash/tst_GenericScopeView.qml+6
plugins/Dash/CardCreator.js+2−1
@@ -319,7 +319,8 @@ function cardString(template, components) {
319319 property bool asynchronous: true; \n\
320320 property bool showHeader: true; \n\
321321 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';
323324
324325 var hasArt = components["art"] && components["art"]["field"] || false;
325326 var hasSummary = components["summary"] || false;
tests/plugins/Dash/cardcreator/1.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
1313 property bool asynchronous: true;
1414 property bool showHeader: true;
1515 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+
1718onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1819readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1920Item {
tests/plugins/Dash/cardcreator/2.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
1313 property bool asynchronous: true;
1414 property bool showHeader: true;
1515 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+
1718Loader {
1819 id: backgroundLoader;
1920 objectName: "backgroundLoader";
tests/plugins/Dash/cardcreator/3.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
1313 property bool asynchronous: true;
1414 property bool showHeader: true;
1515 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+
1718onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1819readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1920Item {
tests/plugins/Dash/cardcreator/4.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
1313 property bool asynchronous: true;
1414 property bool showHeader: true;
1515 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+
1718readonly property size artShapeSize: Qt.size(-1, -1);
1819readonly property int headerHeight: row.height;
1920Row {
tests/plugins/Dash/cardcreator/5.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
1313 property bool asynchronous: true;
1414 property bool showHeader: true;
1515 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+
1718onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1819readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1920Item {
tests/plugins/Dash/cardcreator/6.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
1313 property bool asynchronous: true;
1414 property bool showHeader: true;
1515 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+
1718Loader {
1819 id: backgroundLoader;
1920 objectName: "backgroundLoader";
tests/plugins/Dash/cardcreator/7.res+2−1
@@ -13,7 +13,8 @@ AbstractButton {
1313 property bool asynchronous: true;
1414 property bool showHeader: true;
1515 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+
1718Loader {
1819 id: backgroundLoader;
1920 objectName: "backgroundLoader";
tests/qmltests/Dash/tst_GenericScopeView.qml+6
@@ -622,6 +622,9 @@ Item {
622622
623623 var item0 = findChild(cardGrid, "delegate0");
624624 waitForRendering(item0);
625+ item0.template = cardTool.template;
626+ compare(item0.template["non-interactive"], true);
627+ compare(item0.enabled, false);
625628 var touchdown = findChild(item0, "touchdown");
626629
627630 compare(touchdown.visible, false);
@@ -630,6 +633,9 @@ Item {
630633
631634 cardTool.template["non-interactive"] = false;
632635 compare(cardGrid.cardTool.template["non-interactive"], false);
636+ item0.template = cardTool.template;
637+ compare(item0.template["non-interactive"], false);
638+ compare(item0.enabled, true);
633639 }
634640 }
635641 }