Js tests

All the tests that I can do. Most functions are tested, except those that create html, ajax requests and form submissions.