Simplify workflow equality labels

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
Taylor Ho
2026-08-13 23:45:01 -07:00
parent 8be1947168
commit 5d6ac15476
3 changed files with 19 additions and 3 deletions
@@ -29,7 +29,7 @@ const OPERATOR_LABELS: Record<ConditionOperator, string> = {
not_contains: "does not contain",
starts_with: "starts with",
ends_with: "ends with",
equals: "is exactly",
equals: "is",
not_equals: "is not",
is_not_empty: "is not empty",
is_empty: "is empty",
@@ -23,6 +23,22 @@ test("describes selected trigger conditions on the workflow canvas", () => {
"Message posted containing “deploy”",
);
assert.equal(
workflowTriggerDescription({
on: "message_posted",
filter: 'trigger_text == "deploy"',
}),
"Message posted is “deploy”",
);
assert.equal(
workflowTriggerDescription({
on: "message_posted",
filter: 'trigger_text != "deploy"',
}),
"Message posted is not “deploy”",
);
assert.equal(
workflowTriggerDescription({
on: "message_posted",
@@ -45,9 +45,9 @@ function textConditionDescription(
case "ends_with":
return `${eventPhrase} ending with ${value}`;
case "equals":
return `${eventPhrase} matching ${value}`;
return `${eventPhrase} is ${value}`;
case "not_equals":
return `${eventPhrase} not matching ${value}`;
return `${eventPhrase} is not ${value}`;
case "is_not_empty":
return eventPhrase === "Message posted"
? "Text message posted"