             AuthSettingsManager.settings?.hideMessageUserJoined = true
             messages = subscription.fetchMessagesQueryResults()
             XCTAssert(messages.count == 0, "fetchMessages() will not return userJoined when it's hidden")
-        }
+        })
     }
 
     func testHideMessagesUserLeft() {
-        Realm.executeOnMainThread({ realm in
-            let subscription = Subscription()
-            subscription.identifier = "subscription"
-            realm.add([subscription])
-
-            AuthSettingsManager.shared.internalSettings = AuthSettings()
-
-            let message1 = Message()
-            message1.identifier = "msg1"
-            message1.subscription = subscription
+        Realm.execute({ realm in
+            let subscription = Subscription()
+            subscription.identifier = "subscription"
+            realm.add([subscription])
+
+            AuthSettingsManager.shared.internalSettings = AuthSettings()
+
+            let message1 = Message()
+            message1.identifier = "msg1"
+            message1.subscription = subscription
+            message1.createdAt = Date()
             realm.add([message1])
 
             // userLeft

    }

    func testHideMessagesUserJoined() {
        Realm.executeOnMainThread { realm in
            let subscription = Subscription()
            subscription.identifier = "subscription"
            realm.add([subscription])

            AuthSettingsManager.shared.internalSettings = AuthSettings()

            let message1 = Message()
            message1.identifier = "msg1"
            message1.subscription = subscription
            realm.add([message1])

            message1.internalType = MessageType.userJoined.rawValue

    }

    func testHideMessagesUserAdded() {
        Realm.execute({ realm in
            let subscription = Subscription()
            subscription.identifier = "subscription"
            realm.add([subscription])

            AuthSettingsManager.shared.internalSettings = AuthSettings()

            let message1 = Message()
            message1.identifier = "msg1"
            message1.subscription = subscription
            message1.createdAt = Date()
            realm.add([message1])

            // userAdded
