Add js unit tests.
Fix js unit tests.