diff options
Diffstat (limited to 'views/conversation')
-rw-r--r-- | views/conversation/tests/tst_conversationview.qml | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/views/conversation/tests/tst_conversationview.qml b/views/conversation/tests/tst_conversationview.qml index 610c28b3..666114fd 100644 --- a/views/conversation/tests/tst_conversationview.qml +++ b/views/conversation/tests/tst_conversationview.qml | |||
@@ -115,6 +115,69 @@ TestCase { | |||
115 | verify(conversationView) | 115 | verify(conversationView) |
116 | var listView = findChild(conversationView, "listView"); | 116 | var listView = findChild(conversationView, "listView"); |
117 | verify(listView) | 117 | verify(listView) |
118 | // tryCompare(listView, "count", 2) | 118 | } |
119 | |||
120 | function test_4moveToTrash() { | ||
121 | var initialState = { | ||
122 | accounts: [{ | ||
123 | id: "account1", | ||
124 | name: "Test Account" | ||
125 | }], | ||
126 | identities: [{ | ||
127 | account: "account1", | ||
128 | name: "Test Identity", | ||
129 | address: "identity@example.org" | ||
130 | }], | ||
131 | resources: [{ | ||
132 | id: "resource1", | ||
133 | account: "account1", | ||
134 | type: "dummy" | ||
135 | }, | ||
136 | { | ||
137 | id: "resource2", | ||
138 | account: "account1", | ||
139 | type: "mailtransport" | ||
140 | }], | ||
141 | folders: [{ | ||
142 | id: "folder1", | ||
143 | resource: "resource1", | ||
144 | name: "Folder 1", | ||
145 | specialpurpose: ["inbox"], | ||
146 | mails: [{ | ||
147 | resource: "resource1", | ||
148 | subject: "subject1", | ||
149 | body: "body", | ||
150 | to: ["to@example.org"], | ||
151 | cc: ["cc@example.org"], | ||
152 | bcc: ["bcc@example.org"] | ||
153 | } | ||
154 | ], | ||
155 | }], | ||
156 | } | ||
157 | TestStore.setup(initialState) | ||
158 | var mailView = createTemporaryObject(mailViewComponent, testCase, {}) | ||
159 | var folderListView = findChild(mailView, "folderListView"); | ||
160 | verify(folderListView) | ||
161 | |||
162 | var folder = TestStore.load("folder", {resource: "resource1"}) | ||
163 | verify(folder) | ||
164 | |||
165 | Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": folder, "trash": false}); | ||
166 | |||
167 | var mailListView = findChild(mailView, "mailListView"); | ||
168 | verify(mailListView) | ||
169 | var listView = findChild(mailListView, "listView"); | ||
170 | verify(listView) | ||
171 | tryCompare(listView, "count", 1) | ||
172 | |||
173 | listView.currentIndex = 0 | ||
174 | var currentItem = listView.currentItem | ||
175 | verify(currentItem) | ||
176 | |||
177 | var deleteButton = findChild(currentItem, "deleteButton"); | ||
178 | verify(deleteButton) | ||
179 | deleteButton.clicked() | ||
180 | |||
181 | tryCompare(listView, "count", 0) | ||
119 | } | 182 | } |
120 | } | 183 | } |