Added tests for StatView and fixed the broken test in ViewTest