test()

in src/rules/button-role-space.js [16:27]


    test(tagName, props) {
        warnRuleDeprecated('button-role-space', 'click-events-have-key-events');
        const hidden = hiddenFromAT(props);
        const onClick = listensTo(props, 'onClick');
        const onKeyDown = listensTo(props, 'onKeyDown');
        const onKeyUp = listensTo(props, 'onKeyUp');
        const onKeyPress = listensTo(props, 'onKeyPress');

        // rule passes when element is hidden,
        // has onClick and has an onKeyDown, onKeyUp or onKeyPress prop
        return hidden || !onClick || onKeyDown || onKeyUp || onKeyPress;
    }