diff options
| author | Vandan Shah <vas@odoo.com> | 2017-10-09 18:10:07 +0530 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-08-20 21:11:54 +0200 |
| commit | f4ee61f950dc1eeb7b3653ca96ea72721512b5e5 (patch) | |
| tree | f220a194327bcea0fae2e03d536ab41d08e34011 /addons/web/static/tests/fields/relational_fields_tests.js | |
| parent | a7e94f1a83084d885694543fb9b9002acc50bb2d (diff) | |
[IMP] web: mobile: add swipe support in form views
This rev. allows to navigate, in mobile, through records in form
views by swiping.
We also moved mobile-specific tests involving a form view to the
mobile test suite, since those tests became async because of the
lazy loading of the swipe lib (in the mobile suite, that lib is
already loaded).
Related to task #34727
Co-authored-by: Mohammed Shekha <msh@openerp.com>
Diffstat (limited to 'addons/web/static/tests/fields/relational_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index bb7b4a446e6..245ff8f7a07 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -4909,74 +4909,6 @@ QUnit.module('relational_fields', { form.destroy(); }); - QUnit.test('one2many kanban: deletion in mobile', function (assert) { - assert.expect(9); - - this.data.partner.records[0].p = [1, 2]; - var form = createView({ - View: FormView, - model: 'partner', - data: this.data, - arch: '<form string="Partners">' + - '<field name="p">' + - '<kanban>' + - '<templates>' + - '<t t-name="kanban-box">' + - '<div class="oe_kanban_global_click">' + - '<field name="display_name"/>' + - '</div>' + - '</t>' + - '</templates>' + - '</kanban>' + - '<form string="Partners">' + - '<field name="display_name"/>' + - '</form>' + - '</field>' + - '</form>', - res_id: 1, - mockRPC: function (route, args) { - if (route === '/web/dataset/call_kw/partner/write') { - var commands = args.args[1].p; - assert.strictEqual(commands.length, 2, - 'should have generated two commands'); - assert.ok(commands[0][0] === 4 && commands[0][1] === 2, - 'should have generated the command 2 (DELETE) with id 1'); - assert.ok(commands[1][0] === 2 && commands[1][1] === 1, - 'should have generated the command 2 (DELETE) with id 2'); - } - return this._super.apply(this, arguments); - }, - config: { - device: { - size_class: config.device.SIZES.XS, - }, - }, - }); - - assert.strictEqual(form.$('.o_field_one2many .o-kanban-button-new').length, 0, - '"Create" button should not be visible in readonly'); - - form.$buttons.find('.o_form_button_edit').click(); - - assert.strictEqual(form.$('.o_field_one2many .o-kanban-button-new').length, 1, - '"Create" button should be visible in edit'); - assert.strictEqual(form.$('.o_kanban_record:not(.o_kanban_ghost)').length, 2, - "should have 2 records"); - - // open and delete record - form.$('.oe_kanban_global_click').first().click(); - assert.strictEqual($('.modal .modal-footer .o_btn_remove').length, 1, - 'there should be a Remove button in the modal footer'); - $('.modal .modal-footer .o_btn_remove').click(); - assert.strictEqual($('.o_modal').length, 0, "there shoul be no more modal"); - assert.strictEqual(form.$('.o_kanban_record:not(.o_kanban_ghost)').length, 1, - 'should contain 1 records'); - - // save and check that the correct command has been generated - form.$buttons.find('.o_form_button_save').click(); - form.destroy(); - }); - QUnit.test('one2many kanban: create action disabled', function (assert) { assert.expect(3); |
