MCPcopy Create free account
hub / github.com/angular/components / assertArrowKeyInteractionInRtl

Function assertArrowKeyInteractionInRtl

src/material/stepper/stepper.spec.ts:1745–1763  ·  view source on GitHub ↗

Asserts that arrow key direction works correctly in RTL mode.

(
  fixture: ComponentFixture<{stepper: MatStepper}>,
  stepHeaders: DebugElement[],
)

Source from the content-addressed store, hash-verified

1743
1744/** Asserts that arrow key direction works correctly in RTL mode. */
1745function 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. */
1766function assertSelectKeyWithModifierInteraction(

Callers 1

stepper.spec.tsFile · 0.85

Calls 2

dispatchKeyboardEventFunction · 0.85
_getFocusIndexMethod · 0.80

Tested by

no test coverage detected