Closed yagni closed 3 years ago
I missed this PR, and made basically the same fix in a different PR https://github.com/testing-library/cypress-testing-library/pull/202 with a smaller diff
Instead of changing what gets passed into getValue
, I'm checking for whether there's an explicit subject in the current chain, with cy.state('subject')
. I don't really have an opinion on which one is better, but i'll leave my PR up
I also made a separate issue for the problem, https://github.com/testing-library/cypress-testing-library/issues/201
Sorry, I didn't notice this PR (I don't watch this repo). Does #202 solve this as well?
@kentcdodds Yep. I'll close this one.
What: Chaining now takes precedence over the scope defined by its surrounding
within
block. Only calls that don't have a previous subject and don't have a container specified use the within block.Why: Chaining inside of a within block previously ignored the chain and searched starting at the
within
element. This gave incorrect (too many) results. This was touched on at the end of #132How: Moved the use of win.document inside of getContainer() so we can be more specific about when to use it.
Checklist:
Yes