fix: workload promote test and status code#439
Open
dimakis wants to merge 1 commit into
Open
Conversation
- Fix vacuous broadcast test: use setWorkloadBroadcast() instead of monkey-patching non-existent app._workloadBroadcast property - Add missing test for promote with description but no title - Return 400 (not 404) when item exists but has no title Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dimakis
commented
Jul 4, 2026
dimakis
left a comment
Owner
Author
There was a problem hiding this comment.
Centaur Review
Found 2 issue(s) (1 warning).
server/__tests__/workload-routes.test.ts
Good fixes — proper use of setWorkloadBroadcast API and correct 400/404 status differentiation — but the new 400 branch (item exists, no title) lacks test coverage.
- 🟡 missing_tests: The code change introduces a new 400 status path (item exists in workloadStore but has no title), but there's no test covering it. The new test only covers the 404 path (missing item). Add a test that creates an item with an empty-string title, then promotes it without providing a body title, and asserts 400 with 'No title provided'.
[fixable] - 🔵 style (L570): The reset comment '// Reset — no broadcast callback in test environment' explains what the line does, not why. The code
setWorkloadBroadcast(() => {})is self-explanatory. Per project conventions, this comment should be removed.[fixable]
| expect(workloadBroadcasts).toHaveLength(0); | ||
|
|
||
| (app as any)._workloadBroadcast = origBroadcast; | ||
| // Reset — no broadcast callback in test environment |
Owner
Author
There was a problem hiding this comment.
🔵 style: The reset comment '// Reset — no broadcast callback in test environment' explains what the line does, not why. The code setWorkloadBroadcast(() => {}) is self-explanatory. Per project conventions, this comment should be removed. [fixable]
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.
Summary
setWorkloadBroadcast()instead of monkey-patching non-existentapp._workloadBroadcastPre-existing issues flagged by Centaur on PR #428.
Test plan
🤖 Generated with Claude Code