@@ -39,6 +39,22 @@ Rectangle {
39 widgetId: "previewCommentInput"
39 widgetId: "previewCommentInput"
43+ id: previewCommentInputLoader
47+ top: previewCommentInput.bottom
48+ topMargin: units.gu(2)
51+ sourceComponent: PreviewCommentInput {
52+ widgetData: widgetDataNewLabels
53+ widgetId: "previewCommentInputLoader"
42 SignalSpy {
58 SignalSpy {
44 signalName: "triggered"
60 signalName: "triggered"
@@ -81,5 +97,18 @@ Rectangle {
81 compare(args[2]["comment"], data.inputText);
97 compare(args[2]["comment"], data.inputText);
101+ function test_singleton() {
102+ var commentTextAreaLoader = findChild(previewCommentInputLoader, "commentTextArea")
104+ commentTextAreaLoader.text = "singleton test text";
106+ // Simulate widget being destroyed and recreated
107+ previewCommentInputLoader.active = false;
108+ previewCommentInputLoader.active = true;
110+ commentTextAreaLoader = findChild(previewCommentInputLoader, "commentTextArea")
111+ tryCompare(commentTextAreaLoader, "text", "singleton test text");