From 5903d8650e83f63c396a4a43f0a93378fe82bce1 Mon Sep 17 00:00:00 2001 From: Thomas Baggaley Date: Tue, 25 May 2021 11:49:13 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20"Not=20any=20of"=20option=20t?= =?UTF-8?q?o=20binary=20expressions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/convertRoutingConditions/index.js | 5 +++-- src/utils/convertRoutingConditions/index.test.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils/convertRoutingConditions/index.js b/src/utils/convertRoutingConditions/index.js index 2bdf70e7..47d9493c 100644 --- a/src/utils/convertRoutingConditions/index.js +++ b/src/utils/convertRoutingConditions/index.js @@ -7,11 +7,12 @@ const routingConditionConversions = { LessOrEqual: "less than or equal to", AllOf: "contains all", AnyOf: "contains any", + NotAnyOf: "not contains any", Unanswered: "not set", - OneOf: "equals any" + OneOf: "equals any", }; -const conditionConversion = authorCondition => { +const conditionConversion = (authorCondition) => { const runnerCondition = routingConditionConversions[authorCondition]; if (!runnerCondition) { throw new Error(`Unsupported author condition: ${authorCondition}`); diff --git a/src/utils/convertRoutingConditions/index.test.js b/src/utils/convertRoutingConditions/index.test.js index fb30931c..52be35e2 100644 --- a/src/utils/convertRoutingConditions/index.test.js +++ b/src/utils/convertRoutingConditions/index.test.js @@ -8,9 +8,10 @@ describe("Convert routing conditions", () => { GreaterThan: "greater than", LessThan: "less than", GreaterOrEqual: "greater than or equal to", - LessOrEqual: "less than or equal to" + LessOrEqual: "less than or equal to", + NotAnyOf: "not contains any", }; - Object.keys(conditionMap).forEach(authorCondition => + Object.keys(conditionMap).forEach((authorCondition) => expect(converter(authorCondition)).toEqual(conditionMap[authorCondition]) ); });