add test for view functions