add test.switch.js unit test for key switching