fix(ui): give checkpoint delete cancel buttons unique data-testids (#2871) - #2877
Open
boxcee-interview wants to merge 1 commit into
Open
boxcee-interview wants to merge 1 commit into
boxcee-interview wants to merge 1 commit into
Conversation
…agent-dev#2871) Two Popconfirm dialogs on the same page both title their confirmation "Delete this snapshot?" and both rendered a Cancel button with no data-testid. The checkpoints spec clicked getByRole("button", { name: "Cancel" }) across the whole page, which while the dialog's close animation is still running matches the control on its way out, so the click waits out the 30s timeout and the run reports flaky. The ok buttons already carry data-testids (chat-checkpoint-delete-confirm-<id>, snapshot-details-delete-confirm); the cancel buttons now carry the matching pair (chat-checkpoint-delete-cancel-<id>, snapshot-details-delete-cancel) and the spec targets them directly. Closes kagent-dev#2871 Signed-off-by: Moritz Schmitz von Hülst <[email protected]>
boxcee-interview
requested review from
Charlesthebird and
peterj
as code owners
September 18, 2026 22:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2871
What was wrong
Two Popconfirm dialogs on the same chat page both title their confirmation "Delete this snapshot?" — the divider's own delete (CheckpointDivider.tsx) and the snapshot record dialog's delete (SnapshotDetailsModal.tsx). The ok buttons of each already carry a data-testid; neither cancel button did, so the spec had to look up the cancel by role+name across the whole page. While the record dialog is still mid-close-animation after Escape, the page-wide Cancel lookup resolves to the control on its way out, which never becomes clickable — the click waits out the 30s timeout and the suite reports flaky.
What the fix does
Gives each cancel button the data-testid its ok button already sets, and points the spec at it:
How to Test
cd ui && yarn test:pw — the previously flaky test "chat: the mark names itself, carries its controls, and opens its record" now targets the divider's own cancel button, and "chat: a snapshot is deleted from its record" targets the dialog's own cancel. Verified in an isolated container (node:24, yarn 4.9.0, Playwright chromium): yarn lint clean (0 errors), yarn typecheck clean, and the checkpoints spec passing on chromium — including both affected tests.