function clickDialogButton(buttonId, enableFirst) {
        // Make sure there's one and only one dialog open
        var $dlg = _testWindow.$(".modal.instance"),
            promise = $dlg.data("promise");

        expect($dlg.length).toBe(1);

        // Make sure desired button exists
        var $dismissButton = $dlg.find(".dialog-button[data-button-id='" + buttonId + "']");
        expect($dismissButton.length).toBe(1);

        if (enableFirst) {
            // Remove the disabled prop.
            $dismissButton.prop("disabled", false);
        }

        // Click the button
        $dismissButton.click();

        // Dialog should resolve/reject the promise
        waitsForDone(promise, "dismiss dialog");
    }
Dismiss the currently open dialog as if the user had chosen the given button. Dialogs close
asynchronously; after calling this, you need to start a new runs() block before testing the
outcome. Also, in cases where asynchronous tasks are performed after the dialog closes,
clients must also wait for any additional promises.
@param {string} buttonId  One of the Dialogs.DIALOG_BTN_* symbolic constants.
@param {boolean=} enableFirst  If true, then enable the button before clicking.