mirror of
https://github.com/block/buzz.git
synced 2026-10-31 14:31:02 +00:00
Polish workflow trigger conditions and sequence editor
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
@@ -68,19 +68,37 @@ test("normalizes safe webhook fields and rejects reserved or invalid names", ()
|
||||
test("shows trigger-relevant fields", () => {
|
||||
assert.deepEqual(
|
||||
conditionFieldsForTrigger("reaction_added").map((field) => field.value),
|
||||
[
|
||||
"trigger_emoji",
|
||||
"trigger_author",
|
||||
"trigger_channel_id",
|
||||
"trigger_message_id",
|
||||
],
|
||||
["trigger_emoji", "trigger_author", "trigger_message_id"],
|
||||
);
|
||||
assert.equal(conditionFieldsForTrigger("webhook")[0].value, "webhook_field");
|
||||
for (const triggerType of ["message_posted", "diff_posted"]) {
|
||||
assert.equal(
|
||||
conditionFieldsForTrigger(triggerType).some(
|
||||
(field) => field.value === "trigger_message_id",
|
||||
),
|
||||
false,
|
||||
);
|
||||
}
|
||||
for (const triggerType of [
|
||||
"message_posted",
|
||||
"diff_posted",
|
||||
"reaction_added",
|
||||
"webhook",
|
||||
"schedule",
|
||||
]) {
|
||||
assert.equal(
|
||||
conditionFieldsForTrigger(triggerType).some(
|
||||
(field) => field.value === "trigger_channel_id",
|
||||
),
|
||||
false,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test("limits opaque identifiers to equality operators", () => {
|
||||
for (const field of [
|
||||
"trigger_author",
|
||||
"trigger_emoji",
|
||||
"trigger_channel_id",
|
||||
"trigger_message_id",
|
||||
"future_resource_id",
|
||||
|
||||
Reference in New Issue
Block a user