Imagine a builder preparing a signup form for a workshop. It creates a draft, adds questions, and configures what people would see if they visited the form while it was closed. A custom closed message is useful, but imagine the service rejects that setting. Now consider a different failure. The service refuses to add one of the questions. Both operations can raise an error, yet their effects on the draft differ. We looked at a form builder that treats those failures differently and tested what it reports in each case. The tests used a mock service, so the final form state described here is the state recorded by the mock.
Keep the missing setting visible
The builder uses a small wrapper around some settings calls. If a wrapped call throws, the wrapper logs a warning that names the setting. It then returns to the builder, which continues with the remaining steps. To test this behavior, we made three presentation settings throw in separate local runs. One rejected the progress indicator, one rejected a confirmation message, and one rejected the custom closed message. In each fixture the builder returned without a top-level error, the mock had the expected number of items, and the log named the rejected setting. The mock also recorded that the form was closed.
A warning changes the evidence available after the build. The item count tells us the builder reached the expected size in that fixture. The warning identifies a setting the builder could not apply. An operator looking only at the absence of an error would lose that second observation and might assume all display settings were in place. A warning gives the operator something concrete to inspect before the draft is used. It does not reveal which default a real service would apply, and the fixture does not check what anyone would see after visiting a hosted form.
Treat a missing question as a build failure
The item-creation fixture makes the third attempt to add a text item throw. That error reaches the caller. The log records the build failure, and the mocked form still records that it is closed. The distinction is visible in the results. The display-setting cases finish with a named warning and the expected item count. The question case never reaches that completed state. Continuing silently would leave the caller with a form whose contents differ from what the builder was asked to create.
A failed build raises a separate question about what it leaves behind. The fixture does not establish what persists on a hosted service after a failed call. It does not test deletion or show that rerunning would recover the same draft. That matters when a service call can create an object before a later call fails. A reported error tells us the builder did not finish. A separate observation would be needed to establish what remains on the service and whether a later run should reuse it.
Check closure separately from completion
Another local fixture records the order of calls to the mock. It observes that response acceptance is set to false before configuration and again at the end of configuration. This order lets us test the closed state independently of whether a display setting was applied. It also leaves a clear gap. The tests did not make the closure call itself fail, so they do not establish how the builder would behave if a hosted service rejected it.
The full local mock suite reported 4,654 passing checks at the merged revision. That is the suite total, including the fixtures discussed here. Hosted repository checks ran separately and did not exercise this form. The mock checks leave the settings and response status of a real draft unverified. For the tested cases, the distinction gives the builder a more precise report. A rejected presentation setting leaves a warning on a completed mock build. A failed item insertion returns an error for an incomplete build. The test records show which of those outcomes happened without making either one a verdict on whether a live form is ready.
← All engineering articles