Files
odoo_source/addons/mail_bot/static/tests/messaging_initializer_tests.js
T
Louis Wicket (wil) df147ac6f2 [IMP] mail, *: move model tests into/static/tests
* : mail_bot, website_livechat
Task-2759560

Part-of: odoo/odoo#86464
2022-03-17 11:27:59 +01:00

47 lines
1.1 KiB
JavaScript

/** @odoo-module **/
import { beforeEach, start } from '@mail/utils/test_utils';
QUnit.module('mail_bot', {}, function () {
QUnit.module('messaging_initializer_tests.js', {
beforeEach() {
beforeEach(this);
this.start = async params => {
const { env, widget } = await start(Object.assign({}, params, {
data: this.data,
}));
this.env = env;
this.widget = widget;
};
},
});
QUnit.test('OdooBot initialized at init', async function (assert) {
// TODO this test should be completed in combination with
// implementing _mockMailChannelInitOdooBot task-2300480
assert.expect(2);
await this.start({
env: {
session: {
odoobot_initialized: false,
},
},
async mockRPC(route, args) {
if (args.method === 'init_odoobot') {
assert.step('init_odoobot');
}
return this._super(...arguments);
},
});
assert.verifySteps(
['init_odoobot'],
"should have initialized OdooBot at init"
);
});
});