improve js specs and changing boolean value after click

tests were green, but some functionality ("changing checkbox(boolean) value after click") was broken. I fix it and optimize some things.