<commit_before>odoo.define('mail.testUtils', function (require) {
"use strict";

var Discuss = require('mail.chat_discuss');

var AbstractService = require('web.AbstractService');
var Bus = require('web.Bus');
var testUtils = require('web.test_utils');
var Widget = require('web.Widget');

/**
 * Test Utils
 *
 * In this module, we define some utility functions to create mock objects
 * in the mail module, such as the BusService or Discuss.
 */

/**
 * Create a mock bus_service, using 'bus' instead of bus.bus
 *
 * @param {web.bus} bus
 * @return {AbstractService} the mock bus_service
 */
function createBusService(bus) {
    var BusService =  AbstractService.extend({
        name: 'bus_service',
        /**
         * @override
         */
        init: function () {
            this._super.apply(this, arguments);
            if (!bus) {
                bus = new Bus();
            }
            this.bus = new _.extend(bus, {
                /**
                 * Do nothing
                 */
                start_polling: function () {},
            });
        },

        //--------------------------------------------------------------------------
        // Public
        //--------------------------------------------------------------------------

        /**
         * Get the bus
         */
        getBus: function () {
            return this.bus;
        },
    });

    return BusService;<commit_msg>[FIX] mail: test utils: mock is_odoo_focused<commit_after>odoo.define('mail.testUtils', function (require) {
"use strict";

var Discuss = require('mail.chat_discuss');

var AbstractService = require('web.AbstractService');
var Bus = require('web.Bus');
var testUtils = require('web.test_utils');
var Widget = require('web.Widget');

/**
 * Test Utils
 *
 * In this module, we define some utility functions to create mock objects
 * in the mail module, such as the BusService or Discuss.
 */

/**
 * Create a mock bus_service, using 'bus' instead of bus.bus
 *
 * @param {web.bus} bus
 * @return {AbstractService} the mock bus_service
 */
function createBusService(bus) {
    var BusService =  AbstractService.extend({
        name: 'bus_service',
        /**
         * @override
         */
        init: function () {
            this._super.apply(this, arguments);
            if (!bus) {
                bus = new Bus();
            }
            this.bus = new _.extend(bus, {
                /**
                 * Do nothing
                 */
                start_polling: function () {},
                is_odoo_focused: function () {
                    return true;
                },
            });
        },

        //--------------------------------------------------------------------------
        // Public
        //--------------------------------------------------------------------------

        /**
         * Get the bus
         */
        getBus: function () {
            return this.bus;
        },
    });

    return BusService;
{'fraction_non_alphanumeric': 0.21328437917222964, 'fraction_numerical': 0.0, 'mean_word_length': 1.2930374904361133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4220931', 'n_tokens_mistral': 748, 'n_tokens_neox': 729, 'n_words': 198}