@@ -28,16 +28,22 @@ Rectangle {
29 property var comment: {
29 property var comment: {
30 "author": "Claire Thompson",
30 "author": "Claire Thompson",
31− "date": "28/04/2015 3:48pm",
31+ "subtitle": "28/04/2015 3:48pm",
32 "comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
32 "comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
33 "source": "../../graphics/avatars/amanda@12.png"
33 "source": "../../graphics/avatars/amanda@12.png"
36 property var commentNoImage: {
36 property var commentNoImage: {
37 "author": "Claire Thompson",
37 "author": "Claire Thompson",
38− "date": "28/04/2015 3:48pm",
38+ "subtitle": "28/04/2015 3:48pm",
39 "comment": "Been quite a while since I really liked one.",
39 "comment": "Been quite a while since I really liked one.",
40− "source": "null"
40+ "source": ""
43+ property var commentNoSubtitle: {
44+ "author": "Claire Thompson",
45+ "comment": "Been quite a while since I really liked one.",
46+ "source": "../../graphics/avatars/amanda@12.png"
43 PreviewSocialComment {
49 PreviewSocialComment {
@@ -52,7 +58,11 @@ Rectangle {
52 name: "PreviewSocialCommentTest"
58 name: "PreviewSocialCommentTest"
53 when: windowShown
59 when: windowShown
55− function testAnchorsNoAvatar() {
61+ function init() {
62+ previewCommentInput.widgetData = comment;
65+ function test_AnchorsNoAvatar() {
56 var column = findChild(previewCommentInput, "column");
66 var column = findChild(previewCommentInput, "column");
57 var avatar = findChild(previewCommentInput, "avatar");
67 var avatar = findChild(previewCommentInput, "avatar");
@@ -64,5 +74,11 @@ Rectangle {
64 tryCompare(avatar, "visible", false);
74 tryCompare(avatar, "visible", false);
65 compare(column.anchors.left, previewCommentInput.anchors.left);
75 compare(column.anchors.left, previewCommentInput.anchors.left);
78+ function test_OptionalSubtitle() {
79+ var subtitle = findChild(previewCommentInput, "subtitle");
80+ previewCommentInput.widgetData = commentNoSubtitle;
81+ tryCompare(subtitle, "visible", false);