diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/composer/qml/View.qml | 1 | ||||
-rw-r--r-- | views/composer/tests/tst_composerview.qml | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/views/composer/qml/View.qml b/views/composer/qml/View.qml index ffab3545..411083ee 100644 --- a/views/composer/qml/View.qml +++ b/views/composer/qml/View.qml | |||
@@ -368,6 +368,7 @@ Kube.View { | |||
368 | 368 | ||
369 | Kube.TextEditor { | 369 | Kube.TextEditor { |
370 | id: textEditor | 370 | id: textEditor |
371 | objectName: "textEditor" | ||
371 | 372 | ||
372 | Layout.fillWidth: true | 373 | Layout.fillWidth: true |
373 | Layout.fillHeight: true | 374 | Layout.fillHeight: true |
diff --git a/views/composer/tests/tst_composerview.qml b/views/composer/tests/tst_composerview.qml index 01547867..61668ecb 100644 --- a/views/composer/tests/tst_composerview.qml +++ b/views/composer/tests/tst_composerview.qml | |||
@@ -138,4 +138,44 @@ TestCase { | |||
138 | tryVerify(function(){ return subject.text == "RE: subject" }) | 138 | tryVerify(function(){ return subject.text == "RE: subject" }) |
139 | tryVerify(function(){ return subject.body != "" }) | 139 | tryVerify(function(){ return subject.body != "" }) |
140 | } | 140 | } |
141 | |||
142 | function test_5loadHtmlDraft() { | ||
143 | var initialState = { | ||
144 | accounts: [{ | ||
145 | id: "account1", | ||
146 | }], | ||
147 | identities: [{ | ||
148 | account: "account1", | ||
149 | name: "Test Identity", | ||
150 | address: "identity@example.org" | ||
151 | }], | ||
152 | resources: [{ | ||
153 | id: "resource1", | ||
154 | account: "account1", | ||
155 | type: "dummy" | ||
156 | }, | ||
157 | { | ||
158 | id: "resource2", | ||
159 | account: "account1", | ||
160 | type: "mailtransport" | ||
161 | }], | ||
162 | mails:[{ | ||
163 | resource: "resource1", | ||
164 | subject: "subject", | ||
165 | body: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\"><html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">p, li { white-space: pre-wrap; }</style></head><body style=\" font-family:'Noto Sans'; font-size:9pt; font-weight:400; font-style:normal;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">body</span></p></body></html>", | ||
166 | to: ["to@example.org"], | ||
167 | cc: ["cc@example.org"], | ||
168 | bcc: ["bcc@example.org"], | ||
169 | }] | ||
170 | } | ||
171 | TestStore.setup(initialState) | ||
172 | |||
173 | var createdMail = TestStore.load("mail", {resource: "resource1"}) | ||
174 | var composer = createTemporaryObject(composerComponent, testCase, {message: createdMail, loadType: Kube.ComposerController.Draft}) | ||
175 | composer.setup() | ||
176 | |||
177 | var textEditor = findChild(composer, "textEditor"); | ||
178 | verify(textEditor) | ||
179 | tryVerify(function(){ return textEditor.htmlEnabled == true }) | ||
180 | } | ||
141 | } | 181 | } |