ticket:58 fix js and add test