Testing with Javascript properly