diff --git a/src/ui-shell/sidenav/side-nav.component.spec.ts b/src/ui-shell/sidenav/side-nav.component.spec.ts index 6da9d81b22..c1a473f950 100644 --- a/src/ui-shell/sidenav/side-nav.component.spec.ts +++ b/src/ui-shell/sidenav/side-nav.component.spec.ts @@ -18,7 +18,7 @@ class FooComponent { } @Component({ template: ` - + { }); }); - it("should work", () => { + it("should work", () => { fixture = TestBed.createComponent(SideNav); expect(fixture.componentInstance instanceof SideNav).toBe(true); }); @@ -81,7 +81,7 @@ describe("SideNav", () => { fixture.detectChanges(); }); - it("should emit the navigation status promise when the link is activated and call onNavigation", async () => { + it("should emit the navigation status promise when the link is activated and call onNavigation", async () => { wrapper = fixture.componentInstance; spyOn(wrapper, "onNavigation").and.callThrough(); fixture.detectChanges(); @@ -110,7 +110,7 @@ describe("SideNav", () => { it("should set the sidenav-menu title to Example Title", () => { fixture.detectChanges(); element = fixture.debugElement.query(By.css("cds-sidenav-menu")); - expect(element.nativeElement.textContent).toEqual("Example Title"); + expect(element.nativeElement.textContent).toEqual("Example Title"); }); it("should toggle expanded on click", () => { @@ -140,16 +140,6 @@ describe("SideNav", () => { fixture.detectChanges(); }); - it("should not emit the navigation status promise when the link is activated and call onNavigation", async () => { - wrapper = fixture.componentInstance; - spyOn(wrapper, "onNavigation").and.callThrough(); - fixture.detectChanges(); - element = fixture.debugElement.query(By.css(".cds--side-nav__link")); - element.nativeElement.click(); - fixture.detectChanges(); - expect(wrapper.onNavigation).not.toHaveBeenCalled(); - }); - it("should expand sidenav-menu on click", () => { wrapper = fixture.componentInstance; fixture.detectChanges(); @@ -167,7 +157,7 @@ describe("SideNav", () => { it("should set the sidenav-menu title to Example Title", () => { fixture.detectChanges(); element = fixture.debugElement.query(By.css("cds-sidenav-menu")); - expect(element.nativeElement.textContent).toEqual("Example Title"); + expect(element.nativeElement.textContent).toEqual("Example Title"); }); it("should toggle expanded on click", () => { diff --git a/src/ui-shell/sidenav/sidenav-item.component.ts b/src/ui-shell/sidenav/sidenav-item.component.ts index 2f4708502f..0614cc3b04 100644 --- a/src/ui-shell/sidenav/sidenav-item.component.ts +++ b/src/ui-shell/sidenav/sidenav-item.component.ts @@ -18,14 +18,14 @@ import { Router } from "@angular/router"; selector: "cds-sidenav-item, ibm-sidenav-item", template: ` + [href]="href" + [attr.aria-current]="(active ? 'page' : null)" + [attr.title]="title ? title : null" + (click)="navigate($event)"> @@ -33,6 +33,7 @@ import { Router } from "@angular/router";