Added ws events in the js
Fixed ws tests with a sleep workaround