Refactor edit cancellation test cases to share helper