Spaces:
Sleeping
Sleeping
File size: 905 Bytes
097eaf0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | import { WebhookEvent } from "./types";
import { webhookEventMatchesFilter } from "./delivery";
describe("webhook delivery", () => {
describe("webhookEventMatchesFilter", () => {
it("matches full monitor event names", () => {
expect(
webhookEventMatchesFilter(
["monitor.page", "monitor.check.completed"],
WebhookEvent.MONITOR_PAGE,
),
).toBe(true);
expect(
webhookEventMatchesFilter(
["monitor.page", "monitor.check.completed"],
WebhookEvent.MONITOR_CHECK_COMPLETED,
),
).toBe(true);
});
it("keeps legacy subtype filters for non-monitor webhooks", () => {
expect(webhookEventMatchesFilter(["page"], WebhookEvent.CRAWL_PAGE)).toBe(
true,
);
expect(
webhookEventMatchesFilter(["completed"], WebhookEvent.CRAWL_COMPLETED),
).toBe(true);
});
});
});
|