Try this, getting rid of the modal-dialog click entirely.

It looks like it's simply not reliable to click on a Foundation
modal dialog when using Poltergeist/PhantomJS.  So don't do it,
anywhere.