Skip to content
Snippets Groups Projects
Commit 1f639415 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6103 OZG-6631 Move attribute role to host element

parent 2005e212
No related branches found
No related tags found
No related merge requests found
......@@ -61,4 +61,12 @@ describe('NavItemComponent', () => {
});
});
});
describe('template', () => {
describe('host element role attribute', () => {
it('should be "menuitem"', () => {
expect(fixture.nativeElement.getAttribute('role')).toBe('menuitem');
});
});
});
});
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
import { Component, HostBinding, Input } from '@angular/core';
import { RouterLink, RouterLinkActive } from '@angular/router';
@Component({
......@@ -14,7 +14,6 @@ import { RouterLink, RouterLinkActive } from '@angular/router';
'border border-transparent hover:border-primary',
'outline-2 outline-offset-4 outline-focus focus-visible:border-background-200',
]"
role="menuitem"
[attr.data-test-id]="'link-to-' + to"
>
<ng-content select="[icon]" />
......@@ -24,4 +23,6 @@ import { RouterLink, RouterLinkActive } from '@angular/router';
export class NavItemComponent {
@Input({ required: true }) caption!: string;
@Input() to: string;
@HostBinding('attr.role') role = 'menuitem';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment