Skip to content
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

Property 'focus' does not exist on type 'Assertion'. #23905

Open
steinybot opened this issue Sep 20, 2022 · 2 comments
Open

Property 'focus' does not exist on type 'Assertion'. #23905

steinybot opened this issue Sep 20, 2022 · 2 comments
Labels
E2E Issue related to end-to-end testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.

Comments

@steinybot
Copy link

Current behavior

expect(el).to.have.focus

Reports that focus is missing:

TS2339: Property 'focus' does not exist on type 'Assertion'.

Screen Shot 2022-09-21 at 8 23 57 AM

And yes I have:

    "typeRoots": [
      "cypress/types"
    ]

We can see in cypress/types/chai-jquery/index.d.ts is using:

// Type definitions for chai-jquery 1.1.1

The assertion does exist (#97) although it is using is(':focus') rather than === document.activeElement like the chai-jquery docs say (https://www.chaijs.com/plugins/chai-jquery/#focus).

Desired behavior

Include all the available chai-jquery properties in the Typescript definitions.

Test code to reproduce

https://github.com/steinybot/bug-reports/tree/cypress/chai-jquery-focus

Cypress Version

10.8.0

Node version

18.5.0

Operating System

macOS 12.6

Debug Logs

No response

Other

No response

@steinybot
Copy link
Author

Those type definitions seem really old. There are a few missing assertions from chai-jquery 2.1.0.

@chrisbreiding
Copy link
Contributor

Looks like the types could use an update. I'll route this to a team to fix, though we'd also be happy to accept a PR to fix it as well.

@chrisbreiding chrisbreiding removed their assignment Sep 22, 2022
@nagash77 nagash77 added E2E Issue related to end-to-end testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. and removed routed-to-e2e labels Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.
Projects
None yet
Development

No branches or pull requests

3 participants