summaryrefslogtreecommitdiff
path: root/addons/mail/static/tests/document_viewer_tests.js
diff options
context:
space:
mode:
authorThanh Dodeur <tso@odoo.com>2019-04-04 09:24:34 +0000
committerThanh Dodeur <tso@odoo.com>2019-04-04 10:35:54 +0000
commitf2d0995362ccdae88ba64597ea6f0feca3eab618 (patch)
treec87a5d350f6513ad7bd4832dbaf73dcef3b70069 /addons/mail/static/tests/document_viewer_tests.js
parentd29e8cf4235f13a0f81baf3694481b0418584ece (diff)
[FIX] mail: fixes document viewer's url preview
This commit fixes the document viewer: the document viewer was altering the `type` key of attachment objects, this issue was causing matching errors in some cases. With this commit, the document viewer widget uses its own key `attachment.fileType` to store the information that used to override `attachment.type` closes odoo/odoo#32414 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/tests/document_viewer_tests.js')
-rw-r--r--addons/mail/static/tests/document_viewer_tests.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/addons/mail/static/tests/document_viewer_tests.js b/addons/mail/static/tests/document_viewer_tests.js
index 87fa2dbed94..b7ba9763386 100644
--- a/addons/mail/static/tests/document_viewer_tests.js
+++ b/addons/mail/static/tests/document_viewer_tests.js
@@ -206,5 +206,24 @@ QUnit.module('DocumentViewer', {
assert.ok(viewer.isDestroyed(), 'viewer should be destroyed');
});
+
+ QUnit.test('fileType and integrity test', function (assert) {
+ assert.expect(3);
+
+ var viewer = createViewer({
+ attachmentID: 2,
+ attachments: this.attachments,
+ });
+
+ assert.strictEqual(this.attachments[1].type, 'url',
+ "the type should be url");
+ assert.strictEqual(this.attachments[1].fileType, 'youtu',
+ "there should be a fileType 'youtu'");
+ assert.strictEqual(this.attachments[1].youtube, 'FYqW0Gdwbzk',
+ "there should be a youtube token");
+
+ viewer.destroy();
+ });
+
});
});