[FIX] web: expression editor: between operator

We make the expression editor support the between operator.

closes odoo/odoo#142483

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
This commit is contained in:
Mathieu Duckerts-Antoine
2023-11-23 17:50:40 +00:00
parent 40e0b4e324
commit 71ee2c0995
2 changed files with 24 additions and 0 deletions
@@ -7,6 +7,7 @@ const EXPRESSION_VALID_OPERATORS = [
"<=",
">",
">=",
"between",
"in",
"not in",
"=",
@@ -464,4 +464,27 @@ QUnit.module("Components", (hooks) => {
["Bar", "Foo"]
);
});
QUnit.test("between operator", async (assert) => {
await makeExpressionEditor({
expression: `id == 1`,
update(expression) {
assert.step(expression);
},
});
assert.deepEqual(getOperatorOptions(target), [
"=",
"!=",
">",
">=",
"<",
"<=",
"is between",
"is set",
"is not set",
]);
assert.verifySteps([]);
await selectOperator(target, "between");
assert.verifySteps([`id >= 1 and id <= 1`]);
});
});