on xenial help sign in
Test initialValue
83c8744Andrea Cimitan
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingList.qml+11−1
@@ -32,8 +32,8 @@ Rectangle {
32
32
33 ScopeSettingList {
33 ScopeSettingList {
34 id: scopeSetting
34 id: scopeSetting
35− widgetData: settingData
36 width: parent.width
35 width: parent.width
36+ initialValue: 2
37 }
37 }
38
38
39 SignalSpy {
39 SignalSpy {
@@ -49,11 +49,21 @@ Rectangle {
49
49
50 property var control: findChild(scopeSetting, "control")
50 property var control: findChild(scopeSetting, "control")
51
51
52+ function initTestCase() {
53+ scopeSetting.widgetData = settingData;
54+ }
55+
52 function cleanup() {
56 function cleanup() {
53 control.selectedIndex = 0;
57 control.selectedIndex = 0;
54 spy.clear();
58 spy.clear();
55 }
59 }
56
60
61+ function test_0initialValue() {
62+ // this works because is the first test to run
63+ tryCompare(control, "selectedIndex", 2);
64+ scopeSetting.initialValue = -1;
65+ }
66+
57 function test_updated_data() {
67 function test_updated_data() {
58 return [
68 return [
59 { tag: "current", index: 0, updated: false },
69 { tag: "current", index: 0, updated: false },