summaryrefslogtreecommitdiff
path: root/addons/mail_bot/static/tests
diff options
context:
space:
mode:
authorJuhil Somaiya <jso@odoo.com>2019-01-23 09:32:01 +0000
committerJuhil Somaiya <jso@odoo.com>2019-02-15 09:05:54 +0000
commit02eebe15cd895b54f45cbcef1affcaa61ec8577c (patch)
tree85d7ddee92dbe048aabf43243a0e2c949ad516db /addons/mail_bot/static/tests
parentb35d103cc0fe64547c3212ef01ab329faf0bacc4 (diff)
[IMP] mail_bot: Blocked notification alert to User
If user has blocked odoo push notifications then there's no way to enable via the OdooBot notification in the systray as it depends on the navigator so display the alert message under users preference section. Related Task ID: 1929547 closes odoo/odoo#30496
Diffstat (limited to 'addons/mail_bot/static/tests')
-rw-r--r--addons/mail_bot/static/tests/systray_messaging_menu_tests.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/addons/mail_bot/static/tests/systray_messaging_menu_tests.js b/addons/mail_bot/static/tests/systray_messaging_menu_tests.js
index d22c9ca80da..9cae63a9b1c 100644
--- a/addons/mail_bot/static/tests/systray_messaging_menu_tests.js
+++ b/addons/mail_bot/static/tests/systray_messaging_menu_tests.js
@@ -6,6 +6,7 @@ var mailTestUtils = require('mail.testUtils');
var MailBotService = require('mail_bot.MailBotService');
+var FormView = require('web.FormView');
var testUtils = require('web.test_utils');
QUnit.module('mail_bot', {}, function () {
@@ -169,6 +170,27 @@ QUnit.test('messaging menu widget: respond to notification prompt', function (as
messagingMenu.destroy();
});
+QUnit.test('notification_alert widget: display blocked notification alert', function (assert) {
+ assert.expect(2);
+
+ window.Notification.permission = 'denied';
+
+ var form = testUtils.createView({
+ View: FormView,
+ model: 'mail.message',
+ data: this.data,
+ arch: '<form>' +
+ '<widget name="notification_alert"/>' +
+ '</form>',
+ });
+ assert.containsOnce(form, '.o_notification_alert', "Blocked notification alert should be displayed");
+
+ window.Notification.permission = 'granted';
+ form.reload();
+ assert.containsNone(form, '.o_notification_alert', "Blocked notification alert should not be displayed");
+
+ form.destroy();
+});
});
});