@@ -42,6 +42,7 @@ Item {
4242
4343 ListModel {
4444 id: mockModel
45+ dynamicRoles: true
4546
4647 signal actionInvoked(string actionId)
4748
@@ -92,7 +93,7 @@ Item {
9293 icon: "../graphics/avatars/amanda.png",
9394 secondaryIcon: "incoming-call",
9495 actions: [{ id: "ok_id", label: "Ok"},
95− { id: "cancel_id", label: "Cancel"}]
96+ { id: "cancel_id", label: "Cancel"}]
9697 }
9798
9899 mockModel.append(n)
@@ -266,6 +267,10 @@ Item {
266267 }
267268 }
268269
270+ ActionModel {
271+ id: myActionModel
272+ }
273+
269274 UnityTestCase {
270275 id: root
271276 name: "NotificationRendererTest"
@@ -305,8 +310,7 @@ Item {
305310 body: "Frank Zappa\n+44 (0)7736 027340",
306311 icon: "../graphics/avatars/amanda.png",
307312 secondaryIcon: "../graphics/applicationIcons/facebook.png",
308− actions: [{ id: "ok_id", label: "Ok"},
309− { id: "cancel_id", label: "Cancel"}],
313+ actions: myActionModel,
310314 summaryVisible: true,
311315 bodyVisible: true,
312316 iconVisible: true,
@@ -536,12 +540,13 @@ Item {
536540 if(data.hasSwipeToAct) {
537541 var swipeButton = findChild(buttonRow, "notify_swipe_button")
538542 var slider = findChild(swipeButton, "slider")
539− var swipeMouseArea = findChild(buttonRow, "swipeMouseArea")
543+ var swipeMouseArea = findChild(swipeButton, "swipeMouseArea")
540544 var x = swipeMouseArea.width / 2
541545 var y = swipeMouseArea.height / 2
542− mousePress(swipeMouseArea, x, y, Qt.LeftButton, Qt.NoModifier, 0)
543− mouseMove(swipeMouseArea, x + units.gu(15), y)
544− mouseRelease(swipeMouseArea, x + units.gu(15), y)
546+ //mouseDrag(swipeButton, x, y, -(swipeMouseArea.width / 2), 0)
547+ tryCompareFunction(function() { mouseDrag(slider, x, y, (swipeMouseArea.width / 2) - slider.width, 0); return actionSpy.signalArguments.length > 0; }, true);
548+ compare(actionSpy.signalArguments[0][0], data.actions.data(1, ActionModel.RoleActionId), "got wrong id for positive action")
549+ actionSpy.clear()
545550 } else {
546551 var buttonCancel = findChild(buttonRow, "notify_button1")
547552 var buttonAccept = findChild(buttonRow, "notify_button0")