move test from index.html to test.js