Added some tests for the JavaScript logic