Fix broken JavaScript tests

Fix the JavaScript tests (implemented in Jasmine) that were broken as a
result of the refactor in 9f1b018 which addressed #710.