on xenial help sign in
Got rid of signal actionInvoked in frontend and related tests... now 3 of 8 tests failing again
commit815a6dcdf2888ced9cdb8168be6126582c7a4e54 authorMirco Müller <mirco.mueller@canonical.com> dateFri 14 Jun 2013, 21:44 (13 years ago) parentafaf012
2 files changed+7−19
Notifications/Notification.qml+2−10 tests/qmltests/Notifications/tst_Notifications.qml+5−9
Notifications/Notification.qml+2−10
@@ -30,8 +30,6 @@ UbuntuShape {
3030 property var type
3131 property var notification
3232
33− signal actionInvoked(string buttonId)
34−
3533 implicitHeight: childrenRect.height
3634 color: Qt.rgba(0, 0, 0, 0.85)
3735 opacity: 0
@@ -52,10 +50,7 @@ UbuntuShape {
5250 anchors.fill: contentColumn
5351 objectName: "interactiveArea"
5452 enabled: notification.type == Notification.Interactive
55− onClicked: {
56− notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
57− actionInvoked(actionRepeater.itemAt(0).actionId)
58− }
53+ onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
5954 }
6055
6156 Column {
@@ -161,10 +156,7 @@ UbuntuShape {
161156 width: (buttonRow.width - buttonRow.spacing) / 2
162157 height: units.gu(4)
163158 text: label
164− onClicked: {
165− notification.notification.invokeAction(id)
166− actionInvoked(id)
167− }
159+ onClicked: notification.notification.invokeAction(id)
168160 }
169161 }
170162 }
tests/qmltests/Notifications/tst_Notifications.qml+5−9
@@ -29,12 +29,7 @@ Row {
2929 id: mockNotification
3030
3131 QtObject {
32−
33− signal actionInvoked()
34−
35− function invokeAction(actionId) {
36− actionInvoked()
37− }
32+ function invokeAction(actionId) { }
3833 }
3934 }
4035
@@ -290,7 +285,7 @@ Row {
290285
291286 SignalSpy {
292287 id: actionSpy
293− signalName: "actionInvoked"
288+ signalName: "clicked"
294289 }
295290
296291 function cleanup() {
@@ -321,7 +316,7 @@ Row {
321316 compare(interactiveArea.enabled, data.interactiveAreaEnabled, "check for interactive area")
322317
323318 if(data.interactiveAreaEnabled) {
324− actionSpy.target = notification
319+ actionSpy.target = findChild(notification, "interactiveArea")
325320 mouseClick(notification, notification.width / 2, notification.height / 2)
326321 actionSpy.wait()
327322 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
@@ -341,12 +336,13 @@ Row {
341336 var buttonAccept = findChild(buttonRow, "button0")
342337
343338 waitForRendering(notification)
344− actionSpy.target = notification
339+ actionSpy.target = buttonCancel
345340 mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
346341 actionSpy.wait()
347342 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
348343 actionSpy.clear()
349344
345+ actionSpy.target = buttonAccept
350346 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
351347 actionSpy.wait()
352348 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")