test(chat): cover the selection bar's re-narrowing of a stale bubble - #1406
Merged
Conversation
Gating the actions on the edit and delete windows (#1403) made the ToggleMessageSelection reducer re-apply them to the bubble it selects, so a transcript row resolved well inside a window no longer offers an action the server would answer CANNOT_EDIT or CANNOT_DELETE. Nothing asserted that. One test per window, because a window wired to the wrong capability passes either test alone. Both fail when the narrowing is dropped from the reducer.
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.
#1403 made the
ToggleMessageSelectionreducer re-apply the edit and delete windows to the bubble it selects, so a transcript row that resolved well inside a window stops offering an action the server would answerCANNOT_EDITorCANNOT_DELETE. Nothing asserted that behaviour, which is how the gap went unnoticed.One test per window, because a window wired to the wrong capability would pass either test on its own. Both were checked against a reducer with the narrowing removed and fail there, so neither is vacuous.
The bubble helper's
sentAtis decades in the past, so any finite window in the test has closed by the time the reducer compares it againstClock.System.now().