ui-jar
ui-jar copied to clipboard
Host component does not work
Hello! I'm trying to make simple test with custom host component. I've made a few tries, but it doesn't work: No component factory found for undefined. Did you add it to @NgModule.entryComponents?
icon.component.spec.ts:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Component } from '@angular/core';
import { IconComponent } from '@components/icon/icon.component';
@Component({
selector: 'vs-icon-test-color-host',
template: `<vs-icon icon='clock'></vs-icon>`,
styles: [`
:host {
color: #00ffff;
}
`]
})
export class IconTestColorHostComponent {
}
describe('IconComponent', () => {
let component: IconTestColorHostComponent;
let fixture: ComponentFixture<IconTestColorHostComponent>;
beforeEach(async(() => {
/**
* @uijar IconComponent
* @hostcomponent IconTestColorHostComponent
*/
TestBed.configureTestingModule({
declarations: [IconComponent, IconTestColorHostComponent]
})
.compileComponents()
.then(() => {
fixture = TestBed.createComponent(IconTestColorHostComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
}));
/**
* @uijarexample Icon changes color
*/
it('should change icon color ', () => {
expect(component).toBeTruthy();
});
});
icon.component.ts:
import { Component, Input } from '@angular/core';
/**
* @group UI
* @component Icon
*/
@Component({
selector: 'vs-icon',
templateUrl: './icon.component.html',
styleUrls: ['./icon.component.styl'],
host: {
'[class.vs-icon]': 'true'
}
})
export class IconComponent {
@Input() icon: string;
@Input() size: string | number;
}
UI-jar version 1.1.8 Angular v. 7.0.0
It's only in watch mode.
Could you provide full repo?