Dialog windows tests

Not only a non–collapsed selection is required, but also that `selectedContainer` returns a container. This increases the chance that a link will actually be created with this selection and that this is something that the user wants.