title: triggering click event listener with custom Event
body: <p>I have a function which is getting triggered on some dynamic created span.</p>
  
  <pre><code>  treeFuncItom(_event:Event, catType){
      console.log('INSIDE COMPONENT', _event);
      let myEvent = {};
       if(catType == 'id'){
        myEvent['value'] = _event['item']['dataItem']['_id'];
        myEvent['module'] = 'id';
       }else {
        myEvent['module'] = 'tag';
        myEvent['value'] = _event['item']['dataItem']['name'];
       }
      this.ItemChange.emit(myEvent);
    }
  </code></pre>
  
  <p>I am trying to trigger this function by passing dummy event from .spec.ts in angular4.</p>
  
  <pre><code> it('Should raise ItemChange event, and set module to \'id\'', async () =&gt; {
      let _event  = {
        item: {
          dataItem: {
            name: 'abcd'
          },
          index: 0
        },
        originalEvent: 'MouseEvent',
        index: 0
      };
  
      fixture.detectChanges();
  
      await fixture.whenStable();
      let ee = JSON.stringify(_event);
  
      let item = null;
      component.ItemChange.subscribe(it =&gt; {
        console.log('Int Test', it);
        item = it;
      });
  
      component.treeFuncItom(new Event(ee), 'id');
      expect(item).not.toBeNull();
      expect(item.module).toEqual('id');
    });
  </code></pre>
  
  <p>But I am getting error in console:</p>
  
  <pre><code>ERROR: 'Unhandled Promise rejection:', 'Cannot read property 'dataItem' of undefined', '; Zone:', 'ProxyZone', '; Task:', 'Promise.then', '; Value:', TypeError{}, 'TypeError: Cannot read property 'dataItem' of undefined
  at SidebarComponent.webpackJsonp../src/app/service-catalog/component/sidebar/sidebar.component.ts.SidebarComponent.treeFuncItom (http://localhost:9876/_karma_webpack_/webpack:/src/app/service-catalog/component/sidebar/sidebar.component.ts:26:40)
  
  
  
  
  LOG: 'INSIDE COMPONENT', Event{isTrusted: false}
  </code></pre>
  
  <p>why is <strong>isTrusted: false</strong> and how can I pass the proper event from spec.ts</p>