MCPcopy
hub / github.com/angular/components / assertArrowKeyInteractionInRtl

Function assertArrowKeyInteractionInRtl

src/material/stepper/stepper.spec.ts:1727–1745  ·  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

1725
1726/** Asserts that arrow key direction works correctly in RTL mode. */
1727function assertArrowKeyInteractionInRtl(
1728 fixture: ComponentFixture<{stepper: MatStepper}>,
1729 stepHeaders: DebugElement[],
1730) {
1731 const stepper = fixture.componentInstance.stepper;
1732 expect(stepper._getFocusIndex()).toBe(0);
1733
1734 let stepHeaderEl = stepHeaders[0].nativeElement;
1735 dispatchKeyboardEvent(stepHeaderEl, 'keydown', LEFT_ARROW);
1736 fixture.detectChanges();
1737
1738 expect(stepper._getFocusIndex()).toBe(1);
1739
1740 stepHeaderEl = stepHeaders[1].nativeElement;
1741 dispatchKeyboardEvent(stepHeaderEl, 'keydown', RIGHT_ARROW);
1742 fixture.detectChanges();
1743
1744 expect(stepper._getFocusIndex()).toBe(0);
1745}
1746
1747/** Asserts that keyboard interaction works correctly when the user is pressing a modifier key. */
1748function assertSelectKeyWithModifierInteraction(

Callers 1

stepper.spec.tsFile · 0.85

Calls 2

dispatchKeyboardEventFunction · 0.85
_getFocusIndexMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…