[IMP] mail, *: make start method handle cleanup
*: calendar, hr, hr_holidays, im_livechat, mail, mail_bot, note, sms, snailmail, website_livechat, website_slides. This commit prepares the removal of beforeEach function in the mail test suite. Cleanup was relying on beforeEach adding widgets, components, unpatch method 'this'. We need to clean things up without using either beforeEach or 'this'. task-2792108 closes odoo/odoo#86526 Related: odoo/enterprise#25326 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
import ActivityMenu from '@mail/js/systray/systray_activity_menu';
|
||||
|
||||
import testUtils from 'web.test_utils';
|
||||
@@ -39,9 +39,6 @@ QUnit.module('ActivityMenu', {
|
||||
},
|
||||
});
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('activity menu widget:today meetings', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -51,9 +50,6 @@ QUnit.module('hr', {}, function () {
|
||||
{ id: 13, display_name: "Yoshi" }
|
||||
);
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('many2one_avatar_employee widget in list view', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
start,
|
||||
@@ -29,9 +28,6 @@ QUnit.module('partner_im_status_icon_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('on leave & online', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
start,
|
||||
@@ -30,9 +29,6 @@ QUnit.module('thread_icon_tests.js', {
|
||||
};
|
||||
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('thread icon of a chat when correspondent is on leave & online', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insertAndReplace, link } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -16,17 +15,13 @@ QUnit.module('thread_view_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { afterEvent, apps, env, widget } = res;
|
||||
const { afterEvent, env, widget } = res;
|
||||
this.afterEvent = afterEvent;
|
||||
this.apps = apps;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('out of office message on direct chat with out of office partner', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -28,9 +27,6 @@ QUnit.module('chat_window_manager_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('closing a chat window with no message from admin side unpins it', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('im_livechat', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('composer_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('livechat: no add attachment button', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
nextAnimationFrame,
|
||||
@@ -27,9 +26,6 @@ QUnit.module('discuss_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('livechat in the sidebar: basic rendering', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -24,9 +23,6 @@ QUnit.module('discuss_sidebar_category_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('livechat - counter: should not have a counter if the category is unfolded and without unread messages', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -23,9 +22,6 @@ QUnit.module('discuss_sidebar_category_item_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('livechat - avatar: should have a smiley face avatar for an anonymous livechat item', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -24,9 +23,6 @@ QUnit.module('messaging_menu_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('livechats should be in "chat" filter', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -30,9 +29,6 @@ QUnit.module('thread_icon_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('livechat: public website visitor is typing', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -30,9 +29,6 @@ QUnit.module('thread_textual_typing_status_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('receive visitor typing status "is typing"', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import Bus from 'web.Bus';
|
||||
import { date_to_str } from 'web.time';
|
||||
@@ -14,16 +14,12 @@ QUnit.module('activity_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { apps, env, widget } = res;
|
||||
this.apps = apps;
|
||||
const { env, widget } = res;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('activity simplest layout', async function (assert) {
|
||||
|
||||
+2
-6
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import Bus from 'web.Bus';
|
||||
|
||||
@@ -13,16 +13,12 @@ QUnit.module('activity_mark_done_popover_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { apps, env, widget } = res;
|
||||
this.apps = apps;
|
||||
const { env, widget } = res;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('activity mark done popover simplest layout', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
dragenterFiles,
|
||||
@@ -29,9 +28,6 @@ QUnit.module('attachment_box_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('base empty rendering', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { link } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -16,17 +15,13 @@ QUnit.module('attachment_image_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { afterEvent, apps, env, widget } = res;
|
||||
const { afterEvent, env, widget } = res;
|
||||
this.afterEvent = afterEvent;
|
||||
this.apps = apps;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('auto layout with image', async function (assert) {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import { link } from '@mail/model/model_field_command';
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -18,17 +17,13 @@ QUnit.module('attachment_list_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { afterEvent, apps, env, widget } = res;
|
||||
const { afterEvent, env, widget } = res;
|
||||
this.afterEvent = afterEvent;
|
||||
this.apps = apps;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('simplest layout', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -24,9 +23,6 @@ QUnit.module('channel_invitation_form_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('should display the channel invitation form after clicking on the invite button of a chat', async function (assert) {
|
||||
|
||||
-4
@@ -2,7 +2,6 @@
|
||||
|
||||
import { makeDeferred } from '@mail/utils/deferred/deferred';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
nextAnimationFrame,
|
||||
@@ -34,9 +33,6 @@ QUnit.module('chat_window_manager_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('[technical] messaging not created', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -19,9 +19,6 @@ QUnit.module('chatter_suggested_recipients_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test("suggest recipient on 'Send message' composer", async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, afterNextRender, beforeEach, nextAnimationFrame, start } from '@mail/utils/test_utils';
|
||||
import { afterNextRender, beforeEach, nextAnimationFrame, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('chatter_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('base rendering when chatter has no attachment', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, afterNextRender, beforeEach, nextAnimationFrame, start } from '@mail/utils/test_utils';
|
||||
import { afterNextRender, beforeEach, nextAnimationFrame, start } from '@mail/utils/test_utils';
|
||||
|
||||
import { makeTestPromise } from 'web.test_utils';
|
||||
|
||||
@@ -21,9 +21,6 @@ QUnit.module('chatter_topbar_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('base rendering', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insertAndReplace } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
dragenterFiles,
|
||||
@@ -29,9 +28,8 @@ QUnit.module('composer_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { afterEvent, apps, env, widget } = res;
|
||||
const { afterEvent, env, widget } = res;
|
||||
this.afterEvent = afterEvent;
|
||||
this.apps = apps;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
@@ -60,9 +58,6 @@ QUnit.module('composer_tests.js', {
|
||||
});
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('composer text input: basic rendering when posting a message', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('composer_suggestion_canned_response_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('canned response suggestion displayed', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('composer_suggestion_channel_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('channel mention suggestion displayed', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('composer_suggestion_command_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('command suggestion displayed', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('composer_suggestion_partner_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('partner mention suggestion displayed', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { makeDeferred } from '@mail/utils/deferred/deferred';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
nextAnimationFrame,
|
||||
start,
|
||||
@@ -25,9 +24,6 @@ QUnit.module('dialog_manager_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('[technical] messaging not created', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
nextAnimationFrame,
|
||||
@@ -27,9 +26,6 @@ QUnit.module('discuss_inbox_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('reply: discard on pressing escape', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -20,9 +20,6 @@ QUnit.module('discuss_message_edit_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('click on message edit button should open edit composer', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -24,9 +23,6 @@ QUnit.module('discuss_pinned_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('sidebar: pinned channel 1: init with one pinned channel', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { makeDeferred } from '@mail/utils/deferred/deferred';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
nextAnimationFrame,
|
||||
@@ -26,9 +25,6 @@ QUnit.module('discuss_sidebar_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('sidebar find shows channels matching search term', async function (assert) {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import BusService from 'bus.BusService';
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
nextAnimationFrame,
|
||||
@@ -28,17 +27,13 @@ QUnit.module('discuss_tests.js', {
|
||||
data: this.data,
|
||||
hasDiscuss: true,
|
||||
}));
|
||||
const { afterEvent, apps, env, widget } = res;
|
||||
const { afterEvent, env, widget } = res;
|
||||
this.afterEvent = afterEvent;
|
||||
this.apps = apps;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('messaging not created', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -36,9 +35,6 @@ QUnit.module('discuss_mobile_mailbox_selection_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('select another mailbox', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -24,9 +23,6 @@ QUnit.module('discuss_sidebar_category_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('channel - counter: should not have a counter if the category is unfolded and without needaction messages', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -26,9 +25,6 @@ QUnit.module('discuss_sidebar_category_item_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('channel - avatar: should have correct avatar', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import { file } from 'web.test_utils';
|
||||
|
||||
@@ -11,20 +11,15 @@ QUnit.module('file_uploader', {}, function () {
|
||||
QUnit.module('file_uploader_tests.js', {
|
||||
async beforeEach() {
|
||||
await beforeEach(this);
|
||||
this.apps = [];
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { apps, env, widget } = res;
|
||||
const { env, widget } = res;
|
||||
this.env = env;
|
||||
this.apps = apps;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('no conflicts between file uploaders', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -31,9 +30,6 @@ QUnit.module('follow_button_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('base rendering not editable', async function (assert) {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import { insert, link } from '@mail/model/model_field_command';
|
||||
import { makeDeferred } from '@mail/utils/deferred/deferred';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -34,9 +33,6 @@ QUnit.module('follower_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('base rendering not editable', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insert, link } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -34,9 +33,6 @@ QUnit.module('follower_list_menu_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('base rendering not editable', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insert, link } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -35,9 +34,6 @@ QUnit.module('follower_subtype_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('simplest layout of a followed subtype', async function (assert) {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import { insert, insertAndReplace, link, replace } from '@mail/model/model_field_command';
|
||||
import { makeDeferred } from '@mail/utils/deferred/deferred';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -22,17 +21,13 @@ QUnit.module('message_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { afterEvent, apps, env, widget } = res;
|
||||
const { afterEvent, env, widget } = res;
|
||||
this.afterEvent = afterEvent;
|
||||
this.apps = apps;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('basic rendering', async function (assert) {
|
||||
|
||||
-4
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insert, insertAndReplace, link } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
start,
|
||||
@@ -34,9 +33,6 @@ QUnit.module('message_seen_indicator_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('rendering when just one has received the message', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -27,9 +26,6 @@ QUnit.module('messaging_menu_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('[technical] messaging not created then becomes created', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, afterNextRender, beforeEach, start, } from '@mail/utils/test_utils';
|
||||
import { afterNextRender, beforeEach, start, } from '@mail/utils/test_utils';
|
||||
|
||||
import Bus from 'web.Bus';
|
||||
|
||||
@@ -21,9 +21,6 @@ QUnit.module('notification_list_notification_group_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('notification group basic layout', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -19,9 +19,6 @@ QUnit.module('notification_list_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('marked as read thread notifications are ordered by last message date', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -30,9 +29,6 @@ QUnit.module('partner_im_status_icon_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('initially online', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -31,9 +30,6 @@ QUnit.module('thread_icon_tests.js', {
|
||||
};
|
||||
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('chat: correspondent is typing', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import Bus from 'web.Bus';
|
||||
|
||||
@@ -22,9 +22,6 @@ QUnit.module('thread_needaction_preview_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('mark as read', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -19,9 +19,6 @@ QUnit.module('thread_preview_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('mark as read', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
@@ -31,9 +30,6 @@ QUnit.module('thread_textual_typing_status_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
async afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('receive other member typing status "is typing"', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insert, insertAndReplace, link } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
dragenterFiles,
|
||||
@@ -18,17 +17,13 @@ QUnit.module('thread_view_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { afterEvent, apps, env, widget } = res;
|
||||
const { afterEvent, env, widget } = res;
|
||||
this.afterEvent = afterEvent;
|
||||
this.apps = apps;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('dragover files on thread with composer', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { clear, insertAndReplace } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -21,9 +20,6 @@ QUnit.module('clear_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
QUnit.test('clear: should set attribute field undefined if there is no default value', async function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insertAndReplace } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -21,9 +20,6 @@ QUnit.module('insert_and_replace_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('insertAndReplace: should create and link a new record for an empty x2one field', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insert, insertAndReplace } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -21,9 +20,6 @@ QUnit.module('insert_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('insert: should create and link a new record for an empty x2one field', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insertAndReplace, link } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -21,9 +20,6 @@ QUnit.module('field_command_link_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('link: should link a record to an empty x2one field', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insertAndReplace, replace } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -21,9 +20,6 @@ QUnit.module('replace_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('replace: should link a record for an empty x2one field', async function (assert) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
set
|
||||
} from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -25,9 +24,6 @@ QUnit.module('set_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('decrement: should decrease attribute field value', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insertAndReplace, unlinkAll } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -21,9 +20,6 @@ QUnit.module('unlink_all_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('unlinkAll: should set x2one field undefined', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insertAndReplace, unlink } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -21,9 +20,6 @@ QUnit.module('unlink_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('models', {}, function () {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('attachment_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('create (txt)', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { insert, insertAndReplace, link } from '@mail/model/model_field_command';
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import { str_to_datetime } from 'web.time';
|
||||
|
||||
@@ -20,9 +20,6 @@ QUnit.module('message_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('create', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('models', {}, function () {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('messaging_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
}, function () {
|
||||
|
||||
QUnit.test('openChat: display notification for partner without user', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('models', {}, function () {
|
||||
@@ -14,9 +14,6 @@ QUnit.module('messaging_menu_tests.js', {
|
||||
this.env = env;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('messaging menu counter should ignore unread messages in channels that are unpinned', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { insert } from '@mail/model/model_field_command';
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('models', {}, function () {
|
||||
@@ -18,9 +18,6 @@ QUnit.module('thread_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('inbox & starred mailboxes', async function (assert) {
|
||||
|
||||
@@ -25,7 +25,8 @@ import {
|
||||
} from 'web.test_utils';
|
||||
import Widget from 'web.Widget';
|
||||
import { registry } from '@web/core/registry';
|
||||
import { getFixture } from "@web/../tests/helpers/utils";
|
||||
import { registerCleanup } from "@web/../tests/helpers/cleanup";
|
||||
import { getFixture, patchWithCleanup } from "@web/../tests/helpers/utils";
|
||||
import { createWebClient, getActionManagerServerData } from "@web/../tests/webclient/helpers";
|
||||
|
||||
import LegacyRegistry from "web.Registry";
|
||||
@@ -257,29 +258,16 @@ async function beforeEach(self) {
|
||||
data[modelName] = { fields, records };
|
||||
}
|
||||
|
||||
const originals = {
|
||||
'_.debounce': _.debounce,
|
||||
'_.throttle': _.throttle,
|
||||
};
|
||||
|
||||
(function patch() {
|
||||
// patch _.debounce and _.throttle to be fast and synchronous
|
||||
_.debounce = _.identity;
|
||||
_.throttle = _.identity;
|
||||
})();
|
||||
|
||||
function unpatch() {
|
||||
_.debounce = originals['_.debounce'];
|
||||
_.throttle = originals['_.throttle'];
|
||||
}
|
||||
|
||||
Object.assign(self, {
|
||||
apps: [],
|
||||
data,
|
||||
unpatch,
|
||||
widget: undefined
|
||||
});
|
||||
|
||||
registerCleanup(() => {
|
||||
self.widget = undefined;
|
||||
self.env = undefined;
|
||||
});
|
||||
|
||||
Object.defineProperty(self, 'messaging', {
|
||||
get() {
|
||||
if (!this.env || !this.env.services.messaging) {
|
||||
@@ -290,25 +278,6 @@ async function beforeEach(self) {
|
||||
});
|
||||
}
|
||||
|
||||
function afterEach(self) {
|
||||
// The components must be destroyed before the widget, because the
|
||||
// widget might destroy the models before destroying the components,
|
||||
// and the components might still rely on messaging (or other) record(s).
|
||||
while (self.apps.length > 0) {
|
||||
self.apps.pop().destroy();
|
||||
}
|
||||
if (self.widget) {
|
||||
self.widget.destroy();
|
||||
self.widget = undefined;
|
||||
}
|
||||
if (self.messaging) {
|
||||
self.messaging.delete();
|
||||
}
|
||||
self.env = undefined;
|
||||
self.unpatch();
|
||||
}
|
||||
|
||||
|
||||
function getAfterEvent({ messagingBus }) {
|
||||
/**
|
||||
* Returns a promise resolved after the expected event is received.
|
||||
@@ -359,7 +328,7 @@ function getAfterEvent({ messagingBus }) {
|
||||
* Creates a new root Component, with the given props, and mounts it on target.
|
||||
* Assumes that self.env is set to the correct value.
|
||||
* Components created this way are automatically registered for clean up after
|
||||
* the test, which will happen when `afterEach` is called.
|
||||
* the test.
|
||||
*
|
||||
* @param {Object} self the current QUnit instance
|
||||
* @param {Object} Component the class of the component to create
|
||||
@@ -375,7 +344,10 @@ async function createRootComponent(self, Component, { props = {}, target }) {
|
||||
env: self.env,
|
||||
test: true,
|
||||
});
|
||||
self.apps.push(app);
|
||||
// The components must be destroyed before the widget, because the
|
||||
// widget might destroy the models before destroying the components,
|
||||
// and the components might still rely on messaging (or other) record(s).
|
||||
registerCleanup(() => app.destroy());
|
||||
let component;
|
||||
await afterNextRender(() => {
|
||||
component = app.mount(target);
|
||||
@@ -388,7 +360,7 @@ async function createRootComponent(self, Component, { props = {}, target }) {
|
||||
* componentName and with the given props, and mounts it on target.
|
||||
* Assumes that self.env is set to the correct value.
|
||||
* Components created this way are automatically registered for clean up after
|
||||
* the test, which will happen when `afterEach` is called.
|
||||
* the test.
|
||||
*
|
||||
* @param {Object} self the current QUnit instance
|
||||
* @param {string} componentName the class name of the component to create
|
||||
@@ -407,11 +379,11 @@ function getClick({ afterNextRender }) {
|
||||
};
|
||||
}
|
||||
|
||||
function getCreateChatterContainerComponent({ afterEvent, apps, env, widget }) {
|
||||
function getCreateChatterContainerComponent({ afterEvent, env, widget }) {
|
||||
return async function createChatterContainerComponent(props, { waitUntilMessagesLoaded = true } = {}) {
|
||||
let chatterContainerComponent;
|
||||
async function func() {
|
||||
chatterContainerComponent = await createRootMessagingComponent({ apps, env }, "ChatterContainer", {
|
||||
chatterContainerComponent = await createRootMessagingComponent({ env }, "ChatterContainer", {
|
||||
props,
|
||||
target: widget.el,
|
||||
});
|
||||
@@ -438,67 +410,67 @@ function getCreateChatterContainerComponent({ afterEvent, apps, env, widget }) {
|
||||
};
|
||||
}
|
||||
|
||||
function getCreateComposerComponent({ apps, env, modelManager, widget }) {
|
||||
function getCreateComposerComponent({ env, modelManager, widget }) {
|
||||
return async function createComposerComponent(composer, props) {
|
||||
const composerView = modelManager.messaging.models['ComposerView'].create({
|
||||
qunitTest: insertAndReplace({
|
||||
composer: replace(composer),
|
||||
}),
|
||||
});
|
||||
return await createRootMessagingComponent({ apps, env }, "Composer", {
|
||||
return await createRootMessagingComponent({ env }, "Composer", {
|
||||
props: { localId: composerView.localId, ...props },
|
||||
target: widget.el,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function getCreateComposerSuggestionComponent({ apps, env, modelManager, widget }) {
|
||||
function getCreateComposerSuggestionComponent({ env, modelManager, widget }) {
|
||||
return async function createComposerSuggestionComponent(composer, props) {
|
||||
const composerView = modelManager.messaging.models['ComposerView'].create({
|
||||
qunitTest: insertAndReplace({
|
||||
composer: replace(composer),
|
||||
}),
|
||||
});
|
||||
await createRootMessagingComponent({ apps, env }, "ComposerSuggestion", {
|
||||
await createRootMessagingComponent({ env }, "ComposerSuggestion", {
|
||||
props: { ...props, composerViewLocalId: composerView.localId },
|
||||
target: widget.el,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function getCreateMessageComponent({ apps, env, modelManager, widget }) {
|
||||
function getCreateMessageComponent({ env, modelManager, widget }) {
|
||||
return async function createMessageComponent(message) {
|
||||
const messageView = modelManager.messaging.models['MessageView'].create({
|
||||
message: replace(message),
|
||||
qunitTest: insertAndReplace(),
|
||||
});
|
||||
await createRootMessagingComponent({ apps, env }, "Message", {
|
||||
await createRootMessagingComponent({ env }, "Message", {
|
||||
props: { localId: messageView.localId },
|
||||
target: widget.el,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function getCreateMessagingMenuComponent({ apps, env, widget }) {
|
||||
function getCreateMessagingMenuComponent({ env, widget }) {
|
||||
return async function createMessagingMenuComponent() {
|
||||
return await createRootComponent({ apps, env }, MessagingMenuContainer, { target: widget.el });
|
||||
return await createRootComponent({ env }, MessagingMenuContainer, { target: widget.el });
|
||||
};
|
||||
}
|
||||
|
||||
function getCreateNotificationListComponent({ apps, env, modelManager, widget }) {
|
||||
function getCreateNotificationListComponent({ env, modelManager, widget }) {
|
||||
return async function createNotificationListComponent({ filter = 'all' } = {}) {
|
||||
const notificationListView = modelManager.messaging.models['NotificationListView'].create({
|
||||
filter,
|
||||
qunitTestOwner: insertAndReplace(),
|
||||
});
|
||||
await createRootMessagingComponent({ apps, env }, "NotificationList", {
|
||||
await createRootMessagingComponent({ env }, "NotificationList", {
|
||||
props: { localId: notificationListView.localId },
|
||||
target: widget.el,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function getCreateThreadViewComponent({ afterEvent, apps, env, widget }) {
|
||||
function getCreateThreadViewComponent({ afterEvent, env, widget }) {
|
||||
return async function createThreadViewComponent(threadView, otherProps = {}, { isFixedSize = false, waitUntilMessagesLoaded = true } = {}) {
|
||||
let target;
|
||||
if (isFixedSize) {
|
||||
@@ -515,7 +487,7 @@ function getCreateThreadViewComponent({ afterEvent, apps, env, widget }) {
|
||||
target = widget.el;
|
||||
}
|
||||
async function func() {
|
||||
return createRootMessagingComponent({ apps, env }, "ThreadView", { props: { localId: threadView.localId, ...otherProps }, target });
|
||||
return createRootMessagingComponent({ env }, "ThreadView", { props: { localId: threadView.localId, ...otherProps }, target });
|
||||
}
|
||||
if (waitUntilMessagesLoaded) {
|
||||
await afterNextRender(() => afterEvent({
|
||||
@@ -620,6 +592,11 @@ function getOpenDiscuss({ afterNextRender, discussWidget }) {
|
||||
* @returns {Object}
|
||||
*/
|
||||
async function start(param0 = {}) {
|
||||
// patch _.debounce and _.throttle to be fast and synchronous.
|
||||
patchWithCleanup(_, {
|
||||
debounce: func => func,
|
||||
throttle: func => func,
|
||||
});
|
||||
let callbacks = {
|
||||
init: [],
|
||||
mount: [],
|
||||
@@ -808,7 +785,6 @@ async function start(param0 = {}) {
|
||||
legacyPatch(widget, {
|
||||
destroy() {
|
||||
destroyCallbacks.forEach(callback => callback({ widget }));
|
||||
this._super(...arguments);
|
||||
legacyUnpatch(widget);
|
||||
}
|
||||
});
|
||||
@@ -836,15 +812,18 @@ async function start(param0 = {}) {
|
||||
testSetupDoneDeferred.resolve();
|
||||
waitUntilEventPromise = Promise.resolve();
|
||||
}
|
||||
const apps = [];
|
||||
const result = {
|
||||
afterEvent,
|
||||
apps,
|
||||
env: testEnv,
|
||||
mockServer,
|
||||
widget,
|
||||
};
|
||||
const { modelManager } = testEnv.services.messaging;
|
||||
registerCleanup(async() => {
|
||||
widget.destroy();
|
||||
await modelManager.messagingInitializedPromise;
|
||||
modelManager.messaging.delete();
|
||||
});
|
||||
if (waitUntilMessagingCondition === 'created') {
|
||||
await modelManager.messagingCreatedPromise;
|
||||
}
|
||||
@@ -865,13 +844,13 @@ async function start(param0 = {}) {
|
||||
...result,
|
||||
afterNextRender,
|
||||
click: getClick({ afterNextRender }),
|
||||
createChatterContainerComponent: getCreateChatterContainerComponent({ afterEvent, apps, env: testEnv, widget }),
|
||||
createComposerComponent: getCreateComposerComponent({ apps, env: testEnv, modelManager, widget }),
|
||||
createComposerSuggestionComponent: getCreateComposerSuggestionComponent({ apps, env: testEnv, modelManager, widget }),
|
||||
createMessageComponent: getCreateMessageComponent({ apps, env: testEnv, modelManager, widget }),
|
||||
createMessagingMenuComponent: getCreateMessagingMenuComponent({ apps, env: testEnv, widget }),
|
||||
createNotificationListComponent: getCreateNotificationListComponent({ apps, env: testEnv, modelManager, widget }),
|
||||
createThreadViewComponent: getCreateThreadViewComponent({ afterEvent, apps, env: testEnv, widget }),
|
||||
createChatterContainerComponent: getCreateChatterContainerComponent({ afterEvent, env: testEnv, widget }),
|
||||
createComposerComponent: getCreateComposerComponent({ env: testEnv, modelManager, widget }),
|
||||
createComposerSuggestionComponent: getCreateComposerSuggestionComponent({ env: testEnv, modelManager, widget }),
|
||||
createMessageComponent: getCreateMessageComponent({ env: testEnv, modelManager, widget }),
|
||||
createMessagingMenuComponent: getCreateMessagingMenuComponent({ env: testEnv, widget }),
|
||||
createNotificationListComponent: getCreateNotificationListComponent({ env: testEnv, modelManager, widget }),
|
||||
createThreadViewComponent: getCreateThreadViewComponent({ afterEvent, env: testEnv, widget }),
|
||||
messaging: modelManager.messaging,
|
||||
openDiscuss,
|
||||
};
|
||||
@@ -931,7 +910,6 @@ function pasteFiles(el, files) {
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
createRootMessagingComponent,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
import throttle from '@mail/utils/throttle/throttle';
|
||||
import { nextTick } from '@mail/utils/utils';
|
||||
|
||||
@@ -30,7 +30,6 @@ QUnit.module('throttle_tests.js', {
|
||||
for (const t of this.throttles) {
|
||||
t.clear();
|
||||
}
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, nextTick, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, nextTick, start } from '@mail/utils/test_utils';
|
||||
import Timer from '@mail/utils/timer/timer';
|
||||
|
||||
const { TimerClearedError } = Timer;
|
||||
@@ -29,7 +29,6 @@ QUnit.module('timer_tests.js', {
|
||||
for (const timer of this.timers) {
|
||||
timer.clear();
|
||||
}
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { makeDeferred } from '@mail/utils/deferred/deferred';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
nextAnimationFrame,
|
||||
@@ -48,9 +47,6 @@ QUnit.module('form_renderer_tests.js', {
|
||||
});
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('[technical] spinner when messaging is not created', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import FormView from 'web.FormView';
|
||||
|
||||
@@ -27,9 +27,6 @@ QUnit.module('notification_alert_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.skip('notification_alert widget: display blocked notification alert', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import FormView from 'web.FormView';
|
||||
import ListView from 'web.ListView';
|
||||
@@ -97,9 +97,6 @@ QUnit.module('Chatter', {
|
||||
},
|
||||
});
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('list activity widget with no activity', async function (assert) {
|
||||
@@ -397,9 +394,6 @@ QUnit.module('FieldMany2ManyTagsEmail', {
|
||||
{ id: 14, display_name: "silver", email: '' }
|
||||
);
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('fieldmany2many tags email', function (assert) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { insertAndReplace } from '@mail/model/model_field_command';
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail', {}, function () {
|
||||
QUnit.module('clock_model_tests', {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('clock_model_tests', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('Deleting all the watchers of a clock should result in the deletion of the clock itself.', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { Many2OneAvatarUser } from '@mail/js/m2x_avatar_user';
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { click, getFixture, legacyExtraNextTick, patchWithCleanup, triggerHotkey } from "@web/../tests/helpers/utils";
|
||||
import { doAction } from '@web/../tests/webclient/helpers';
|
||||
import { registry } from "@web/core/registry";
|
||||
@@ -52,9 +52,6 @@ QUnit.module('mail', {}, function () {
|
||||
|
||||
target = getFixture();
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('many2one_avatar_user widget in list view', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import ActivityMenu from '@mail/js/systray/systray_activity_menu';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -83,9 +82,6 @@ QUnit.module('ActivityMenu', {
|
||||
uid: 10,
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('activity menu widget: menu with no records', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { afterNextRender, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { editSearchBar } from '@web/../tests/core/commands/command_service_tests';
|
||||
import { click, getFixture, nextTick, patchWithCleanup, triggerHotkey } from "@web/../tests/helpers/utils";
|
||||
import { browser } from '@web/core/browser/browser';
|
||||
@@ -22,9 +22,6 @@ QUnit.module('mail', {}, function () {
|
||||
});
|
||||
registry.category("command_categories").add("default", { label: ("default") });
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('open the chatWindow of a user from the command palette', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('mail_bot', {}, function () {
|
||||
QUnit.module('models', {}, function () {
|
||||
@@ -17,9 +17,6 @@ QUnit.module('messaging_initializer_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import ActivityMenu from '@mail/js/systray/systray_activity_menu';
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import testUtils from 'web.test_utils';
|
||||
|
||||
@@ -31,9 +31,6 @@ QUnit.module("ActivityMenu", {
|
||||
}
|
||||
});
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('note activity menu widget: create note from activity menu', async function (assert) {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import { insert, insertAndReplace } from '@mail/model/model_field_command';
|
||||
import { makeDeferred } from '@mail/utils/deferred/deferred';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -20,17 +19,13 @@ QUnit.module('message_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { afterEvent, apps, env, widget } = res;
|
||||
const { afterEvent, env, widget } = res;
|
||||
this.afterEvent = afterEvent;
|
||||
this.apps = apps;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('Notification Sent', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import Bus from 'web.Bus';
|
||||
|
||||
@@ -21,9 +21,6 @@ QUnit.module('notification_list_notification_group_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('mark as read', async function (assert) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { insert, insertAndReplace } from '@mail/model/model_field_command';
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -19,17 +18,13 @@ QUnit.module('message_tests.js', {
|
||||
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { afterEvent, apps, env, widget } = res;
|
||||
const { afterEvent, env, widget } = res;
|
||||
this.afterEvent = afterEvent;
|
||||
this.apps = apps;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('Sent', async function (assert) {
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
import Bus from 'web.Bus';
|
||||
|
||||
@@ -21,9 +21,6 @@ QUnit.module('notification_list_notification_group_tests.js', {
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('mark as read', async function (assert) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
start,
|
||||
} from '@mail/utils/test_utils';
|
||||
@@ -23,9 +22,6 @@ QUnit.module('discuss_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('rendering of visitor banner', async function (assert) {
|
||||
|
||||
-4
@@ -1,7 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
afterNextRender,
|
||||
beforeEach,
|
||||
start,
|
||||
@@ -25,9 +24,6 @@ QUnit.module('messaging_notification_handler_tests.js', {
|
||||
this.widget = widget;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('should open chat window on send chat request to website visitor', async function (assert) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { afterEach, beforeEach, start } from '@mail/utils/test_utils';
|
||||
import { beforeEach, start } from '@mail/utils/test_utils';
|
||||
|
||||
QUnit.module('website_slides', {}, function () {
|
||||
QUnit.module('components', {}, function () {
|
||||
@@ -10,16 +10,12 @@ QUnit.module('activity_tests.js', {
|
||||
await beforeEach(this);
|
||||
this.start = async params => {
|
||||
const res = await start({ ...params, data: this.data });
|
||||
const { apps, env, widget } = res;
|
||||
this.apps = apps;
|
||||
const { env, widget } = res;
|
||||
this.env = env;
|
||||
this.widget = widget;
|
||||
return res;
|
||||
};
|
||||
},
|
||||
afterEach() {
|
||||
afterEach(this);
|
||||
},
|
||||
});
|
||||
|
||||
QUnit.test('grant course access', async function (assert) {
|
||||
|
||||
Reference in New Issue
Block a user