Dialog windows tests

This function from #641.