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

rightclick: wrong description in index.d.ts? #5617

Closed
warpdesign opened this issue Nov 7, 2019 · 2 comments · Fixed by #5618
Closed

rightclick: wrong description in index.d.ts? #5617

warpdesign opened this issue Nov 7, 2019 · 2 comments · Fixed by #5618

Comments

@warpdesign
Copy link
Contributor

warpdesign commented Nov 7, 2019

Current behavior:

According to the documentation, one of the cy.rightclick call signature should be rightclick(position, options?) but when attempting to use this version of the call, TypeScript returns an error:

image

Looking at the index.d.ts file, it seems rightclick's definition only has one signature, the one with the options object:

    /**
     * Right-click a DOM element.
     *
     * @see https://on.cypress.io/rightclick
     */
    rightclick(options?: Partial<ClickOptions>): Chainable<Subject>

The click method has two additional call signatures, so calling cy.click('topLeft') will work as expected:

click(options?: Partial<ClickOptions>): Chainable<Subject>
click(position: string, options?: Partial<ClickOptions>): Chainable<Subject>
click(x: number, y: number, options?: Partial<ClickOptions>): Chainable<Subject>

Desired behavior:

All three call types should be present in the index.d.ts file for rightclick so that this call is valid from TypeScript:

cy.get('.element').rightclick('topLeft');

I made a PR adding the missing call signatures.

Versions

Cypress 3.6.0
macOS Catalina
Chrome 78

warpdesign added a commit to warpdesign/cypress that referenced this issue Nov 7, 2019
These two call signatures where missing for rightclick and dblclick: only the `rightclick(options?: Partial<ClickOptions>): Chainable<Subject> ` one was present.

See cypress-io#5617
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Nov 7, 2019
jennifer-shehane pushed a commit that referenced this issue Nov 7, 2019
* ADDED: missing call signatures for right/dblclick

These two call signatures where missing for rightclick and dblclick: only the `rightclick(options?: Partial<ClickOptions>): Chainable<Subject> ` one was present.

See #5617

* FIXED: typo

* FIXED: dtslint errors
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 7, 2019

The code for this is done in cypress-io/cypress#5618, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Nov 7, 2019
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 8, 2019

Released in 3.6.1.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant