This is a small repo to demonstrate a bug that occurs in a Cypress test when using an ag-grid editable grid with the stopEditingWhenGridLosesFocus flag on Chromium.
This is a toy app to expose the bug which was really discovered in a proprietary codebase.
- Clone this repo.
- Run
yarn
to install dependencies - Run
yarn e2e --watch
to run Cypress in watch mode. - See a successful running test (it loads a table of sample data, asserts the values, changes two of the values with text that has multiple characters, and asserts that the new values are accepted).
- Make a trivial change to
app.spec.ts
(like adding a space at the end of a line). - See that the second run will fail (only the last characters of the new values will be visible).
The bug manifests under these conditions:
- Hot reload
- On Electron 87, Chrome 89, and Edge 89
- With stopEditingWhenGridLosesFocus used in ag-grid
The bug does not manifest under these conditions:
- Initial execution
- After hitting the replay button
- On Firefox 86 (I have not tested other browsers)
- Without the stopEditingWhenGridLosesFocus flag
This seems to be the same general problem that was reported in cypress-io/cypress#5394, but that was apparently fixed. I don't know if this demonstrates a regression, or if it was a previously-unknown corner case.
This issue was reported both to Cypress and ag-grid (paywall).