Skip to content

Commit 1e30f45

Browse files
committed
test(button-group): add test for issue #5765
1 parent f92ab20 commit 1e30f45

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

projects/igniteui-angular/src/lib/buttonGroup/buttongroup.component.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,25 @@ describe('IgxButtonGroup', () => {
232232
expect(groupChildren[1].element.nativeElement.classList.contains('igx-button--cosy')).toBe(true, 'Missing density class!');
233233
});
234234

235+
it('Button Group - should support tab navigation', () => {
236+
const fixture = TestBed.createComponent(InitButtonGroupWithValuesComponent);
237+
fixture.detectChanges();
238+
239+
const buttongroup = fixture.componentInstance.buttonGroup;
240+
const groupChildren = buttongroup.buttons;
241+
242+
for (let i = 0; i < groupChildren.length; i++) {
243+
const button = groupChildren[i];
244+
expect(button.nativeElement.tagName).toBe('BUTTON');
245+
246+
if (i < groupChildren.length - 1) {
247+
expect(button.nativeElement.tabIndex).toBe(0);
248+
} else {
249+
expect(button.nativeElement.tabIndex).toBe(-1);
250+
}
251+
}
252+
});
253+
235254
});
236255

237256
@Component({ template: `<igx-buttongroup [values]="buttons"></igx-buttongroup>` })

0 commit comments

Comments
 (0)