Java script code test case