UNPKG

react-native-accessibility-engine

Version:

Make accessibility-related assertions on React Native code using React Test Renderer

24 lines (21 loc) 762 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _helpers = require("../../helpers"); const allowedRoles = ['button', 'link', 'imagebutton', 'radio', 'tab']; const allowedRolesMessage = allowedRoles.join(' or '); const rule = { id: 'pressable-role-required', matcher: node => (0, _helpers.isPressable)(node.type), assertion: node => allowedRoles.includes(node.props.accessibilityRole), help: { problem: "This component is pressable but the user hasn't been informed that it behaves like a button/link/radio", solution: `Set the 'accessibilityRole' prop to ${allowedRolesMessage}`, link: '' } }; var _default = rule; exports.default = _default; //# sourceMappingURL=index.js.map