0

请帮助解决以下问题。价值是一个感动的事件!

Err - 未定义值。

组件文件:

searchElement(value)
{
  let val = value.target.value;
  if (val && val.trim() != '')
  //code snippet
  }
}

规格文件:

it('searchElement',()=> {

  // how to set the "value" which is having target value and pass it to real method as a param.
    let value =  {
//              "target": {
//                 "value": "abc"
//                }
//            };      
//     comp.searchElement(value); 
//     fixture.detectChanges();
//     expect(comp.searchElement).toBeTruthy();     

)};
4

0 回答 0