Angular 2. Emitting hover event in unit tests
<p>I have template for some (MyCmp) component(<code>&lt;my-cmp&gt;&lt;/my-cmp&gt;</code>) like this</p>

<pre><code>&lt;template ngFor let-r [ngForOf]="range" let-index="index"&gt;
  &lt;span&gt;{{ index &lt; 5 ? 'Y' : 'N' }}, {{r.data}}&lt;/span&gt;
  &lt;i (mouseenter)="somefunc()" (click)="elefunc()"&gt;&lt;/i&gt;
  ....
&lt;/template&gt;
</code></pre>

<p>I configure TestBed for MyCmp component via special TestComponent</p>

<pre><code>TestBed.configureTestingModule({declarations: [TestComponent], imports: [MyModule]}
TestBed.overrideComponent(TestComponent, {set: {template: '&lt;my-cmp&gt;&lt;/my-cmp&gt;'}});
fixture = TestBed.createComponent(TestComponent);
context = fixture.debugElement.componentInstance;
element = fixture.nativeElement;
fixture.detectChanges();
</code></pre>

<p>I think it's not important. Tests worked.</p>

<pre><code>element.querySelectorAll('i')[0].click(); //fine
</code></pre>

<p>But i don't know how i should emit hover(<em>mouseenter</em>) and <em>mouseleave</em> event</p>

<pre><code>element.querySelectorAll('i')[0].hover() // not a function
element.querySelectorAll('i')[0].mouseover() // not a function
element.querySelectorAll('i')[0].createMouseEvent('mouseover') // not a function
</code></pre>