@@ -42,6 +42,7 @@ Item {
43 ListModel {
43 ListModel {
44 id: mockModel
44 id: mockModel
46 signal actionInvoked(string actionId)
47 signal actionInvoked(string actionId)
@@ -92,7 +93,7 @@ Item {
92 icon: "../graphics/avatars/amanda.png",
93 icon: "../graphics/avatars/amanda.png",
93 secondaryIcon: "incoming-call",
94 secondaryIcon: "incoming-call",
94 actions: [{ id: "ok_id", label: "Ok"},
95 actions: [{ id: "ok_id", label: "Ok"},
95− { id: "cancel_id", label: "Cancel"}]
96+ { id: "cancel_id", label: "Cancel"}]
98 mockModel.append(n)
99 mockModel.append(n)
@@ -266,6 +267,10 @@ Item {
269 UnityTestCase {
274 UnityTestCase {
271 name: "NotificationRendererTest"
276 name: "NotificationRendererTest"
@@ -305,8 +310,7 @@ Item {
305 body: "Frank Zappa\n+44 (0)7736 027340",
310 body: "Frank Zappa\n+44 (0)7736 027340",
306 icon: "../graphics/avatars/amanda.png",
311 icon: "../graphics/avatars/amanda.png",
307 secondaryIcon: "../graphics/applicationIcons/facebook.png",
312 secondaryIcon: "../graphics/applicationIcons/facebook.png",
308− actions: [{ id: "ok_id", label: "Ok"},
313+ actions: myActionModel,
309− { id: "cancel_id", label: "Cancel"}],
310 summaryVisible: true,
314 summaryVisible: true,
311 bodyVisible: true,
315 bodyVisible: true,
312 iconVisible: true,
316 iconVisible: true,
@@ -536,12 +540,13 @@ Item {
536 if(data.hasSwipeToAct) {
540 if(data.hasSwipeToAct) {
537 var swipeButton = findChild(buttonRow, "notify_swipe_button")
541 var swipeButton = findChild(buttonRow, "notify_swipe_button")
538 var slider = findChild(swipeButton, "slider")
542 var slider = findChild(swipeButton, "slider")
539− var swipeMouseArea = findChild(buttonRow, "swipeMouseArea")
543+ var swipeMouseArea = findChild(swipeButton, "swipeMouseArea")
540 var x = swipeMouseArea.width / 2
544 var x = swipeMouseArea.width / 2
541 var y = swipeMouseArea.height / 2
545 var y = swipeMouseArea.height / 2
542− mousePress(swipeMouseArea, x, y, Qt.LeftButton, Qt.NoModifier, 0)
546+ //mouseDrag(swipeButton, x, y, -(swipeMouseArea.width / 2), 0)
543− mouseMove(swipeMouseArea, x + units.gu(15), y)
547+ tryCompareFunction(function() { mouseDrag(slider, x, y, (swipeMouseArea.width / 2) - slider.width, 0); return actionSpy.signalArguments.length > 0; }, true);
544− mouseRelease(swipeMouseArea, x + units.gu(15), y)
548+ compare(actionSpy.signalArguments[0][0], data.actions.data(1, ActionModel.RoleActionId), "got wrong id for positive action")
546 var buttonCancel = findChild(buttonRow, "notify_button1")
551 var buttonCancel = findChild(buttonRow, "notify_button1")
547 var buttonAccept = findChild(buttonRow, "notify_button0")
552 var buttonAccept = findChild(buttonRow, "notify_button0")