Added an assertion to editing views test
Style update
Removed an unused variable declaration
Refactored javascript to facilitate testing