Simplify and add tests of confirm dialog