on xenial help sign in
New approach to test
5a0ce70Andrea Cimitan
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingList.qml+5−8
@@ -36,11 +36,6 @@ Rectangle {
36 widgetData: settingData
36 widgetData: settingData
37 }
37 }
38
38
39− ScopeSettingList {
40− id: scopeSettingFresh
41− initialValue: 2
42− }
43−
44 SignalSpy {
39 SignalSpy {
45 id: spy
40 id: spy
46 target: scopeSetting
41 target: scopeSetting
@@ -60,9 +55,11 @@ Rectangle {
60 }
55 }
61
56
62 function test_initialValue() {
57 function test_initialValue() {
63− var controlFresh = findChild(scopeSettingFresh, "control");
58+ var newObject = Qt.createQmlObject('import "../../../../qml/Dash/ScopeSettings" \n\
59+ ScopeSettingList { initialValue: 2; }', root, "dynamicScopeSettingList");
64− scopeSettingFresh.widgetData = settingData;
60+ newObject.widgetData = settingData;
61+ var controlDynamic = findChild(newObject, "control");
65− tryCompare(controlFresh, "selectedIndex", 2);
62+ tryCompare(controlDynamic, "selectedIndex", 2);
66 }
63 }
67
64
68 function test_updated_data() {
65 function test_updated_data() {