Add unit tests for view