wrote unit test for detail page