Skip to content

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

Closed
@warpdesign

Description

@warpdesign
Contributor

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

Activity

cypress-bot

cypress-bot commented on Nov 7, 2019

@cypress-bot
Contributor

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 commented on Nov 8, 2019

@cypress-bot
Contributor

Released in 3.6.1.

locked as resolved and limited conversation to collaborators on Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @warpdesign

      Issue actions

        rightclick: wrong description in index.d.ts? · Issue #5617 · cypress-io/cypress