#354 js test fixes

Some fixes + additions to the js testing for #354.