on xenial help sign in
test 5 attributes.
d8825a4Ying-Chun Liu
tests/plugins/Dash/tst_CardAttributes.qml+7−4
@@ -20,16 +20,19 @@ import Dash 0.1
20
20
21Item {
21Item {
22 width: units.gu(40)
22 width: units.gu(40)
23− height: units.gu(30)
23+ height: units.gu(4.5)
24
24
25 property var testData: [
25 property var testData: [
26 [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"}],
26 [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"}],
27− [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"},{"value":"text3"}]
27+ [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"},{"value":"text3"}],
28+ [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"},{"value":"text3"},{"value":"text4"}],
29+ [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"},{"value":"text3","style":"highlighted"},{"value":"text4","icon":"image://theme/close","style":"highlighted"},{"value":"text5"}]
28 ]
30 ]
29
31
30 CardAttributes {
32 CardAttributes {
31 id: cardAttributes
33 id: cardAttributes
32− model: testData[0]
34+ model: testData[3]
35+ clip: true
33 }
36 }
34
37
35 TestCase {
38 TestCase {
@@ -45,7 +48,7 @@ Item {
45
48
46 function test_columns(data) {
49 function test_columns(data) {
47 cardAttributes.model = data;
50 cardAttributes.model = data;
48− compare(cardAttributes.columns, data.length);
51+ compare(cardAttributes.columns, 2 + data.length % 2);
49 }
52 }
50 }
53 }
51}
54}