From ec0f93967e210e40d0ddada277866dc599ba2191 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 1 Jul 2018 10:44:30 +0200 Subject: Test html loading in composer Currently fails due to broken test setup --- views/composer/qml/View.qml | 1 + views/composer/tests/tst_composerview.qml | 40 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) 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 { Kube.TextEditor { id: textEditor + objectName: "textEditor" Layout.fillWidth: true 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 { tryVerify(function(){ return subject.text == "RE: subject" }) tryVerify(function(){ return subject.body != "" }) } + + function test_5loadHtmlDraft() { + var initialState = { + accounts: [{ + id: "account1", + }], + identities: [{ + account: "account1", + name: "Test Identity", + address: "identity@example.org" + }], + resources: [{ + id: "resource1", + account: "account1", + type: "dummy" + }, + { + id: "resource2", + account: "account1", + type: "mailtransport" + }], + mails:[{ + resource: "resource1", + subject: "subject", + body: "

body

", + to: ["to@example.org"], + cc: ["cc@example.org"], + bcc: ["bcc@example.org"], + }] + } + TestStore.setup(initialState) + + var createdMail = TestStore.load("mail", {resource: "resource1"}) + var composer = createTemporaryObject(composerComponent, testCase, {message: createdMail, loadType: Kube.ComposerController.Draft}) + composer.setup() + + var textEditor = findChild(composer, "textEditor"); + verify(textEditor) + tryVerify(function(){ return textEditor.htmlEnabled == true }) + } } -- cgit v1.2.3