Added a unittest for chat functionality