Support for ::before and ::after pseudo-elements would be amazing!
Was reading up on current support for pseudo-selectors and taking a look at https://github.com/airbnb/enzyme/pull/1537, and supporting ::before and ::after would be much appreciated.
I would like to work on this feature, though I don鈥檛 know if it鈥檚 a good starting point for a first pull request to Enzyme. What do they maintainers think about this?
At first sight, I thought it was just updating the matchPseudoSelector() in selector.js to handle before/after pseudo-elements and return the corresponding node. But I didn't have in mind how to test this feature, because a DOM element cannot be mounted with a pseudo-selector as inline style, any suggestion on how to do this?
@Jotakuun anything with string selectors isn鈥檛 likely a good first PR, because it probably requires changes in another package, rst-selector-parser.
As for how to test it, that鈥檚 a good question; we鈥檇 need to test for it in both shallow and mount, which means, both with and without a dom.
Thanks for clarifying, I will leave it to someone who can handle it better than me. Though I'll be subscribed to this feature request to see how it would be implemented.
Let me know if I could be of any help.
any updates on this?
Most helpful comment
Thanks for clarifying, I will leave it to someone who can handle it better than me. Though I'll be subscribed to this feature request to see how it would be implemented.
Let me know if I could be of any help.