Every test was running okay but, after as per the functionality I had to use the header component inside my signup component so, as we know that in angular2 to user other component view with other we have to include its selector in the HTML. So, I have included my header <custom-header-component></custom-header-component>
and the functionality is working fine but somehow my every test spec is giving below error:
Chrome 53.0.2785 (Linux 0.0.0) Signup Component not be able to signup FAILED [1] Error: Error in dist/dev/src/app/shared/header/header.component.html:11:28 caused by: Cannot read property 'root' of undefined [1] TypeError: Cannot read property 'root' of undefined [1] Usage: spyOn(, ) [1] Error: : could not find an object to spy upon for signup() [1] Chrome 53.0.2785 (Linux 0.0.0) Signup Component not be able to signup FAILED [1] Error: Error in dist/dev/src/app/shared/header/header.component.html:11:28 caused by: Cannot read property 'root' of undefined [1] TypeError: Cannot read property 'root' of undefined [1] Usage: spyOn(, )
Below is the sample of my component template:
<custom-header-component></custom-header-component>
<div id="" class="pages">
<div class="space-y pattern-bg share-y">
<div class="container padding-y">
<div class="row">
<div class="col-md-12">
<div class="quform-outer">
<div class="quform-inner">
<div class="quform-elements">
<div class="row">
<div class="col-md-6">
<div class="socialshareimages" (click)="signupFacebook()">
<img src="../../../assets/images/fblogin.jpg"
width="335" height="61">
</div>
</div>
<div class="col-md-6">
<div class="socialshareimages" (click)="signupTwitter()">
<img src="../../../assets/images/twlogin.jpg"
width="335" height="61">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>