1

I am running an angular2 unit test. the component has an Input binding. I tried to set in manually like following:

 fixture = TestBed.createComponent(Step2Component);
component = fixture.componentInstance;
component.notificationModel = new NotificationModel([], 'test');
fixture.detectChanges();

But it fails. On the first line, component's ngOnInit is called and there the notficationModel is used. On that point, that variable is not set. Which is the proper way to set the bind variable?

Thanks.

Cosmin D
  • 639
  • 1
  • 11
  • 24

0 Answers0