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

Resource Card Editable Name TestID is not on clickable element #478

Closed
alexpaxton opened this issue Apr 3, 2020 · 1 comment · Fixed by #481
Closed

Resource Card Editable Name TestID is not on clickable element #478

alexpaxton opened this issue Apr 3, 2020 · 1 comment · Fixed by #481
Assignees
Labels
kind/bug Something isn't working

Comments

@alexpaxton
Copy link
Contributor

The onClick handler is not on the same element as the one receiving the testID prop. This requires some extra steps in e2e tests to select the element with the click handler

@alexpaxton alexpaxton added the kind/bug Something isn't working label Apr 3, 2020
@alexpaxton
Copy link
Contributor Author

alexpaxton commented Apr 3, 2020

Example component:

<ResourceCard.EditableName
  onClick={this.handleClickDashboard}
  testID="dashboard-card--name"
/>

Having to write a test like so:

cy.getByTestID('dashboard-card--name').within(() => {
  cy.get('.cf-resource-name--text').click()
})

When it should be written like:

cy.getByTestID('dashboard-card--name').click()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant