Imagine reviewing two proposed changes to a shared reference. You approve a correction to the description of a service and reject a separate suggestion about its schedule. The interface sends both decisions together. Now suppose the response says the approval went through and the schedule suggestion was already decided elsewhere. A single success message would make the second decision easy to miss. A single failure message would obscure the approval. The interface needs to carry both facts forward, because saving one decision and refusing another can appear in the same response.
Count the decisions that went through
We examined the code that summarizes per-item outcomes in a review interface. It counts approvals and rejections as saved decisions when the response identifies them as such. A recorded rejection belongs in the saved count because the review action was recorded in the supplied outcome. To test the distinction, we supplied one approved result and then, in a separate fixture, one rejected result. Both produced one saved decision, zero refusals and success severity. The count tells a reviewer how many decisions were saved. It takes the individual outcome to tell whether something was approved or rejected.
In another fixture, the response contained one approval and one result indicating that an item had already been decided elsewhere. The summary kept the saved count at one, counted one refusal and returned warning severity with an explanation for the refused item. Reading the page code showed how these pieces fit together. The alert displays the count and lists the explanations beneath it. We exercised the summary in isolation, so the fixture establishes what the summary returns for that input. It supplies no observation of the alert in a browser.
Give a remark the right weight
A remark can also accompany a successful decision. In the replacement fixture, an approval came with an indication that it replaced an earlier accepted item. The summary returned one saved decision and zero refusals, as it did for the plain approval. It also returned a remark about the replacement and selected informational severity. The two fixtures make the distinction concrete. The counts can stay the same while the action merits an explanation. A refusal makes the alert a warning. With no refusals, a remark makes it informational and an empty list of remarks leaves it at success.
That distinction matters in the fictional batch. In the mixed fixture, the warning coexisted with a saved count. The summary supplied an explanation that the refused item had already been decided. A reader should be able to make sense of the result from the words and count as well as from the alert's visual treatment. We did not test whether readers actually do that.
Explain what changed
A supplied conflict can get two different explanations. In one synthetic case we gave the helper the context of an edit and a conflict result carrying the same version as the submitted proposal. The helper explained the conflict as a change to the accepted item the proposal was editing. With a different returned proposal version, it used the general explanation that the proposed item had changed since loading. An ordinary item with no edit context also received that general explanation even when we used the same returned version as in the first example. The edit context is part of the distinction.
Across seven local fixtures, we gave the client helper response records directly and checked counts, severity and remarks. A hosted frontend job separately ran the repository’s existing tests on the pull request revision and passed. That job did not run these seven independent fixtures. The local setup exercised the presentation rule with inputs we could vary one at a time. It did not send a batch request or observe which decisions the server persisted. To find out whether the response accurately reports what happened in storage, we would need to exercise the server with a mixed batch and compare each response with the saved state. To find out whether people can interpret the warning, we would need to watch them use the interface. The fixtures answer the smaller question of what the client communicates when it receives those particular outcomes.
← All engineering articles