added tests for view, removed console.log