aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_mainwindow.cpp')
-rw-r--r--tests/test_mainwindow.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/test_mainwindow.cpp b/tests/test_mainwindow.cpp
index 2032793..5d2316f 100644
--- a/tests/test_mainwindow.cpp
+++ b/tests/test_mainwindow.cpp
@@ -543,6 +543,7 @@ private slots:
void aCloseDuringTheCountdownIsRefused();
void aFailedSendKeepsTheTextThatFailedToGo();
void aSmallSizeLimitIsNotDescribedAsZeroMegabytes();
+ void theBusinessSenderListIsLoadedAtStartup();
private:
/// Owns the throwaway lock table init() points every test at. A pointer
@@ -11853,6 +11854,21 @@ void TestMainWindow::restoreReturnsAMessageToItsOriginFolder()
QCOMPARE(notmuchCount(cfg, QStringLiteral("id:ro1@example.org")), 1);
QVERIFY(!folderHasMessageFile(root + QStringLiteral("/acct/Trash/cur"),
stem));
+
+ // And the `inbox` TAG came back with it. Delete strips that tag so the
+ // message leaves the Inbox view, which makes restoring it the other half
+ // of the same change: without it the message sits in the inbox FOLDER
+ // carrying no `inbox` tag and the Inbox view cannot see it, which reads as
+ // "I restored it and it is gone".
+ //
+ // The file assertions above all passed while this was broken: the folder
+ // comparison that decides it was made against the finished TAG rather than
+ // against the destination folder, so it was always false. Nothing else
+ // here would have noticed.
+ QTRY_VERIFY_WITH_TIMEOUT(
+ notmuchCount(cfg, QStringLiteral("id:ro1@example.org and tag:inbox"))
+ == 1,
+ 15000);
}
void TestMainWindow::restoreFallsBackToInboxWithoutAnOriginTag()
@@ -14886,4 +14902,21 @@ void TestMainWindow::aSmallSizeLimitIsNotDescribedAsZeroMegabytes()
"1.5 MB lost its decimal");
}
+void TestMainWindow::theBusinessSenderListIsLoadedAtStartup()
+{
+ QTemporaryDir dir;
+ const QString path = dir.filePath(QStringLiteral("business-senders"));
+ QFile file(path);
+ QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Text));
+ file.write("@cofidis.it\n");
+ file.close();
+
+ const Config config;
+ MainWindow window(config);
+ window.loadBusinessSenders(path);
+
+ QVERIFY(window.businessSendersForTest().domains.contains(
+ QStringLiteral("cofidis.it")));
+}
+
#include "test_mainwindow.moc"