import Component from '../../../../src/dom_components/model/Component';
import ComponentImage from '../../../../src/dom_components/model/ComponentImage';

describe('ComponentImage', () => {
  let componentImage;

  beforeEach(() => {
    componentImage = new ComponentImage();
  });

  describe('.getAttrToHTML', () => {
    let getSrcResultSpy;
    const fakeAttributes = {};

    beforeEach(() => {
      spyOn(Component.prototype, 'getAttrToHTML').and.returnValue(
        fakeAttributes
      );
      getSrcResultSpy = spyOn(componentImage, 'getSrcResult');
    });

    test('it should fill the `src` property with the result of `getSrcResult` if defined', () => {
      let attributes = componentImage.getAttrToHTML();
      expect(getSrcResultSpy).toHaveBeenCalled();
      expect(attributes).toEqual(fakeAttributes);

      let fakeSrcResult = 'fakeSrcResult';
      getSrcResultSpy.and.returnValue(fakeSrcResult);
      attributes = componentImage.getAttrToHTML();
      expect(getSrcResultSpy).toHaveBeenCalledTimes(2);
      expect(attributes).toEqual({ src: fakeSrcResult });
    });
  });
});

@@ -16,32 +16,16 @@
 t from '
-../../../../src/
 dom_comp
@@ -81,24 +81,8 @@
 om '
-../../../../src/
 dom_

Fix paths