Fix Jasmine tests

Also, rewrite them to be easier to comprehend, and to not use magic constants (or to use fewer, at least).