A small SwiftUI screen shows a text summary for the selected record and triggers an update when the model appears and changes.
Requirements
- Use
Swift 6, iOS 18 SDK, and SwiftUI.
- The screen runs on
MainActor and assumes that the status update is called from a UI context.
- The test scenario uses a deterministic mock service with no network access.
- The summary must be built from the passed-in model, not from stale view state.
- If a new model arrives without a date, the screen must clear the date in the display, not keep the old value.
Reproduction
- Open the screen with the following model:
{"id":"A1","title":"Alpha","updatedAt":"2026-01-01T10:00:00Z"}
- Wait for the update to complete.
- Pass the same view structure with a new model:
{"id":"A1","title":"Beta","updatedAt":null}
- Wait for the update again and compare the displayed summary.
Expected behavior
- After the first update, the screen shows the summary for
Alpha with a date.
- After the model is passed again, the text changes to
Beta.
- If the new model has no date, the old date must not remain on the screen.
- No previous result should overwrite the current model after the input data changes.