Skip to content

test: guard sprint promote-to-draft button rules and editor body adoption - #5362

Merged
atomantic merged 1 commit into
mainfrom
claim/issue-5300
Aug 29, 2026
Merged

test: guard sprint promote-to-draft button rules and editor body adoption#5362
atomantic merged 1 commit into
mainfrom
claim/issue-5300

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

Completes #5300. The promote-a-finished-sprint-to-the-draft feature shipped in eaab0bd05, but without two of the regression guards the issue's acceptance criteria called for — so this diff is test-only; no product behavior changes.

  • ExercisePanel.test.jsx (new) — pins the "Add to draft" visibility predicate (finished, has captured text, belongs to the open work, not already promoted), the promoted-row marker, the editorDirty disabled state and its "Save first" hint, and both the success and failure callbacks.
  • WorkEditor.test.jsx — pins the widened body-sync guard: a clean editor adopts a server-pushed activeDraftBody, a dirty one keeps the writer's unsaved buffer. That guard decides whether a sibling panel's server-side append can clobber in-progress typing, and it was the riskiest untested part of the original change.

Each assertion was checked against a mutated component to confirm it fails when the behavior it names is removed, rather than passing incidentally.

Closes #5300

Test plan

  • cd client && npm test — 807 files / 10192 tests pass.
  • cd server && npm test — 1721 files / 35366 tests pass (unchanged; diff is client-only).
  • cd client && npm run lint — clean.
  • Non-vacuity probes, each reverted afterward:
    • Dropping hasNewCleanBody from the WorkEditor body-sync guard fails the adoption test.
    • Dropping ex.status === 'finished' from the ExercisePanel predicate fails the running-sprint case.
    • Reading wordsAdded instead of countWords(appendedText) for the success toast fails the success-path test.

…tion (#5300)

The promote-to-draft feature shipped in eaab0bd without the two client
regression guards its plan called for. ExercisePanel.test.jsx pins the button
visibility predicate (finished, has text, matches the open work, not already
promoted), the dirty-editor disabled state, and the success/failure callbacks.
WorkEditor.test.jsx pins the widened body-sync guard: a clean editor adopts a
server-pushed activeDraftBody, a dirty one keeps the writer's buffer. Verified
non-vacuous by reverting the guard - the adoption case then fails.
@atomantic
atomantic merged commit e1af5de into main Aug 29, 2026
7 checks passed
@atomantic
atomantic deleted the claim/issue-5300 branch August 29, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan-feature-writers-room-promote-sprint-to-draft] Add a finished sprint's text to the work draft

1 participant