on xenial help sign in
Fix and add test for processingMouseArea.
20c47f3Michał Sawicz
qml/Dash/Previews/Preview.qml+2−2
@@ -48,7 +48,7 @@ Item {
48 }
48 }
49 }
49 }
50
50
51− onPreviewModelChanged: processingMouseArea = false
51+ onPreviewModelChanged: processingMouseArea.enabled = false
52
52
53 MouseArea {
53 MouseArea {
54 anchors.fill: parent
54 anchors.fill: parent
@@ -92,7 +92,7 @@ Item {
92
92
93 MouseArea {
93 MouseArea {
94 id: processingMouseArea
94 id: processingMouseArea
95− objectName: "waitingForActionMouseArea"
95+ objectName: "processingMouseArea"
96 anchors.fill: parent
96 anchors.fill: parent
97 enabled: false
97 enabled: false
98 }
98 }
tests/qmltests/Dash/Previews/tst_Preview.qml+13
@@ -71,5 +71,18 @@ Rectangle {
71 compare(args[1], "mockAction", "Action id not passed correctly.");
71 compare(args[1], "mockAction", "Action id not passed correctly.");
72 compare(args[2]["mock"], "data", "Data not passed correctly.");
72 compare(args[2]["mock"], "data", "Data not passed correctly.");
73 }
73 }
74+
75+ function test_showProcessing() {
76+ var widget = findChild(preview, "widget-3");
77+ widget.triggered(widget.widgetId, "mockAction", {"mock": "data"});
78+
79+ var processing = findChild(preview, "processingMouseArea");
80+
81+ tryCompare(processing, "enabled", true);
82+
83+ preview.previewModelChanged();
84+
85+ tryCompare(processing, "enabled", false);
86+ }
74 }
87 }
75}
88}