From 2e17c0458c63661672b25b1a2fe7b46226d09381 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 16 Jul 2020 14:32:03 +0000 Subject: [FIX] web: tests: fix typos in :{last,first}-child Follow-up of odoo/enterprise#11881, in order to eliminate all similar typos. The CSS pseudo-class selectors are spelled `:first-child` and `:last-child`, and never take any argument, as opposed to `:nth-child()` for example. Ref: https://developer.mozilla.org/docs/Web/CSS/Pseudo-classes jQuery doesn't care and matches with or without the `()`, but CSS engines don't, and now libsass SCSS compilation crashes due to the empty argument list (cfr. opw-2299465) Better avoid confusion and fix the typo everywhere. closes odoo/odoo#54685 X-original-commit: 82244e17339615615535073e6f9e1ddbcf0b57d9 Signed-off-by: Richard Mathot (rim) Signed-off-by: Olivier Dony (odo) --- addons/web/static/tests/fields/basic_fields_tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 5f537db41eb..504d69dff69 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -4323,13 +4323,13 @@ QUnit.module('basic_fields', { await testUtils.form.clickCreate(form); testUtils.dom.openDatepicker(form.$('.o_datepicker')); - $.each($('.day:last-child(),.day:nth-child(2)'), function (index, value) { + $.each($('.day:last-child,.day:nth-child(2)'), function (index, value) { assert.hasClass(value, 'disabled', 'first and last days must be disabled'); }); // the assertions below could be replaced by a single hasClass classic on the jQuery set using the idea // All not <=> not Exists. But we want to be sure that the set is non empty. We don't have an helper // function for that. - $.each($('.day:not(:last-child()):not(:nth-child(2))'), function (index, value) { + $.each($('.day:not(:last-child):not(:nth-child(2))'), function (index, value) { assert.doesNotHaveClass(value, 'disabled', 'other days must stay clickable'); }); form.destroy(); -- cgit v1.2.3