diff options
| author | XavierDo <xdo@odoo.com> | 2018-08-29 12:10:27 +0200 |
|---|---|---|
| committer | XavierDo <xdo@odoo.com> | 2018-09-07 14:59:05 +0200 |
| commit | 7f47dcae5bba731d19d4d580fe1713f4d7a227b1 (patch) | |
| tree | 9f01e47c84bbfb23dd3b790a8a3227c5cdf306c6 /addons/mail/static/tests/activity_tests.js | |
| parent | dd32131ce670b5daf80026c80275e5ab2c4f1223 (diff) | |
[FIX] mail: improve activity view and fix activity feedback
-Improve no content helper on activity view
-Update chatter after editing an activity un form view
-Avoid context to appear as feedback
When using call_button the context is set as an arg and will be catched by
the kwargs of the called action.
As for action_feedback, we can create a wrapper without kwargs
used when calling this method from a button to avoid this problem.
Another solution would be to change the call_button in order to give
the context as a kwargs. Maybe a possible improvement for master.
-Remove groupby from activity view
group by has no effect on activity
-Change cursor to pointer on record name in activity view
Task: #1878184
PR: #26668
Diffstat (limited to 'addons/mail/static/tests/activity_tests.js')
| -rw-r--r-- | addons/mail/static/tests/activity_tests.js | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/addons/mail/static/tests/activity_tests.js b/addons/mail/static/tests/activity_tests.js index 790b47a6889..8dfa518da5f 100644 --- a/addons/mail/static/tests/activity_tests.js +++ b/addons/mail/static/tests/activity_tests.js @@ -4,6 +4,8 @@ odoo.define('mail.activity_view_tests', function (require) { var ActivityView = require('mail.ActivityView'); var testUtils = require('web.test_utils'); +var createActionManager = testUtils.createActionManager; + var createView = testUtils.createView; var ACTIVITY_DATA = { "grouped_activities":{ @@ -204,8 +206,8 @@ QUnit.test('activity view: no content rendering', function (assert) { assert.strictEqual(activity.$('.o_view_nocontent').length, 1, "should display the no content helper"); - assert.strictEqual(activity.$('.o_view_nocontent').text().trim(), - "No scheduled activity yet", + assert.strictEqual(activity.$('.o_view_nocontent .o_view_nocontent_empty_folder').text().trim(), + "No data to display", "should display the no content helper text"); activity.destroy(); @@ -263,10 +265,10 @@ QUnit.test('activity view: activity widget', function (assert) { assert.step('activity_send_mail'); return $.when(); } - if (args.method === 'action_done_schedule_next'){ - assert.deepEqual([[3]],args.args, "Should execute action_done_schedule_next on activity 3 only "); + if (args.method === 'action_feedback_schedule_next'){ + assert.deepEqual([[3]],args.args, "Should execute action_feedback_schedule_next on activity 3 only "); assert.equal(args.kwargs.feedback, "feedback2"); - assert.step('action_done_schedule_next'); + assert.step('action_feedback_schedule_next'); return $.when({serverGeneratedAction: true}); } if (args.method === 'get_activity_data') { @@ -329,12 +331,48 @@ QUnit.test('activity view: activity widget', function (assert) { "do_action_compose", "activity_send_mail", "do_action_activity", - "action_done_schedule_next", + "action_feedback_schedule_next", "serverGeneratedAction" ]); activity.destroy(); +}); +QUnit.test('activity view: no group by', function (assert) { + assert.expect(4); + + var actionManager = createActionManager({ + actions: [{ + id: 1, + name: 'Task Action', + res_model: 'task', + type: 'ir.actions.act_window', + views: [[false, 'activity']], + }], + archs: { + 'task,false,activity': '<activity></activity>', + 'task,false,search': '<search></search>', + }, + data: this.data, + mockRPC: function(route, args) { + if (args.method === 'get_activity_data') { + return $.when(ACTIVITY_DATA); + } + return this._super(route, args); + }, }); + actionManager.doAction(1); + + assert.strictEqual($('.o_search_options .o_dropdown:visible').length, 2, + "only two elements should be available in view search"); + assert.strictEqual($('.o_search_options .o_dropdown:visible .o_filters_menu').length, 1, + "filter should be available in view search"); + assert.strictEqual($('.o_search_options .o_dropdown:visible .o_favorites_menu').length, 1, + "favorites should be available in view search"); + assert.strictEqual($('.o_search_options .o_dropdown:hidden .o_group_by_menu').length, 1, + "group by should be hidden"); + actionManager.destroy(); +}); + }); }); |
