Improve javascript test coverage