on xenial help sign in
fix tests
de4e86dLukáš Tinkl
qml/Notifications/Notification.qml+1
@@ -240,6 +240,7 @@ StyledItem {
240
240
241 Row {
241 Row {
242 id: topRow
242 id: topRow
243+ objectName: "topRow"
243
244
244 spacing: notification.margins
245 spacing: notification.margins
245 anchors {
246 anchors {
tests/qmltests/Notifications/tst_Notifications.qml+10−10
@@ -571,10 +571,12 @@ Item {
571 waitForRendering(notifications);
571 waitForRendering(notifications);
572
572
573 var notification = findChild(notifications, "notification" + (mockModel.count - 1))
573 var notification = findChild(notifications, "notification" + (mockModel.count - 1))
574− verify(notification !== undefined, "notification wasn't found");
575−
576 waitForRendering(notification);
574 waitForRendering(notification);
575+ verify(notification, "notification wasn't found");
576+
577+ var topRow = findChild(notification, "topRow");
577− tryCompare(notification, "height", notification.state === "contracted" ? units.gu(10) : notification.implicitHeight);
578+ tryCompare(notification, "height", notification.state === "contracted" ? topRow.childrenRect.height + notification.margins * 2
579+ : notification.implicitHeight);
578
580
579 var icon = findChild(notification, "icon")
581 var icon = findChild(notification, "icon")
580 var centeredIcon = findChild(notification, "centeredIcon")
582 var centeredIcon = findChild(notification, "centeredIcon")
@@ -585,7 +587,6 @@ Item {
585 var buttonRow = findChild(notification, "buttonRow")
587 var buttonRow = findChild(notification, "buttonRow")
586 var valueIndicator = findChild(notification, "valueIndicator")
588 var valueIndicator = findChild(notification, "valueIndicator")
587 var valueLabel = findChild(notification, "valueLabel")
589 var valueLabel = findChild(notification, "valueLabel")
588− var innerBar = findChild(notification, "innerBar")
589
590
590 compare(icon.visible, data.iconVisible, "avatar-icon visibility is incorrect")
591 compare(icon.visible, data.iconVisible, "avatar-icon visibility is incorrect")
591 if (icon.visible) {
592 if (icon.visible) {
@@ -596,9 +597,6 @@ Item {
596 compare(centeredIcon.shaped, data.shaped, "shaped-status is incorrect")
597 compare(centeredIcon.shaped, data.shaped, "shaped-status is incorrect")
597 }
598 }
598 compare(valueIndicator.visible, data.valueVisible, "value-indicator visibility is incorrect")
599 compare(valueIndicator.visible, data.valueVisible, "value-indicator visibility is incorrect")
599− if (valueIndicator.visible) {
600− verify(innerBar.color === data.valueTinted ? UbuntuColors.orange : "white", "value-bar has the wrong color-tint")
601− }
602 compare(valueLabel.visible, data.valueLabelVisible, "value-label visibility is incorrect")
600 compare(valueLabel.visible, data.valueLabelVisible, "value-label visibility is incorrect")
603
601
604 // test input does not fall through
602 // test input does not fall through
@@ -618,7 +616,9 @@ Item {
618 // for their height animations to finish before continuing
616 // for their height animations to finish before continuing
619 for (var i = 0; i < mockModel.count; ++i) {
617 for (var i = 0; i < mockModel.count; ++i) {
620 var n = findChild(notifications, "notification" + i)
618 var n = findChild(notifications, "notification" + i)
619+ waitForRendering(n);
620+ var topRow = findChild(n, "topRow");
621− tryCompare(n, "height", n.state === "contracted" ? units.gu(10) : n.implicitHeight);
621+ tryCompare(n, "height", n.state === "contracted" ? topRow.childrenRect.height + n.margins * 2 : n.implicitHeight);
622 }
622 }
623
623
624 if (data.hasSound) {
624 if (data.hasSound) {
@@ -651,7 +651,7 @@ Item {
651 tryCompareFunction(function() { return comboButton.expanded === false; }, true);
651 tryCompareFunction(function() { return comboButton.expanded === false; }, true);
652
652
653 // click to expand
653 // click to expand
654− tryCompareFunction(function() { mouseClick(comboButton, comboButton.width / 2, comboButton.height / 2); return comboButton.expanded === true; }, true);
654+ tryCompareFunction(function() { mouseClick(comboButton, comboButton.width / 2, comboButton.height / 2); return comboButton.expanded; }, true);
655
655
656 // try clicking on choices in expanded comboList
656 // try clicking on choices in expanded comboList
657 var choiceButton1 = findChild(notification, "notify_button3")
657 var choiceButton1 = findChild(notification, "notify_button3")
@@ -665,7 +665,7 @@ Item {
665 actionSpy.clear()
665 actionSpy.clear()
666
666
667 // click to collapse
667 // click to collapse
668− tryCompareFunction(function() { mouseClick(comboButton, comboButton.width / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
668+ tryCompareFunction(function() { mouseClick(comboButton, comboButton.width / 2, comboButton.height / 2); return !comboButton.expanded; }, true);
669 } else {
669 } else {
670 mouseClick(buttonCancel)
670 mouseClick(buttonCancel)
671 compare(actionSpy.signalArguments[0][0], data.n.actions.data(1, ActionModel.RoleActionId), "got wrong id for negative action")
671 compare(actionSpy.signalArguments[0][0], data.n.actions.data(1, ActionModel.RoleActionId), "got wrong id for negative action")
tests/qmltests/Notifications/tst_SwipeToAct.qml+1
@@ -302,6 +302,7 @@ Item {
302
302
303 // add a mock mouse, test clicking the left/right buttons
303 // add a mock mouse, test clicking the left/right buttons
304 notifications.hasMouse = true;
304 notifications.hasMouse = true;
305+ waitForRendering(notification);
305 var leftButton = findChild(swipeButton, "leftButton");
306 var leftButton = findChild(swipeButton, "leftButton");
306 var rightButton = findChild(swipeButton, "rightButton");
307 var rightButton = findChild(swipeButton, "rightButton");
307
308