---
title: "Verify iOS sheet dismissal preserves edit intent"
description: "Test unsaved edits in an iOS sheet, including dismissal warnings, continued editing, and explicit discard with an unchanged persisted record."
canonical_url: "https://vostride.com/agent-library/ios-flows/sheet-dismiss-unsaved-edits.md"
md_url: "https://vostride.com/agent-library/ios-flows/sheet-dismiss-unsaved-edits.md"
content_kind: "recipe"
topic: "ios-flows"
---

# Verify iOS sheet dismissal preserves edit intent

Test unsaved edits in an iOS sheet, including dismissal warnings, continued editing, and explicit discard with an unchanged persisted record.

## Risk

Interactive sheet dismissal can escape the save and cancel handlers used by buttons. The visible form and stored record must be checked separately so a dismissed sheet is not mistaken for either a save or a clean cancellation.

## Fixtures

- An iOS sandbox target configured with bundleId, a device profile, and explicit use.mobile.appState: preserve.
- A test profile containing a known display name and biography, with a read-only profile endpoint providing its revision.
- A product requirement specifying the unsaved-change prompt for sheet dismissal and a unique replacement biography for this run.

## Steps

1. Open the profile edit sheet and verify the original name and biography match the independent baseline revision.
2. Replace both values and initiate the supported sheet-dismiss gesture or control; verify the unsaved-change confirmation appears.
3. Choose Continue editing and verify both replacement values remain in their original fields without a hidden save.
4. Initiate dismissal again, choose Discard, and verify the profile screen shows the original name and biography.
5. Reopen the editor and verify the original values; inspect the profile oracle and verify its revision and saved fields are unchanged throughout the cancelled edit.

## Expected results

- Continue editing restores both unsaved fields in the still-open sheet.
- Discard closes the sheet without persisting either replacement value.
- The independent profile revision stays at its baseline value, proving no silent save occurred.

## False-pass traps

- The underlying profile screen may display cached original text even after a silent write.
- Testing only the Cancel button misses the separate interactive-dismiss path.

## Cleanup

- Clear any retained draft in the sandbox account without changing the baseline profile.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa mobile testing](/docs/agent-qa/guides/mobile-testing.md)
- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa hooks](/docs/agent-qa/guides/hooks.md)

- [iOS application QA recipes](/agent-library/ios-flows.md)
- [Software factory QA library](/agent-library.md)
