Added unit test for chat room component.
Refactored code styles.