But it doesn't cause the dialog to save.
That's not working like that since jQuery can't trigger events that itself didn't attach.
You'll need to write your own triggerEvent function (or you just copy the one from QUnit which should work perfectly in all browsers: https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L634).
There's currently no better way to save and close the dialog. Sorry for that.
Didn't know that. Thanks for the response!