title: Unit tests for event emitter
body: <p>After going through similar topics, still don't know what's wrong with my unit test. Running causes error as in the title.</p>
  
  <p>test setup:</p>
  
  <p>mocked service provided by value</p>
  
  <pre><code>export class MockedDrawingService {
    public drawing = {} as Drawing;
  
    constructor() {}
  
    add(_server: Server, _project_id:string, _x: number, _y:number, _svg: string) {
      return of(this.drawing);
    }
  
  }
  </code></pre>
  
  <p>in test:</p>
  
  <pre><code>it('should add selected drawing', () =&gt; {
    //some code here
    spyOn(drawingService, 'add');
  
    component.addDrawing("rectangle");
    dummyElement.click();
  
    expect(drawingService.add).toHaveBeenCalled();
  </code></pre>
  
  <p>});</p>
  
  <p>in component:</p>
  
  <pre><code>this.drawingService
      .add(this.server, this.project.project_id, x, y, svg)
      .subscribe((serverDrawing: Drawing) =&gt; {
        this.drawingsDataSource.add(serverDrawing);
      });
  </code></pre>
  
  <p>line with subscribe causes exception: Cannot read property 'subscribe' of undefined</p>