Add discardChanges branch to unit test