Skip to content

fix: xy_plot_tool_spec.js to use rdg-focus-sink to open cell editor#2784

Open
dougmartin wants to merge 2 commits intomasterfrom
fix-flaky-xy-plot-test
Open

fix: xy_plot_tool_spec.js to use rdg-focus-sink to open cell editor#2784
dougmartin wants to merge 2 commits intomasterfrom
fix-flaky-xy-plot-test

Conversation

@dougmartin
Copy link
Member

The typeInTableCell method used a click to open the cell editor, which was unreliable and caused flaky test failures (timeout waiting for .rdg-text-editor). Updated to use the same rdg-focus-sink + type('{enter}') approach already proven reliable in typeInTableCellXY.

The typeInTableCell method used a click to open the cell editor, which
was unreliable and caused flaky test failures (timeout waiting for
.rdg-text-editor). Updated to use the same rdg-focus-sink + type('{enter}')
approach already proven reliable in typeInTableCellXY.
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.71%. Comparing base (b18ee7d) to head (29ebaf0).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2784      +/-   ##
==========================================
- Coverage   86.19%   85.71%   -0.48%     
==========================================
  Files         847      847              
  Lines       46352    46352              
  Branches    12043    12043              
==========================================
- Hits        39951    39730     -221     
- Misses       5995     6195     +200     
- Partials      406      427      +21     
Flag Coverage Δ
cypress ?
cypress-regression 75.20% <ø> (+0.59%) ⬆️
cypress-smoke ?
jest 50.51% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress
Copy link

cypress bot commented Mar 2, 2026

collaborative-learning    Run #17962

Run Properties:  status check passed Passed #17962  •  git commit 29ebaf0d85: fix: scope rdg-focus-sink selector in typeInTableCell to parent table
Project collaborative-learning
Branch Review fix-flaky-xy-plot-test
Run status status check passed Passed #17962
Run duration 03m 15s
Commit git commit 29ebaf0d85: fix: scope rdg-focus-sink selector in typeInTableCell to parent table
Committer Doug Martin
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
View all changes introduced in this branch ↗︎

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Cypress table-cell editing interactions to avoid flaky editor-opening behavior by switching from click-to-edit to using React Data Grid’s keyboard focus sink + {enter} approach (mirroring the existing typeInTableCellXY strategy).

Changes:

  • Update TableToolTile.typeInTableCell() to open the editor via .rdg-focus-sink + type('{enter}') instead of an additional click.
  • Remove an outdated “flaky” comment in the XY plot tool Cypress spec.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cypress/support/elements/tile/TableToolTile.js Changes table cell edit helper to use RDG keyboard activation via .rdg-focus-sink.
cypress/e2e/functional/tile_tests/xy_plot_tool_spec.js Removes a stale comment about flakiness.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@scytacki scytacki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change by itself looks fine to me. However, based on my comment from the other usage of rdg-focus-sink in this file, and the commit message when it was added: 312e291 I suspect this will break other tests.

I'd recommend running the full test suite locally, or at least running ~11 or so specs that call this typeInTableCell.

The fix might be to add "within" to all of the tests that fail. Or you could do what I proposed in the commit message and make the table utility for cypress a class that you have to instantiate with a specific table model. I think this is why I didn't make this change originally. ;)

The global cy.get('.rdg-focus-sink') selector matches elements in all
tables on the page, causing cy.type() to fail when multiple tables are
present (e.g., duplicate_tile_spec.js). Scope the selector by traversing
from the target cell to its parent .rdg container.
@dougmartin
Copy link
Member Author

dougmartin commented Mar 3, 2026

The change by itself looks fine to me. However, based on my comment from the other usage of rdg-focus-sink in this file, and the commit message when it was added: 312e291 I suspect this will break other tests.

I'd recommend running the full test suite locally, or at least running ~11 or so specs that call this typeInTableCell.

The fix might be to add "within" to all of the tests that fail. Or you could do what I proposed in the commit message and make the table utility for cypress a class that you have to instantiate with a specific table model. I think this is why I didn't make this change originally. ;)

Good catch, but after looking at all the tests that use this function (with Claude's help) I scoped the lookup from the cell itself (in commit #29ebaf0d8). This way typeInTableCell self-scopes like typeInTableCellXY does, without requiring callers to change. To save Cypress runs I ran all 11 the specs that use typeInTableCell locally and they all pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants