testcafe-react-selectors icon indicating copy to clipboard operation
testcafe-react-selectors copied to clipboard

Improve the `withProps` partial matching: the `props` property value is represented by an array

Open Farfurix opened this issue 5 years ago • 0 comments

https://github.com/DevExpress/testcafe-react-selectors/issues/98#issuecomment-566378483:

Can we do the same with array of strings. withProps to allow partial matching of a prop that' an array.

<Card tags=['tag1','tag2']/>

ReactSelector('Card').withProps('tags', ['tag1']) should give me all the ones that has 'tag1' but the partial matches are not returned

Example:

class Hello extends React.Component {
  render() {
    return <div>Hello {this.props.names.join(", ")}</div>;
  }
}

ReactDOM.render(
  <Hello names={["one", "two", "three"]} />,
  document.getElementById('container')
);

Farfurix avatar Dec 18 '19 09:12 Farfurix