summaryrefslogtreecommitdiff
path: root/addons/snailmail/static/src/components/message/message_tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/snailmail/static/src/components/message/message_tests.js')
-rw-r--r--addons/snailmail/static/src/components/message/message_tests.js56
1 files changed, 33 insertions, 23 deletions
diff --git a/addons/snailmail/static/src/components/message/message_tests.js b/addons/snailmail/static/src/components/message/message_tests.js
index fca1ba5237c..f4dde33e651 100644
--- a/addons/snailmail/static/src/components/message/message_tests.js
+++ b/addons/snailmail/static/src/components/message/message_tests.js
@@ -46,7 +46,8 @@ QUnit.test('Sent', async function (assert) {
assert.expect(8);
await this.start();
- const threadView = this.env.models['mail.thread_view'].create({
+ const threadViewer = this.env.models['mail.thread_viewer'].create({
+ hasThreadView: true,
thread: [['create', {
id: 11,
model: 'mail.channel',
@@ -60,10 +61,10 @@ QUnit.test('Sent', async function (assert) {
notification_status: 'sent',
notification_type: 'snail',
}]],
- originThread: [['link', threadView.thread]],
+ originThread: [['link', threadViewer.thread]],
});
await this.createMessageComponent(message, {
- threadViewLocalId: threadView.localId
+ threadViewLocalId: threadViewer.threadView.localId
});
assert.containsOnce(
@@ -116,7 +117,8 @@ QUnit.test('Canceled', async function (assert) {
assert.expect(8);
await this.start();
- const threadView = this.env.models['mail.thread_view'].create({
+ const threadViewer = this.env.models['mail.thread_viewer'].create({
+ hasThreadView: true,
thread: [['create', {
id: 11,
model: 'mail.channel',
@@ -130,10 +132,10 @@ QUnit.test('Canceled', async function (assert) {
notification_status: 'canceled',
notification_type: 'snail',
}]],
- originThread: [['link', threadView.thread]],
+ originThread: [['link', threadViewer.thread]],
});
await this.createMessageComponent(message, {
- threadViewLocalId: threadView.localId
+ threadViewLocalId: threadViewer.threadView.localId
});
assert.containsOnce(
@@ -186,7 +188,8 @@ QUnit.test('Pending', async function (assert) {
assert.expect(8);
await this.start();
- const threadView = this.env.models['mail.thread_view'].create({
+ const threadViewer = this.env.models['mail.thread_viewer'].create({
+ hasThreadView: true,
thread: [['create', {
id: 11,
model: 'mail.channel',
@@ -200,10 +203,10 @@ QUnit.test('Pending', async function (assert) {
notification_status: 'ready',
notification_type: 'snail',
}]],
- originThread: [['link', threadView.thread]],
+ originThread: [['link', threadViewer.thread]],
});
await this.createMessageComponent(message, {
- threadViewLocalId: threadView.localId
+ threadViewLocalId: threadViewer.threadView.localId
});
assert.containsOnce(
@@ -263,7 +266,8 @@ QUnit.test('No Price Available', async function (assert) {
return this._super(...arguments);
},
});
- const threadView = this.env.models['mail.thread_view'].create({
+ const threadViewer = this.env.models['mail.thread_viewer'].create({
+ hasThreadView: true,
thread: [['create', {
id: 11,
model: 'mail.channel',
@@ -278,10 +282,10 @@ QUnit.test('No Price Available', async function (assert) {
notification_status: 'exception',
notification_type: 'snail',
}]],
- originThread: [['link', threadView.thread]],
+ originThread: [['link', threadViewer.thread]],
});
await this.createMessageComponent(message, {
- threadViewLocalId: threadView.localId
+ threadViewLocalId: threadViewer.threadView.localId
});
assert.containsOnce(
@@ -349,7 +353,8 @@ QUnit.test('Credit Error', async function (assert) {
return this._super(...arguments);
},
});
- const threadView = this.env.models['mail.thread_view'].create({
+ const threadViewer = this.env.models['mail.thread_viewer'].create({
+ hasThreadView: true,
thread: [['create', {
id: 11,
model: 'mail.channel',
@@ -364,10 +369,10 @@ QUnit.test('Credit Error', async function (assert) {
notification_status: 'exception',
notification_type: 'snail',
}]],
- originThread: [['link', threadView.thread]],
+ originThread: [['link', threadViewer.thread]],
});
await this.createMessageComponent(message, {
- threadViewLocalId: threadView.localId
+ threadViewLocalId: threadViewer.threadView.localId
});
assert.containsOnce(
@@ -440,7 +445,8 @@ QUnit.test('Trial Error', async function (assert) {
return this._super(...arguments);
},
});
- const threadView = this.env.models['mail.thread_view'].create({
+ const threadViewer = this.env.models['mail.thread_viewer'].create({
+ hasThreadView: true,
thread: [['create', {
id: 11,
model: 'mail.channel',
@@ -455,10 +461,10 @@ QUnit.test('Trial Error', async function (assert) {
notification_status: 'exception',
notification_type: 'snail',
}]],
- originThread: [['link', threadView.thread]],
+ originThread: [['link', threadViewer.thread]],
});
await this.createMessageComponent(message, {
- threadViewLocalId: threadView.localId
+ threadViewLocalId: threadViewer.threadView.localId
});
assert.containsOnce(
@@ -539,7 +545,8 @@ QUnit.test('Format Error', async function (assert) {
});
await this.start({ env: { bus } });
- const threadView = this.env.models['mail.thread_view'].create({
+ const threadViewer = this.env.models['mail.thread_viewer'].create({
+ hasThreadView: true,
thread: [['create', {
id: 11,
model: 'mail.channel',
@@ -554,10 +561,10 @@ QUnit.test('Format Error', async function (assert) {
notification_status: 'exception',
notification_type: 'snail',
}]],
- originThread: [['link', threadView.thread]],
+ originThread: [['link', threadViewer.thread]],
});
await this.createMessageComponent(message, {
- threadViewLocalId: threadView.localId
+ threadViewLocalId: threadViewer.threadView.localId
});
assert.containsOnce(
@@ -627,11 +634,14 @@ QUnit.test('Missing Required Fields', async function (assert) {
await this.start({
env: { bus },
});
- const threadView = this.env.models['mail.thread_view'].create({
+ const threadViewer = this.env.models['mail.thread_viewer'].create({
+ hasThreadView: true,
thread: [['insert', { id: 20, model: 'res.partner' }]],
});
const message = this.env.models['mail.message'].find(message => message.id === 10);
- await this.createMessageComponent(message, { threadViewLocalId: threadView.localId });
+ await this.createMessageComponent(message, {
+ threadViewLocalId: threadViewer.threadView.localId,
+ });
assert.containsOnce(
document.body,