Asserts that arrow key direction works correctly in RTL mode.
(
fixture: ComponentFixture<{stepper: MatStepper}>,
stepHeaders: DebugElement[],
)
| 1743 | |
| 1744 | /** Asserts that arrow key direction works correctly in RTL mode. */ |
| 1745 | function assertArrowKeyInteractionInRtl( |
| 1746 | fixture: ComponentFixture<{stepper: MatStepper}>, |
| 1747 | stepHeaders: DebugElement[], |
| 1748 | ) { |
| 1749 | const stepper = fixture.componentInstance.stepper; |
| 1750 | expect(stepper._getFocusIndex()).toBe(0); |
| 1751 | |
| 1752 | let stepHeaderEl = stepHeaders[0].nativeElement; |
| 1753 | dispatchKeyboardEvent(stepHeaderEl, 'keydown', LEFT_ARROW); |
| 1754 | fixture.detectChanges(); |
| 1755 | |
| 1756 | expect(stepper._getFocusIndex()).toBe(1); |
| 1757 | |
| 1758 | stepHeaderEl = stepHeaders[1].nativeElement; |
| 1759 | dispatchKeyboardEvent(stepHeaderEl, 'keydown', RIGHT_ARROW); |
| 1760 | fixture.detectChanges(); |
| 1761 | |
| 1762 | expect(stepper._getFocusIndex()).toBe(0); |
| 1763 | } |
| 1764 | |
| 1765 | /** Asserts that keyboard interaction works correctly when the user is pressing a modifier key. */ |
| 1766 | function assertSelectKeyWithModifierInteraction( |
no test coverage detected