diff --git a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts index 0af3e23bed..0124c9f0ba 100644 --- a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts @@ -116,6 +116,7 @@ describe('', () => { fixture.detectChanges(); const rendered = de.query(By.css('a')); + expect(rendered.nativeElement.href).toContain(field.value.href); expect(rendered.nativeElement.className).toContain(field.value.class); expect(rendered.nativeElement.title).toContain(field.value.title); expect(rendered.nativeElement.target).toContain(field.value.target); diff --git a/packages/sitecore-jss-angular/src/components/router-link.directive.ts b/packages/sitecore-jss-angular/src/components/router-link.directive.ts index daf802eede..e55a34cc40 100644 --- a/packages/sitecore-jss-angular/src/components/router-link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/router-link.directive.ts @@ -37,7 +37,7 @@ export class RouterLinkDirective extends LinkDirective { if (key === 'href') { this.renderer.listen(node, 'click', (event) => { - this.router.navigate([propValue]); + this.router.navigateByUrl(propValue); event.preventDefault(); }); }