summaryrefslogtreecommitdiff
path: root/addons/mail/static/tests/document_thread_window_tests.js
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2018-08-08 18:54:43 +0200
committerChristophe Matthieu <chm@odoo.com>2018-08-09 02:31:59 +0200
commit6448420c5dd160470e465dee7729d19d8d5e7bab (patch)
treec2696ff4e1f7abd90af8570804bc86a524790860 /addons/mail/static/tests/document_thread_window_tests.js
parent791c70b329bf513a4c9359d38603b10dc6066829 (diff)
[IMP] bus: re-factoring of bus.bus (Longpolling and CrossTab)
The purpose of this change is to make the code clearer and testable. In this change, the 'tab_manager' static object was merged with the bus cross tab. Cleaning was done to clearly define private and public functions as well as handlers. The methods are documented and the constants are now defined on the class. The bus use the service behavior with 'trigger_up'. 'bus.CrossTab' who extend 'bus.Longpolling' are instantiated by the bus service. The class is always instantiated with a parent, or root in the case of the website (im_livechat), to use the ajax and localstorage services. So the behavior, perhaps logger or redefined by the parents.
Diffstat (limited to 'addons/mail/static/tests/document_thread_window_tests.js')
-rw-r--r--addons/mail/static/tests/document_thread_window_tests.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/mail/static/tests/document_thread_window_tests.js b/addons/mail/static/tests/document_thread_window_tests.js
index c9814ada195..8cae9862dea 100644
--- a/addons/mail/static/tests/document_thread_window_tests.js
+++ b/addons/mail/static/tests/document_thread_window_tests.js
@@ -201,7 +201,7 @@ QUnit.test('post messages in a document thread window', function (assert) {
testUtils.intercept(messagingMenu, 'call_service', function (ev) {
if (ev.data.service === 'local_storage' && ev.data.method === 'setItem' &&
ev.data.args[0] === 'mail.document_threads_last_message') {
- assert.strictEqual(ev.data.args[1], JSON.stringify(newMessage),
+ assert.deepEqual(ev.data.args[1], newMessage,
"should write sent message in local storage, to share info with other tabs");
}
}, true);
@@ -262,10 +262,10 @@ QUnit.test('open, fold, unfold and close a document thread window', function (as
$('.o_thread_window .o_thread_window_close').click();
assert.verifySteps([
- ['mail.document_threads_state', "{\"some.res.model_1\":{\"name\":\"Some Record\",\"windowState\":\"open\"}}"],
- ['mail.document_threads_state', "{\"some.res.model_1\":{\"name\":\"Some Record\",\"windowState\":\"folded\"}}"],
- ['mail.document_threads_state', "{\"some.res.model_1\":{\"name\":\"Some Record\",\"windowState\":\"open\"}}"],
- ['mail.document_threads_state', "{\"some.res.model_1\":{\"name\":\"Some Record\",\"windowState\":\"closed\"}}"],
+ ['mail.document_threads_state', {"some.res.model_1": {"name": "Some Record", "windowState": "open"}}],
+ ['mail.document_threads_state', {"some.res.model_1": {"name": "Some Record", "windowState": "folded"}}],
+ ['mail.document_threads_state', {"some.res.model_1": {"name": "Some Record", "windowState": "open"}}],
+ ['mail.document_threads_state', {"some.res.model_1": {"name": "Some Record", "windowState": "closed"}}],
]);
messagingMenu.destroy();