add unit test for stats view