jsapi mock and initial unit test