I am unit testing a component that is used to edit an object. The object has an unique id that is used in order to grab the specific object from an array of obj
Just add a mock of the ActivatedRoute:
providers: [
{ provide: ActivatedRoute, useClass: MockActivatedRoute }
]
...
class MockActivatedRoute {
// here you can add your mock objects, like snapshot or parent or whatever
// example:
parent = {
snapshot: {data: {title: 'myTitle ' } },
routeConfig: { children: { filter: () => {} } }
};
}