Second chained cy.getReact call returns nothing
bahmutov opened this issue · 4 comments
bahmutov commented
While using https://github.com/abhinaba-ghosh/cypress-react-selector the second call does not find the component
it('chains getReact', () => {
// note that by itself, the component is found
cy.getReact('AProduct', { name: 'First item' })
.getProps('name')
.should('eq', 'First item')
// chaining getReact
cy.getReact('ProductsContainer')
.should('not.be.empty')
// the second .getReact returns nothing?!
.getReact('AProduct', { name: 'First item' })
.getProps('name')
.should('eq', 'First item')
})
To recreate the problem:
- clone the repo
- install dependencies with
npm i
- start Cypress
npx cypress open
- open test cypress/component/advanced/react-book-example/src/components/ProductsList.spec.js
- uncomment the test above
bahmutov commented
@abhinaba-ghosh do you have any ideas about this one?
abhinaba-ghosh commented
Hi @bahmutov , thanks for finding out this bug. I am looking into this.
abhinaba-ghosh commented
Changes are available in V2.0.1
Breaking changes introduced.
Raised PR: #386
bahmutov commented
works