From e5337f9b1a386f1a0bb539e82186ce629184d9ad Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 29 Dec 2017 13:14:21 +0100 Subject: Ensure we have the full payload available. --- framework/src/tests/maillistmodeltest.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'framework/src/tests/maillistmodeltest.cpp') diff --git a/framework/src/tests/maillistmodeltest.cpp b/framework/src/tests/maillistmodeltest.cpp index 1df0556c..a18d0d2f 100644 --- a/framework/src/tests/maillistmodeltest.cpp +++ b/framework/src/tests/maillistmodeltest.cpp @@ -49,16 +49,30 @@ private slots: Sink::ResourceControl::flushMessageQueue(resource.identifier()).exec().waitForFinished(); - MailListModel model; - model.setParentFolder(QVariant::fromValue(Folder::Ptr::create(folder1))); - QTRY_COMPARE(model.rowCount({}), 1); + { + MailListModel model; + model.setParentFolder(QVariant::fromValue(Folder::Ptr::create(folder1))); + QTRY_COMPARE(model.rowCount({}), 1); + { + auto idx = model.index(0, 0, {}); + auto mail = idx.data(MailListModel::DomainObject).value(); + QVERIFY(mail); + QVERIFY(!mail->getSubject().isEmpty()); + } + } { - auto idx = model.index(0, 0, {}); - auto mail = idx.data(MailListModel::DomainObject).value(); - QVERIFY(mail); - QVERIFY(!mail->getSubject().isEmpty()); - QVERIFY(mail->getFullPayloadAvailable()); + MailListModel model; + model.setMail(QVariant::fromValue(Mail::Ptr::create(mail1))); + QTRY_COMPARE(model.rowCount({}), 1); + + { + auto idx = model.index(0, 0, {}); + auto mail = idx.data(MailListModel::DomainObject).value(); + QVERIFY(mail); + QVERIFY(!mail->getSubject().isEmpty()); + QVERIFY(mail->getFullPayloadAvailable()); + } } } }; -- cgit v1.2.3