on xenial help sign in
fixed tests for r117
22d7190Nick Dedekind
tests/qmltests/Panel/tst_IndicatorItem.qml+10−16
@@ -34,34 +34,28 @@ Rectangle {
34 UT.UnityTestCase {
34 UT.UnityTestCase {
35 name: "IndicatorItem"
35 name: "IndicatorItem"
36
36
37− function init_test() {
38− }
39−
40 function test_dimmed() {
37 function test_dimmed() {
41− init_test()
42−
43− indicatorItem.dimmed = true
38+ indicatorItem.dimmed = false;
44− compare(indicatorItem.opacity > 0, true, "IndicatorItem opacity should not be 0")
39+ tryCompareFunction(function(){return indicatorItem.opacity}, 1.0);
40+ indicatorItem.dimmed = true;
45− compare(indicatorItem.opacity < 1, true, "IndicatorItem opacity should not be 1")
41+ tryCompareFunction(function(){return indicatorItem.opacity < 1.0}, true);
46 }
42 }
47
43
48 function test_highlight() {
44 function test_highlight() {
49− var itemHighlight = findChild(indicatorItem, "highlight")
45+ var itemHighlight = findChild(indicatorItem, "highlight");
50− verify(itemHighlight != undefined)
46+ verify(itemHighlight != undefined);
51
47
52 indicatorItem.highlighted = true;
48 indicatorItem.highlighted = true;
53− compare(itemHighlight.visible, true, "Indicator should be highlighted")
49+ compare(itemHighlight.visible, true, "Indicator should be highlighted");
54
50
55 indicatorItem.highlighted = false;
51 indicatorItem.highlighted = false;
56− compare(itemHighlight.visible, false, "Indicator should not be highlighted")
52+ compare(itemHighlight.visible, false, "Indicator should not be highlighted");
57 }
53 }
58
54
59 function test_empty() {
55 function test_empty() {
60− init_test()
61−
62− compare(indicatorItem.visible, false, "IndicatorItem should not be visible.")
56+ compare(indicatorItem.visible, false, "IndicatorItem should not be visible.");
63 indicatorItem.widgetSource = "qrc:/tests/indciators/qml/fake_menu_widget1.qml";
57 indicatorItem.widgetSource = "qrc:/tests/indciators/qml/fake_menu_widget1.qml";
64− tryCompare(indicatorItem, "visible", true)
58+ tryCompare(indicatorItem, "visible", true);
65 }
59 }
66 }
60 }
67}
61}