Skip to content

Type error when trying to chain drag(...).then(...) #126

@p1xell0rd

Description

@p1xell0rd

I'm trying to chain the then method after calling drag like this:

cy.get(`[data-itemId="${itemId}"]`)
  .drag(`[data-draggableId="${targetDraggableId}"]`)
  .then((success: boolean) => assert.isTrue(success));

That's pretty much what is also shown in the readme file, but I get the Typescript error TS2339: Property 'then' does not exist on type 'true'.
Looking at the type declarations for the drag function, I think it either has to return Chainable or a Promise instead of a boolean in order to allow for chaining, or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions