[IMP] web: close button on non-sticky notifications
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<div t-attf-class="toast o_notification #{widget.className}"
|
||||
role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<t t-set="closeButton">
|
||||
<button t-if="widget.sticky" type="button"
|
||||
<button type="button"
|
||||
class="close o_notification_close"
|
||||
data-dismiss="toast" aria-label="Close">
|
||||
<span class="d-inline" aria-hidden="true">&times;</span>
|
||||
|
||||
@@ -59,9 +59,9 @@ QUnit.module('Services', {
|
||||
await testUtils.nextMicrotaskTick();
|
||||
var $notification = $('body .o_notification_manager .o_notification');
|
||||
assert.strictEqual($notification.html().trim().replace(/\s+/g, ' '),
|
||||
"<div class=\"toast-header\"> <span class=\"fa fa-2x mr-3 fa-lightbulb-o o_notification_icon\" role=\"img\" aria-label=\"Notification undefined\" title=\"Notification undefined\"></span> <div class=\"d-flex align-items-center mr-auto font-weight-bold o_notification_title\">a</div> </div> <div class=\"toast-body d-flex\"> <div class=\"mr-auto o_notification_content\">b</div> </div>",
|
||||
"<div class=\"toast-header\"> <span class=\"fa fa-2x mr-3 fa-lightbulb-o o_notification_icon\" role=\"img\" aria-label=\"Notification undefined\" title=\"Notification undefined\"></span> <div class=\"d-flex align-items-center mr-auto font-weight-bold o_notification_title\">a</div> <button type=\"button\" class=\"close o_notification_close\" data-dismiss=\"toast\" aria-label=\"Close\"> <span class=\"d-inline\" aria-hidden=\"true\">×</span> </button> </div> <div class=\"toast-body d-flex\"> <div class=\"mr-auto o_notification_content\">b</div> </div>",
|
||||
"should display notification");
|
||||
assert.containsNone($notification, '.o_notification_close', "should not display the close button in ");
|
||||
assert.containsOnce($notification, '.o_notification_close');
|
||||
await waitCloseNotification();
|
||||
assert.strictEqual($notification.is(':hidden'), true, "should hide the notification");
|
||||
assert.strictEqual($('body .o_notification_manager .o_notification').length, 0, "should destroy the notification");
|
||||
@@ -80,7 +80,7 @@ QUnit.module('Services', {
|
||||
await testUtils.nextMicrotaskTick();
|
||||
var $notification = $('body .o_notification_manager .o_notification');
|
||||
assert.strictEqual($notification.html().trim().replace(/\s+/g, ' '),
|
||||
"<div class=\"toast-header\"> <span class=\"fa fa-2x mr-3 fa-exclamation o_notification_icon\" role=\"img\" aria-label=\"Notification undefined\" title=\"Notification undefined\"></span> <div class=\"d-flex align-items-center mr-auto font-weight-bold o_notification_title\">a</div> </div> <div class=\"toast-body d-flex\"> <div class=\"mr-auto o_notification_content\">b</div> </div>",
|
||||
"<div class=\"toast-header\"> <span class=\"fa fa-2x mr-3 fa-exclamation o_notification_icon\" role=\"img\" aria-label=\"Notification undefined\" title=\"Notification undefined\"></span> <div class=\"d-flex align-items-center mr-auto font-weight-bold o_notification_title\">a</div> <button type=\"button\" class=\"close o_notification_close\" data-dismiss=\"toast\" aria-label=\"Close\"> <span class=\"d-inline\" aria-hidden=\"true\">×</span> </button> </div> <div class=\"toast-body d-flex\"> <div class=\"mr-auto o_notification_content\">b</div> </div>",
|
||||
"should display notification");
|
||||
view.destroy();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user