summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/actions/tests/sinkactiontest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-04-24 21:56:13 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-04-24 21:56:13 +0200
commit100f409967cd5c17567e401826a0773c7e848ff3 (patch)
tree64114fa1a8db36febe5448d5d199b3e9c8fc294f /framework/src/domain/actions/tests/sinkactiontest.cpp
parentb3223155b178427354b44f05167d0afba0926cbd (diff)
downloadkube-100f409967cd5c17567e401826a0773c7e848ff3.tar.gz
kube-100f409967cd5c17567e401826a0773c7e848ff3.zip
Dropped the now unused action framework
Diffstat (limited to 'framework/src/domain/actions/tests/sinkactiontest.cpp')
-rw-r--r--framework/src/domain/actions/tests/sinkactiontest.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/framework/src/domain/actions/tests/sinkactiontest.cpp b/framework/src/domain/actions/tests/sinkactiontest.cpp
deleted file mode 100644
index 79375503..00000000
--- a/framework/src/domain/actions/tests/sinkactiontest.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
1#include <QTest>
2#include <QDebug>
3#include <QSignalSpy>
4#include <sink/test.h>
5#include <sink/store.h>
6#include <sink/log.h>
7#include <KMime/Message>
8
9#include <actions/action.h>
10#include <actions/context.h>
11
12using namespace Sink;
13
14class SinkActionTest : public QObject
15{
16 Q_OBJECT
17private slots:
18
19 void initTestCase()
20 {
21 Sink::Test::initTest();
22 Sink::Log::setDebugOutputLevel(Sink::Log::Trace);
23 }
24
25 void testSaveAsDraftFail()
26 {
27 Kube::Context context;
28 auto future = Kube::Action("org.kde.kube.actions.save-as-draft", context).executeWithResult();
29
30 QTRY_VERIFY(future.isDone());
31 //because of empty context
32 QVERIFY(future.error());
33 }
34
35 void testSaveAsDraftNew()
36 {
37 auto message = KMime::Message::Ptr::create();
38 message->subject(true)->fromUnicodeString(QString::fromLatin1("Foobar"), "utf8");
39 message->assemble();
40
41 auto &&account = Test::TestAccount::registerAccount();
42
43 Kube::Context context;
44 context.setProperty("message", QVariant::fromValue(message));
45 context.setProperty("accountId", QVariant::fromValue(account.identifier));
46 auto future = Kube::Action("org.kde.kube.actions.save-as-draft", context).executeWithResult();
47
48 QTRY_VERIFY(future.isDone());
49 QVERIFY(!future.error());
50 auto mails = account.entities<Sink::ApplicationDomain::Mail>();
51 QCOMPARE(mails.size(), 1);
52 auto mail = mails.first();
53 QVERIFY(mail->getProperty("draft").toBool());
54 }
55};
56
57QTEST_GUILESS_MAIN(SinkActionTest)
58#include "sinkactiontest.moc"