summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/components/attachment/attachment.js
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2020-09-16 11:04:15 +0000
committerAlexandre Kühn <aku@odoo.com>2020-09-16 15:04:14 +0000
commitf0d97c5d00a1afdd74201688c7e22e97ffaf47f9 (patch)
tree60b9653b105ebf1edc923f124910c4ec9b3ba63d /addons/mail/static/src/components/attachment/attachment.js
parent7a1308b426f94b33e2bd55e5d58e661067e26ff3 (diff)
[FIX] mail: do not fetch attachment style in QUnit tests
Task-2339931 closes odoo/odoo#57869 X-original-commit: 7586f7756859bb0711eee8a82bf728a039ad0d72 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/components/attachment/attachment.js')
-rw-r--r--addons/mail/static/src/components/attachment/attachment.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/mail/static/src/components/attachment/attachment.js b/addons/mail/static/src/components/attachment/attachment.js
index 76922ed7a3c..a17ed341b9a 100644
--- a/addons/mail/static/src/components/attachment/attachment.js
+++ b/addons/mail/static/src/components/attachment/attachment.js
@@ -71,6 +71,12 @@ class Attachment extends Component {
if (this.attachment.fileType !== 'image') {
return '';
}
+ if (this.env.isQUnitTest) {
+ // background-image:url is hardly mockable, and attachments in
+ // QUnit tests do not actually exist in DB, so style should not
+ // be fetched at all.
+ return '';
+ }
let size;
if (this.detailsMode === 'card') {
size = '38x38';