odoo-13.0/addons/web/static/tests/helpers/test_utils_create.js
/**
 * Similar as createView, but specific for calendar views. Some calendar
 * tests need to trigger positional clicks on the DOM produced by fullcalendar.
 * Those tests must use this helper with option positionalClicks set to true.
 * This will move the rendered calendar to the body (required to do positional
 * clicks), and wait for a setTimeout(0) before returning, because fullcalendar
 * makes the calendar scroll to 6:00 in a setTimeout(0), which might have an
 * impact according to where we want to trigger positional clicks.
 *
 * @param {Object} params see @createView
 * @param {Object} [options]
 * @param {boolean} [options.positionalClicks=false]
 * @returns {Promise<CalendarController>}
 */
Similar as createView, but specific for calendar views. Some calendar
tests need to trigger positional clicks on the DOM produced by fullcalendar.
Those tests must use this helper with option positionalClicks set to true.
This will move the rendered calendar to the body (required to do positional
clicks), and wait for a setTimeout(0) before returning, because fullcalendar
makes the calendar scroll to 6:00 in a setTimeout(0), which might have an
impact according to where we want to trigger positional clicks.


Similar as createView but specific for calendar views . Some calendar tests need to trigger positional clicks on the DOM produced by fullcalendar . Those tests must use this helper with option positionalClicks set to true . This will move the rendered calendar to the body ( required to do positional clicks ) and wait for a setTimeout ( 0 ) before returning because fullcalendar makes the calendar scroll to 6 : 00 in a setTimeout ( 0 ) which might have an impact according to where we want to trigger positional clicks .
async function createCalendarView(params, options) {
    var calendar = await createView(params);
    if (!options || !options.positionalClicks) {
        return calendar;
    }
    var $view = $('#qunit-fixture').contents();
    $view.prependTo('body');
    var destroy = calendar.destroy;
    calendar.destroy = function () {
        $view.remove();
        destroy();
    };
    await concurrency.delay(0);
    return calendar;
}
async function createCalendarView ( params , options ) { var calendar = await createView ( params ) ; if ( ! options || ! options . positionalClicks ) { return calendar ; } var $view = $ ( '#qunit-fixture' ) . contents ( ) ; $view . prependTo ( 'body' ) ; var destroy = calendar . destroy ; calendar . destroy = function ( ) { $view . remove ( ) ; destroy ( ) ; } ; await concurrency . delay ( 0 ) ; return calendar ; }
Similar as createView, but specific for calendar views.
Similar as createView but specific for calendar views .