diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/kube/tests/tst_composerview.qml | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/components/kube/tests/tst_composerview.qml b/components/kube/tests/tst_composerview.qml index d9cd2dfb..a315c79a 100644 --- a/components/kube/tests/tst_composerview.qml +++ b/components/kube/tests/tst_composerview.qml | |||
@@ -49,16 +49,6 @@ TestCase { | |||
49 | verify(newMailButton.activeFocus) | 49 | verify(newMailButton.activeFocus) |
50 | } | 50 | } |
51 | 51 | ||
52 | Component { | ||
53 | id: controllerComponent | ||
54 | Kube.DomainObjectController {} | ||
55 | } | ||
56 | |||
57 | Component { | ||
58 | id: outboxComponent | ||
59 | Kube.OutboxModel {} | ||
60 | } | ||
61 | |||
62 | function test_3sendMessage() { | 52 | function test_3sendMessage() { |
63 | var initialState = { | 53 | var initialState = { |
64 | accounts: [{ | 54 | accounts: [{ |
@@ -78,26 +68,21 @@ TestCase { | |||
78 | id: "resource2", | 68 | id: "resource2", |
79 | account: "account1", | 69 | account: "account1", |
80 | type: "mailtransport" | 70 | type: "mailtransport" |
71 | }], | ||
72 | mails:[{ | ||
73 | resource: "resource1", | ||
74 | subject: "subject", | ||
75 | body: "body", | ||
76 | to: ["to@example.org"], | ||
77 | cc: ["cc@example.org"], | ||
78 | bcc: ["bcc@example.org"], | ||
79 | draft: true | ||
81 | }] | 80 | }] |
82 | } | 81 | } |
83 | TestStore.setup(initialState) | 82 | TestStore.setup(initialState) |
84 | var composer = createTemporaryObject(composerComponent, testCase, {}) | 83 | var composer = createTemporaryObject(composerComponent, testCase, {}) |
85 | 84 | ||
86 | var domainObjectController = controllerComponent.createObject(null, {blocking: true}) | 85 | var createdMail = TestStore.load("mail", {resource: "resource1"}) |
87 | var mail = { | ||
88 | type: "mail", | ||
89 | subject: "subject", | ||
90 | body: "body", | ||
91 | to: ["to@example.org"], | ||
92 | cc: ["cc@example.org"], | ||
93 | bcc: ["bcc@example.org"], | ||
94 | draft: true | ||
95 | } | ||
96 | domainObjectController.create(mail) | ||
97 | |||
98 | tryVerify(function(){ return domainObjectController.currentObject }) | ||
99 | var createdMail = domainObjectController.currentObject | ||
100 | verify(createdMail) | ||
101 | 86 | ||
102 | var loadAsDraft = true | 87 | var loadAsDraft = true |
103 | composer.loadMessage(createdMail, loadAsDraft) | 88 | composer.loadMessage(createdMail, loadAsDraft) |
@@ -105,7 +90,9 @@ TestCase { | |||
105 | verify(sendMailButton) | 90 | verify(sendMailButton) |
106 | tryVerify(function(){ return sendMailButton.enabled }) | 91 | tryVerify(function(){ return sendMailButton.enabled }) |
107 | sendMailButton.clicked() | 92 | sendMailButton.clicked() |
108 | var outbox = outboxComponent.createObject(null, {}) | 93 | |
109 | tryCompare(outbox, "count", 1) | 94 | tryVerify(function(){ return TestStore.load("mail", {resource: "resource2"}) }) |
95 | //TODO ensure draft is deleted | ||
96 | //TODO ensure draft is deleted | ||
110 | } | 97 | } |
111 | } | 98 | } |