author avatar

harshwardhan

Fri Apr 27 2018

while writing test for a parent component which renders child component based on some state/prop and if your child component is connected, always import unconnected child component and do assertion on that. /code import { ChildComponent } from 'path/to/component';

expect(component.find(ChildComponent).length).toBe(1);

//instead of expect(component.find('ChildComponent').length).toBe(1);