Skip to content

Commit

Permalink
Merge pull request #3842 from sparkdesignsystem/link-katie
Browse files Browse the repository at this point in the history
masthead tests
  • Loading branch information
Amber Febbraro authored Feb 4, 2021
2 parents 677c2b9 + 98b4727 commit e13330b
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,28 @@ describe('SprkMastheadComponent', () => {
'/alert-router',
);
});

it('should set the href link of the narrowNavLink', () => {
component.narrowNavLinks = [{ text: 'Item 1', href: '/alert' }];
fixture.detectChanges();
hamburgerIcon.click();
fixture.detectChanges();
const narrowNavLink = fixture.nativeElement.querySelector(
'.sprk-c-MastheadAccordion__summary',
);
expect(narrowNavLink.getAttribute('href')).toEqual('/alert');
});

it('should set the href link of the narrowNavLink when using routerLink', () => {
component.narrowNavLinks = [
{ text: 'Item 1', routerLink: '/alert-router' },
];
fixture.detectChanges();
hamburgerIcon.click();
fixture.detectChanges();
const narrowNavLink = fixture.nativeElement.querySelector(
'.sprk-c-MastheadAccordion__summary',
);
expect(narrowNavLink.getAttribute('href')).toEqual('/alert-router');
});
});

0 comments on commit e13330b

Please sign in to comment.