Browse Source

[ADD] js simple test

pull/6/head
Ilyas 9 years ago
parent
commit
255c8e210c
  1. 2
      mail_archives/static/src/xml/menu.xml
  2. 3
      mail_archives/tests/__init__.py
  3. 15
      mail_archives/tests/test_js.py

2
mail_archives/static/src/xml/menu.xml

@ -4,7 +4,7 @@
<t t-extend="mail.chat.Sidebar"> <t t-extend="mail.chat.Sidebar">
<t t-jquery="div[data-channel-id=channel_starred]" t-operation="after"> <t t-jquery="div[data-channel-id=channel_starred]" t-operation="after">
<div t-attf-class="o_mail_chat_channel_item #{(active_channel_id == 'channel_archive') ? 'o_active': ''}" data-channel-id="channel_archive"> <div t-attf-class="o_mail_chat_channel_item #{(active_channel_id == 'channel_archive') ? 'o_active': ''}" data-channel-id="channel_archive">
<span class="o_channel_name"> <i class="fa fa-archive"/> Archive </span>
<span class="o_channel_name mail_archives"> <i class="fa fa-archive"/> Archive </span>
</div> </div>
</t> </t>
</t> </t>

3
mail_archives/tests/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
import test_js

15
mail_archives/tests/test_js.py

@ -0,0 +1,15 @@
import openerp.tests
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_01_mail_archives(self):
# wait till page loaded and then click and wait again
code = """
setTimeout(function () {
$(".mail_archives").click();
setTimeout(function () {console.log('ok');}, 3000);
}, 1000);
"""
link = '/web#action=%s' % self.ref('mail.mail_channel_action_client_chat')
self.phantom_js(link, code, "odoo.__DEBUG__.services['mail_archives.archives']", login="demo")
Loading…
Cancel
Save