on xenial help sign in
fixing proposal
bb84217Diego Sarmentero
qml/Dash/Previews/PreviewPayments.qml+2−4
@@ -44,7 +44,7 @@ PreviewWidget {
44 anchors.right: parent.right
44 anchors.right: parent.right
45 width: (root.width - units.gu(1)) / 2
45 width: (root.width - units.gu(1)) / 2
46 visible: paymentButton.opacity == 0 ? false : true
46 visible: paymentButton.opacity == 0 ? false : true
47− Behavior on opacity { PropertyAnimation {duration: UbuntuAnimation.FastDuration}}
47+ Behavior on opacity { PropertyAnimation { duration: UbuntuAnimation.FastDuration } }
48
48
49 Payments {
49 Payments {
50 id: paymentClient
50 id: paymentClient
@@ -69,8 +69,6 @@ PreviewWidget {
69 indeterminate: true
69 indeterminate: true
70 anchors.fill: paymentButton
70 anchors.fill: paymentButton
71 opacity: 1 - paymentsButton.opacity
71 opacity: 1 - paymentsButton.opacity
72− visible: loadingBar.opacity == 0 ? false : true
72+ visible: opacity == 0 ? false : true
73−
74− Behavior on opacity { PropertyAnimation {duration: UbuntuAnimation.FastDuration}}
75 }
73 }
76}
74}
tests/qmltests/Dash/Previews/tst_PreviewPayments.qml+9−11
@@ -68,17 +68,15 @@ Rectangle {
68
68
69 var button = findChild(root, "paymentButton");
69 var button = findChild(root, "paymentButton");
70 verify(button != null, "Button not found.");
70 verify(button != null, "Button not found.");
71− var progress = findChild(root, "loadingBar");
72− verify(progress != null, "ProgressBar not found.");
73
71
74 mouseClick(button, button.width / 2, button.height / 2);
72 mouseClick(button, button.width / 2, button.height / 2);
75
73
76 spy.wait();
74 spy.wait();
77
75
78− verify(progress.visible == true, "ProgressBar not visible.");
76+ var args = spy.signalArguments[0];
79− verify(progress.opacity == 1, "ProgressBar wrong opacity.");
77+ compare(args[0], "previewPayments");
80− verify(button.visible == false, "Button visible.");
78+ compare(args[1], "purchaseCompleted");
81− verify(button.opacity == 0, "Button wrong opacity.");
79+ compare(args[2], jsonPurchase["source"]);
82 }
80 }
83
81
84 function test_progress_show() {
82 function test_progress_show() {
@@ -86,16 +84,16 @@ Rectangle {
86 previewPayments.widgetData = jsonPurchase;
84 previewPayments.widgetData = jsonPurchase;
87
85
88 var button = findChild(root, "paymentButton");
86 var button = findChild(root, "paymentButton");
89− verify(button != null, "Button not found.");
87+ var progress = findChild(root, "loadingBar");
90
88
91 mouseClick(button, button.width / 2, button.height / 2);
89 mouseClick(button, button.width / 2, button.height / 2);
92
90
93 spy.wait();
91 spy.wait();
94
92
95− var args = spy.signalArguments[0];
93+ tryCompare(progress, "visible", true);
96− compare(args[0], "previewPayments");
94+ tryCompare(progress, "opacity", 1);
97− compare(args[1], "purchaseCompleted");
95+ tryCompare(button, "visible", false);
98− compare(args[2], jsonPurchase["source"]);
96+ tryCompare(button, "opacity", 0);
99 }
97 }
100
98
101 function test_purchase_error() {
99 function test_purchase_error() {