Dialog windows tests

Code that determines whether dialog should open is in new `_shouldDialogOpen`.