Open craigkovatch opened 5 years ago
In this case, you're chaining it. What about:
wrapper.find(`[role="option"]').filter(':not([data-itemvalue="apple"])`)
?
Seems to be broken across the board
wrapper.find(`:not([data-itemvalue:"apple"])`); // Error: Failed to parse selector: :not([data-itemvalue:"apple"])
wrapper.find(`[role="option"]`).filter(`:not([data-itemvalue:"apple"])`); // Error: Failed to parse selector: :not([data-itemvalue:"apple"])
hmm - what about ':not(["data-itemvalue"="apple"]'
or .filter(':not(div)')
? if that still doesn't work then i'd call this a bug.
I would need similar selector for my tests. I want to select a not active li
element from a nav list. 🙃
My workaround:
wrapper.find('li').filterWhere(element => !element.prop('className').includes('activeClass'))
Current behavior
Expected behavior
Expected all three examples to work -- @ljharb comments in https://github.com/airbnb/enzyme/issues/456#issuecomment-455670304 that :not selector was added in #1086 and "should be in all versions of enzyme 3."
Your environment
Jasmine running in Wallaby
API
Version
Adapter