Unit test Angular with Jasmine and Karma, Error:Can't bind to 'xxx' since it isn't a known property of 'xxxxxx'.

You need to add your second component when creating your testing module as that module is part of component 1. If you don't the module won't have my-component2 and the input will be invalid.

TestBed.configureTestingModule({
      declarations: [ MyComponent1Component, MyComponent2Component ],
      imports: [],
      providers: [MyService1Service, HttpClient, HttpHandler, HttpTestingController]
    })

For Some this might help - some times it may just be the specific module that might be missing

TestBed.configureTestingModule(
{
declarations: [TestComponent],
imports: [<Specific_module>],
}