on xenial help sign in
Bigger coverage.
5fed263Michał Sawicz
tests/qmltests/Dash/tst_CardTool.qml+19−11
@@ -73,8 +73,8 @@ Rectangle {
73 "layout": { "components": Helpers.update(JSON.parse(Helpers.fullMapping), { "art": {"aspect-ratio": 0.5, "summary": undefined }}) }
73 "layout": { "components": Helpers.update(JSON.parse(Helpers.fullMapping), { "art": {"aspect-ratio": 0.5, "summary": undefined }}) }
74 },
74 },
75 {
75 {
76− "name": "Title - centered",
76+ "name": "Title - vertical",
77− "layout": { "template": { "card-layout": "vertical" }, "components": { "title": { "field": "title", "align": "center" } } }
77+ "layout": { "template": { "card-layout": "vertical" }, "components": { "title": "title" } }
78 },
78 },
79 {
79 {
80 "name": "Title - horizontal",
80 "name": "Title - horizontal",
@@ -88,10 +88,6 @@ Rectangle {
88 "name": "Title, attributes - horizontal",
88 "name": "Title, attributes - horizontal",
89 "layout": { "template": { "card-layout": "horizontal" }, "components": { "title": "title", "attributes": "attributes" } }
89 "layout": { "template": { "card-layout": "horizontal" }, "components": { "title": "title", "attributes": "attributes" } }
90 },
90 },
91− {
92− "name": "Title, attributes - centered",
93− "layout": { "template": { "card-layout": "vertical" }, "components": { "title": "title", "attributes": "attributes" } }
94− },
95 ]
91 ]
96
92
97 CardTool {
93 CardTool {
@@ -322,11 +318,21 @@ Rectangle {
322
318
323 function test_card_title_alignment_data() {
319 function test_card_title_alignment_data() {
324 return [
320 return [
321+ { tag: "Art, header, summary", value: Text.AlignLeft, index: 0 },
322+ { tag: "Header, summary", value: Text.AlignLeft, index: 1 },
323+ { tag: "Art, header", value: Text.AlignLeft, index: 2 },
324+ { tag: "Header only", value: Text.AlignLeft, index: 3 },
325+ { tag: "Header title only", value: Text.AlignHCenter, index: 4 },
326+ { tag: "Header title and subtitle", value: Text.AlignLeft, index: 5 },
327+ { tag: "Header title and mascot", value: Text.AlignLeft, index: 6 },
328+ { tag: "Art, header, summary - small", value: Text.AlignLeft, index: 7 },
329+ { tag: "Art, header, summary - large", value: Text.AlignLeft, index: 8 },
330+ { tag: "Art, header, summary - horizontal", value: Text.AlignLeft, index: 9 },
331+ { tag: "Art, header - portrait", value: Text.AlignLeft, index: 10 },
325− { tag: "Title - centered", value: Text.AlignHCenter, index: 11, layout_index: 0 },
332+ { tag: "Title - vertical", value: Text.AlignHCenter, index: 11 },
326− { tag: "Title - horizontal", value: Text.AlignLeft, index: 12, layout_index: 0},
333+ { tag: "Title - horizontal", value: Text.AlignLeft, index: 12 },
327− { tag: "Title, subtitle - vertical", value: Text.AlignLeft, index: 13, layout_index: 0},
334+ { tag: "Title, subtitle - vertical", value: Text.AlignLeft, index: 13 },
328− { tag: "Title, attribute - horizontal", value: Text.AlignLeft, index: 14, layout_index: 0},
335+ { tag: "Title, attributes - horizontal", value: Text.AlignLeft, index: 14 },
329− { tag: "Title, attribute - centered", value: Text.AlignLeft, index: 15, layout_index: 0},
330 ];
336 ];
331 }
337 }
332
338
@@ -336,6 +342,8 @@ Rectangle {
336 layoutSelector.selectedIndex = data.layout_index;
342 layoutSelector.selectedIndex = data.layout_index;
337 }
343 }
338
344
345+ cardTool.components['title'] = { "field": "title", "align": "center" };
346+
339 if (data.hasOwnProperty("property")) {
347 if (data.hasOwnProperty("property")) {
340 tryCompare(cardTool, "titleAlignment", data.value);
348 tryCompare(cardTool, "titleAlignment", data.value);
341 }
349 }