-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript error while using Cypress.Command.add(): Property 'selector' does not exist on type 'JQuery<HTMLElement>' #20376
Comments
5 tasks
cypress-bot
bot
added
the
stage: needs review
The PR code is done & tested, needs review
label
Feb 27, 2022
atarek12
added a commit
to atarek12/cypress
that referenced
this issue
Feb 27, 2022
atarek12
added a commit
to atarek12/cypress
that referenced
this issue
Feb 27, 2022
atarek12
added a commit
to atarek12/cypress
that referenced
this issue
Feb 27, 2022
cypress-bot
bot
added
stage: waiting
stage: needs review
The PR code is done & tested, needs review
and removed
stage: needs review
The PR code is done & tested, needs review
stage: waiting
labels
Apr 8, 2022
flotwig
pushed a commit
that referenced
this issue
Apr 15, 2022
flotwig
added a commit
that referenced
this issue
Apr 15, 2022
flotwig
added a commit
that referenced
this issue
Apr 15, 2022
tbiethman
added a commit
that referenced
this issue
Apr 15, 2022
tgriesser
added a commit
that referenced
this issue
Apr 20, 2022
…e-config * 10.0-release: chore: Move component-index generation to scaffold-config package (#21090) fix: label text should be clickable to toggle snapshot highlight (#21122) feat: add next preset to webpack-dev-server-fresh (#21069) chore: add dev-servers as deps to server to be included in the binary (#21142) fix: do not highlight preExtension if selected option is renameFolder (#21121) fix(unify): Remove 'Reconfigure' dropdown from Testing Type chooser (#21063) feat(unify): launchpad header breadcrumbs and reusable tooltip component (#20648) test: add windows-test-kitchensink job (#20847) fix: aut centering and height calculation (#21019) chore: fix tests that fail on windows (#21055) fix: running a new test after already having run tests (#21087) fix: ct project setup framework keys for next and nuxt (#21116) fix: remove MountReturn from scaffolded ct support file (#21119) fix: do not scaffold fixtures if folder exist (#21078) fix: revert "fix: types for Cypress.Commands.add (#20376)" (#21104) chore: Update Chrome (stable) to 100.0.4896.127 and Chrome (beta) to 101.0.4951.34 (#21083) fix: types for Cypress.Commands.add (#20376) (#20377)
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
cypress-bot
bot
removed
the
stage: needs review
The PR code is done & tested, needs review
label
Apr 25, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current behavior
I am getting a Typescript error for those cases:
In the above example,
element
is of typeunknown
but instead, it should beJQuery<HTMLElement>
, this could be handled by passing the generics values like that:But I think passing
true
to theprevSubject
option, the element type should beJQuery<HTMLElement>
by itself.I am trying to access the
selector
property, but I got a typescript error that it does not exist on typeJQuery<HTMLElement>
Desired behavior
No typescript error should be printed, as the
selector
property does exist in theelement
object.Test code to reproduce
https://github.com/atarek12/cypress/blob/fix-prevSubject-types/cli/types/tests/cypress-tests.ts#L87
Cypress Version
9.5.0
Other
No response
The text was updated successfully, but these errors were encountered: