chat tests refactoring