Closed ooorayray closed 3 years ago
Thanks for reporting and for the test case. I was able to pin point the error, I'm on my birthday holidays at the moment, but will fix this ASAP early next week along with #60 .
Should be fixed in v1.9.0.
@baruchvlz I still find current behavior unexpected. By writing const filtered = myComponent.byProps({ prop1: 123, prop2: 'abc' })
I expect all filtered
nodes have props prop1: 123
AND prop2: 'abc'
. I think this test case should fail because b
doesn't have prop foo
.
@rousku The current match returns true if at least one of the properties match. There could be an optional flag to make it a strict match.
If you like you could open a PR and I would gladly review it :)
Current behavior
When passing a matcher with multiple keys,
.byProps
/.byState
returns nodes that match any one of the given keys.Example:
Expected behavior
.byProps
/.byState
returns nodes that match ALL of the given keys.Example:
Failing test case: https://github.com/ooorayray/resq/commit/b502b830105736a80b2fccbd37d9b31ed9e55672