on xenial help sign in
Got rid of signal actionInvoked in frontend and related tests... now 3 of 8 tests failing again
815a6dcMirco Müller
Notifications/Notification.qml+2−10
@@ -30,8 +30,6 @@ UbuntuShape {
30 property var type
30 property var type
31 property var notification
31 property var notification
32
32
33− signal actionInvoked(string buttonId)
34−
35 implicitHeight: childrenRect.height
33 implicitHeight: childrenRect.height
36 color: Qt.rgba(0, 0, 0, 0.85)
34 color: Qt.rgba(0, 0, 0, 0.85)
37 opacity: 0
35 opacity: 0
@@ -52,10 +50,7 @@ UbuntuShape {
52 anchors.fill: contentColumn
50 anchors.fill: contentColumn
53 objectName: "interactiveArea"
51 objectName: "interactiveArea"
54 enabled: notification.type == Notification.Interactive
52 enabled: notification.type == Notification.Interactive
55− onClicked: {
56− notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
53+ onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
57− actionInvoked(actionRepeater.itemAt(0).actionId)
58− }
59 }
54 }
60
55
61 Column {
56 Column {
@@ -161,10 +156,7 @@ UbuntuShape {
161 width: (buttonRow.width - buttonRow.spacing) / 2
156 width: (buttonRow.width - buttonRow.spacing) / 2
162 height: units.gu(4)
157 height: units.gu(4)
163 text: label
158 text: label
164− onClicked: {
165− notification.notification.invokeAction(id)
159+ onClicked: notification.notification.invokeAction(id)
166− actionInvoked(id)
167− }
168 }
160 }
169 }
161 }
170 }
162 }
tests/qmltests/Notifications/tst_Notifications.qml+5−9
@@ -29,12 +29,7 @@ Row {
29 id: mockNotification
29 id: mockNotification
30
30
31 QtObject {
31 QtObject {
32−
33− signal actionInvoked()
34−
35− function invokeAction(actionId) {
32+ function invokeAction(actionId) { }
36− actionInvoked()
37− }
38 }
33 }
39 }
34 }
40
35
@@ -290,7 +285,7 @@ Row {
290
285
291 SignalSpy {
286 SignalSpy {
292 id: actionSpy
287 id: actionSpy
293− signalName: "actionInvoked"
288+ signalName: "clicked"
294 }
289 }
295
290
296 function cleanup() {
291 function cleanup() {
@@ -321,7 +316,7 @@ Row {
321 compare(interactiveArea.enabled, data.interactiveAreaEnabled, "check for interactive area")
316 compare(interactiveArea.enabled, data.interactiveAreaEnabled, "check for interactive area")
322
317
323 if(data.interactiveAreaEnabled) {
318 if(data.interactiveAreaEnabled) {
324− actionSpy.target = notification
319+ actionSpy.target = findChild(notification, "interactiveArea")
325 mouseClick(notification, notification.width / 2, notification.height / 2)
320 mouseClick(notification, notification.width / 2, notification.height / 2)
326 actionSpy.wait()
321 actionSpy.wait()
327 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
322 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
@@ -341,12 +336,13 @@ Row {
341 var buttonAccept = findChild(buttonRow, "button0")
336 var buttonAccept = findChild(buttonRow, "button0")
342
337
343 waitForRendering(notification)
338 waitForRendering(notification)
344− actionSpy.target = notification
339+ actionSpy.target = buttonCancel
345 mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
340 mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
346 actionSpy.wait()
341 actionSpy.wait()
347 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
342 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
348 actionSpy.clear()
343 actionSpy.clear()
349
344
345+ actionSpy.target = buttonAccept
350 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
346 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
351 actionSpy.wait()
347 actionSpy.wait()
352 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
348 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")