odoo-13.0/addons/web/static/tests/helpers/test_utils_modal.js
/**
 * Click on a button in the footer of a modal (which contains a given string).
 * Note that this method checks the unicity of the button.
 *
 * @param {string} text (in english: this method will perform the translation)
 */
Click on a button in the footer of a modal (which contains a given string).
Note that this method checks the unicity of the button.

@param {string} text (in english: this method will perform the translation)
Click on a button in the footer of a modal ( which contains a given string ) . Note that this method checks the unicity of the button . @param { string } text ( in english : this method will perform the translation )
function clickButton(text) {
    var selector = `.modal-footer button:contains(${core._t(text)})`;
    var $button = $(selector);
    if ($button.length !== 1) {
        throw new Error(`Found ${$button.length} button(s) containing '${text}'`);
    }
    $button.click();
    return concurrency.delay(0);
}
function clickButton ( text ) { var selector = ` ${ core . _t ( text ) } ` ; var $button = $ ( selector ) ; if ( $button . length !== 1 ) { throw new Error ( ` ${ $button . length } ${ text } ` ) ; } $button . click ( ) ; return concurrency . delay ( 0 ) ; }
Click on a button in the footer of a modal (which contains a given string).
Click on a button in the footer of a modal ( which contains a given string ) .