From 15f3bbe5942eee23039d0b40d2bcc0eb274ba129 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Wed, 20 Jun 2018 13:38:08 +0200 Subject: [MOV] web,im_livechat: Move clipboard widget to web --- .../web/static/tests/fields/basic_fields_tests.js | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'addons/web/static/tests/fields/basic_fields_tests.js') diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index e285626f763..d95d34431b3 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -1291,6 +1291,44 @@ QUnit.module('basic_fields', { list.destroy(); }); + QUnit.module('copy_clipboard', { + beforeEach: function () { + this.data = { + partner: { + fields: { + script_external: {string: "Script External", type: "text"}, + web_page: {string: "Web page link", type: "char"} + }, + records: [{ + id: 1, + script_external:'Random Text', + web_page: 'web page links' + },], + }, + }; + } + }); + + QUnit.test('im_livechat: Copy to clipboard button', function (assert) { + assert.expect(2); + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: '
' + + '' + + '
' + + '' + + '' + + '
' + + '
' + + '
', + }); + assert.strictEqual(form.$('.o_clipboard_button.o_btn_text_copy').length, 1,"Should have copy button on text type field"); + assert.strictEqual(form.$('.o_clipboard_button.o_btn_char_copy').length, 1,"Should have copy button on char type field"); + form.destroy(); + }); QUnit.module('FieldText'); -- cgit v1.2.3