Skip to content

fieldsInFormBuilder.cy.js: removeField's delete assertion never checks anything #3430

Description

@vivi-the-going-merry

In tests/cypress/e2e/Forms/fieldsInFormBuilder.cy.js, the removeField helper's final assertion (around line 82) interpolates field — a Cypress chainable, not a string — directly into a selector:

cy.get( `li[data-type="${ field }"]` ).should( 'not.exist' );

Stringifying a chainable can't produce the field's id, so this selector never matches anything and .should( 'not.exist' ) passes unconditionally — for every field type, before and after deletion. The duplicate-creation assertion just above it correctly uses the string fieldId instead. The "delete" half of this test has never actually verified deletion.

Flagged by Franky's review on #3419 (#3419 (review)), not blocking there since removeField is untouched by that PR — filing separately given the blast radius (every call site, past and present).

Activity

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

      No branches or pull requests

      Issue actions