summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2017-05-18 14:31:36 (GMT)
committerTobias Markmann <tm@ayena.de>2017-05-19 11:49:14 (GMT)
commita986b2a4cef30a83df385e616503c9029b039610 (patch)
tree61df7b33c227baf247fed09648591ce481af4716 /Swift/Controllers/Chat/UnitTest
parent7b53dc308feeef2da9d826c6bbfe215222af8639 (diff)
downloadswift-a986b2a4cef30a83df385e616503c9029b039610.zip
swift-a986b2a4cef30a83df385e616503c9029b039610.tar.bz2
Only apply impromptu chat title style to impromptu chats
Fixes regression of 1cb2bb7, that would show the full bare JID as chat title for normal MUCs. Test-Information: Added unit test for having the classic title style for normal MUCS. Joined basic MUC room and verified it only shows the node part of the MUC JID as chat title. Verified that for impromptu chats, it shows the list of participants as chat title. Tested on macOS 10.12.5 with Qt 5.4.2. Change-Id: I3685172378c0b6303524c89876b044eac1aa1422
Diffstat (limited to 'Swift/Controllers/Chat/UnitTest')
-rw-r--r--Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
index 20c959c..8fc26b5 100644
--- a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
+++ b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
@@ -150,9 +150,10 @@ class ChatsManagerTest : public CppUnit::TestFixture {
CPPUNIT_TEST(testChatControllerMessageCorrectionReplaceByOtherResource);
CPPUNIT_TEST(testMUCControllerMessageCorrectionNoIDMatchRequired);
- //Imptomptu test
+ // Chat window title tests
CPPUNIT_TEST(testImpromptuChatTitle);
CPPUNIT_TEST(testImpromptuChatWindowTitle);
+ CPPUNIT_TEST(testStandardMUCChatWindowTitle);
CPPUNIT_TEST_SUITE_END();
@@ -1586,6 +1587,17 @@ public:
CPPUNIT_ASSERT_EQUAL(std::string("bar@test.com, foo@test.com"), window->name_);
}
+ void testStandardMUCChatWindowTitle() {
+ JID mucJID("mucroom@rooms.test.com");
+ std::string nickname = "toodles";
+
+ MockChatWindow* window = new MockChatWindow();
+ mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(mucJID, uiEventStream_).Return(window);
+
+ uiEventStream_->send(std::make_shared<JoinMUCUIEvent>(mucJID, boost::optional<std::string>(), nickname));
+ CPPUNIT_ASSERT_EQUAL(std::string("mucroom"), window->name_);
+ }
+
private:
std::shared_ptr<Message> makeDeliveryReceiptTestMessage(const JID& from, const std::string& id) {
std::shared_ptr<Message> message = std::make_shared<Message>();