Test for handling the cancel button