summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/basic_fields_tests.js
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2020-02-12 16:49:31 +0000
committerLucas Perais (lpe) <lpe@odoo.com>2020-02-13 10:18:33 +0000
commit8fd69c44f29b9d58a4112cdd4585496fe111e042 (patch)
tree9507239baca37702fbc057ac9833ac47d09a3f0b /addons/web/static/tests/fields/basic_fields_tests.js
parentbf1e3a6cf36d089585ba7a5ff72e390d99dda7e7 (diff)
[FIX] sms, web: phone widget with sms tested in right module
Before this commit, the behavior of the phone widget was tested in web as if it was always altered with module SMS Giving wrong test results when sms module was not installed After this commit, the separation is clearer, and the phone widget's behavior is tested according to the modules it is altered by closes odoo/odoo#45271 X-original-commit: 2e337516468797dd898c79c9669b5a90c83b56a7 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
-rw-r--r--addons/web/static/tests/fields/basic_fields_tests.js18
1 files changed, 3 insertions, 15 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js
index cb19958ef94..ada71b91429 100644
--- a/addons/web/static/tests/fields/basic_fields_tests.js
+++ b/addons/web/static/tests/fields/basic_fields_tests.js
@@ -4907,7 +4907,7 @@ QUnit.module('basic_fields', {
});
QUnit.test('phone field in editable list view on normal screens', async function (assert) {
- assert.expect(11);
+ assert.expect(8);
var doActionCount = 0;
var list = await createView({
@@ -4920,17 +4920,10 @@ QUnit.module('basic_fields', {
size_class: config.device.SIZES.LG,
},
},
- intercepts: {
- do_action(ev) {
- assert.equal(ev.data.action.res_model, 'sms.composer',
- 'The action to send an SMS should have been executed');
- doActionCount += 1;
- }
- }
});
assert.containsN(list, 'tbody td:not(.o_list_record_selector)', 5);
- assert.strictEqual(list.$('tbody td:not(.o_list_record_selector)').first().text(), 'yopSMS',
+ assert.strictEqual(list.$('tbody td:not(.o_list_record_selector) a').first().text(), 'yop',
"value should be displayed properly with a link to send SMS");
assert.containsN(list, 'a.o_field_widget.o_form_uri', 5,
@@ -4948,16 +4941,11 @@ QUnit.module('basic_fields', {
await testUtils.dom.click(list.$buttons.find('.o_list_button_save'));
$cell = list.$('tbody td:not(.o_list_record_selector)').first();
assert.doesNotHaveClass($cell.parent(), 'o_selected_row', 'should not be in edit mode anymore');
- assert.strictEqual(list.$('tbody td:not(.o_list_record_selector)').first().text(), 'newSMS',
+ assert.strictEqual(list.$('tbody td:not(.o_list_record_selector) a').first().text(), 'new',
"value should be properly updated");
assert.containsN(list, 'a.o_field_widget.o_form_uri', 5,
"should still have links with correct classes");
- await testUtils.dom.click(list.$('tbody td:not(.o_list_record_selector) .o_field_phone_sms').first());
- assert.equal(doActionCount, 1, 'Only one action should have been executed');
- assert.containsNone(list, '.o_selected_row',
- 'None of the list element should have been activated');
-
list.destroy();
});