mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Simplify workflow equality labels
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user