fix: cy.then shows wrong type when collection of HTMLElement's is provided#15869
Conversation
|
Thanks for taking the time to open a PR!
|
|
@sainthkh Any thoughts on needing this extra layer of types for |
|
@badeball can you please review our code of conduct here https://github.com/cypress-io/cypress/blob/develop/CODE_OF_CONDUCT.md |
|
Dear @badeball if you don't think we (and I personally) eat our own food (which is the right expression, not the offensive version you used several times) by writing a lot of Cypress code, then (pun intended) I don't know what to say. Perhaps taking a break and approaching this problem after a cooling-off period would help you see this problem from our point of view. |
There was a problem hiding this comment.
LGTM.
When cy.then() returns an array of HTMLElements, it wraps it with JQuery. I checked it with the code below:
it('t', () => {
cy.get('div')
.then(($div) => {
$div // $ExpectType JQuery<HTMLDivElement>
return [$div[0], $div[0]]
})
.then(($div) => {
console.log($div) // => jQuery object.
$div // $ExpectType JQuery<HTMLDivElement>
})
})* develop: (49 commits) fix: `cy.type()` should not change the value attr of button-like inputs. (#16154) fix: properly detect `cy.intercept(url, routeMatcher, handler)` overload (#16167) fix: consider multiple routes when looking for aliases (#16180) fix: pass contextIsolation: true (#16165) chore: fix failing "should handle aborted requests" test (#16170) feat(issue-3741): added keyboard support for folder (#15648) fix(webpack-dev-server): remove hard dependency on html-webpack-plugin v4 (#16108) chore(deps): downgrade electron to v12.0.0-beta.14 (#16113) fix: accept absolute paths in vite dev server (#16148) fix: cy.then shows wrong type when collection of HTMLElement's is provided (#15869) fix: do not treat utf8 requests as binary (#15946) chore: fix types docs: fix broken links for @cypress/react example recipes (#15674) update circle yml ignore undefined beforeEach fix: make vite-dev-server work on windows (#16103) chore: add triple slash reference chore: remove conflicting types chore: rebuild yarn lock resolve conflicts in master(fe0b63c) and develop ...
|
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
User facing changelog
cy.thenwill show correct type when collection of HTMLElement's is provided.Additional details
Related issues / PRs:
#8440
#14875
#15624
How has the user experience changed?
N/A
PR Tasks