Skip to content

Feature: support accessibility ARIA props #1473

Closed
@mdjastrzebski

Description

@mdjastrzebski

Summary

The new aria-* props are being rendered to mocked View, Text, TextInput components directly without translation to original accessibilityState prop. Therefore, we need to modify related checks to account for these.

Scope:

Evidence

test('React Native API assumption: aria-* props render on host View', () => {
  const view = render(
    <View
      testID="test"
      aria-busy
      aria-checked
      aria-disabled
      aria-expanded
      aria-hidden
      aria-label="Label"
      aria-labelledby="LabelledBy"
      aria-live="polite"
      aria-modal
      aria-pressed
      aria-readonly
      aria-required
      aria-selected
      aria-valuemax={10}
      aria-valuemin={0}
      aria-valuenow={5}
      aria-valuetext="ValueText"
    />
  );

  expect(view.toJSON()).toMatchInlineSnapshot(`
    <View
      aria-busy={true}
      aria-checked={true}
      aria-disabled={true}
      aria-expanded={true}
      aria-hidden={true}
      aria-label="Label"
      aria-labelledby="LabelledBy"
      aria-live="polite"
      aria-modal={true}
      aria-pressed={true}
      aria-readonly={true}
      aria-required={true}
      aria-selected={true}
      aria-valuemax={10}
      aria-valuemin={0}
      aria-valuenow={5}
      aria-valuetext="ValueText"
      testID="test"
    />
  `);
});

References

Test plan

Add relevant test cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions