summaryrefslogtreecommitdiffstats
path: root/accounts/maildir/tests/settingstest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/maildir/tests/settingstest.cpp')
-rw-r--r--accounts/maildir/tests/settingstest.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/accounts/maildir/tests/settingstest.cpp b/accounts/maildir/tests/settingstest.cpp
index 07665c24..1967bcfc 100644
--- a/accounts/maildir/tests/settingstest.cpp
+++ b/accounts/maildir/tests/settingstest.cpp
@@ -26,6 +26,8 @@ private slots:
26 auto smtpServer = QString("smtpserver"); 26 auto smtpServer = QString("smtpserver");
27 auto smtpUsername = QString("username"); 27 auto smtpUsername = QString("username");
28 auto smtpPassword = QString("password"); 28 auto smtpPassword = QString("password");
29 auto username = QString("username");
30 auto emailAddress = QString("emailAddress");
29 31
30 MaildirSettings settings; 32 MaildirSettings settings;
31 settings.setAccountIdentifier(accountId); 33 settings.setAccountIdentifier(accountId);
@@ -33,6 +35,8 @@ private slots:
33 settings.setProperty("smtpServer", smtpServer); 35 settings.setProperty("smtpServer", smtpServer);
34 settings.setProperty("smtpUsername", smtpUsername); 36 settings.setProperty("smtpUsername", smtpUsername);
35 settings.setProperty("smtpPassword", smtpPassword); 37 settings.setProperty("smtpPassword", smtpPassword);
38 settings.setProperty("username", username);
39 settings.setProperty("emailAddress", emailAddress);
36 settings.save(); 40 settings.save();
37 41
38 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then<void, QList<Sink::ApplicationDomain::SinkResource>>([](const QList<Sink::ApplicationDomain::SinkResource> &resources) { 42 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then<void, QList<Sink::ApplicationDomain::SinkResource>>([](const QList<Sink::ApplicationDomain::SinkResource> &resources) {
@@ -46,20 +50,23 @@ private slots:
46 QSignalSpy spy(&readSettings, &MaildirSettings::pathChanged); 50 QSignalSpy spy(&readSettings, &MaildirSettings::pathChanged);
47 QSignalSpy spy1(&readSettings, &MaildirSettings::smtpResourceChanged); 51 QSignalSpy spy1(&readSettings, &MaildirSettings::smtpResourceChanged);
48 readSettings.setAccountIdentifier(accountId); 52 readSettings.setAccountIdentifier(accountId);
49 QTRY_VERIFY(spy.count()); 53 //Once for clear and once for once for the new setting
50 QTRY_VERIFY(spy1.count()); 54 QTRY_COMPARE(spy.count(), 2);
55 QTRY_COMPARE(spy1.count(), 2);
51 QVERIFY(!readSettings.accountIdentifier().isEmpty()); 56 QVERIFY(!readSettings.accountIdentifier().isEmpty());
52 QCOMPARE(readSettings.path().toString(), maildirPath); 57 QCOMPARE(readSettings.path().toString(), maildirPath);
53 QCOMPARE(readSettings.property("smtpServer").toString(), smtpServer); 58 QCOMPARE(readSettings.property("smtpServer").toString(), smtpServer);
54 QCOMPARE(readSettings.property("smtpUsername").toString(), smtpUsername); 59 QCOMPARE(readSettings.property("smtpUsername").toString(), smtpUsername);
55 QCOMPARE(readSettings.property("smtpPassword").toString(), smtpPassword); 60 QCOMPARE(readSettings.property("smtpPassword").toString(), smtpPassword);
61 QCOMPARE(readSettings.property("username").toString(), smtpUsername);
62 QCOMPARE(readSettings.property("emailAddress").toString(), smtpPassword);
56 } 63 }
57 64
58 { 65 {
59 MaildirSettings settings; 66 MaildirSettings settings;
60 QSignalSpy spy(&settings, &MaildirSettings::pathChanged); 67 QSignalSpy spy(&settings, &MaildirSettings::pathChanged);
61 settings.setAccountIdentifier(accountId); 68 settings.setAccountIdentifier(accountId);
62 QTRY_VERIFY(spy.count()); 69 QTRY_COMPARE(spy.count(), 2);
63 settings.remove(); 70 settings.remove();
64 } 71 }
65 72