From c303045e33402600d45969ae71c1be7c42d8e43b Mon Sep 17 00:00:00 2001 From: Brian Lee Date: Tue, 9 Jan 2024 08:32:45 -0800 Subject: [PATCH] size-limit-policy: add test. --- src/policies/size-limit-policy.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/policies/size-limit-policy.test.ts b/src/policies/size-limit-policy.test.ts index 78bb9bb..cdb8450 100644 --- a/src/policies/size-limit-policy.test.ts +++ b/src/policies/size-limit-policy.test.ts @@ -11,10 +11,12 @@ Deno.test('Size limit policy test', async () => { // Create a message over 12KB const largeContent = 'Hello'.repeat(2500); // Over 12KB const largeMessage = buildInputMessage({ event: buildEvent({ content: largeContent }) }); + const largeReplaceable = buildInputMessage({ event: buildEvent({ content: largeContent, kind: 30078 }) }); // Test that a small message is accepted assertEquals((await sizeLimitPolicy(smallMessage)).action, 'accept', 'Small message should be accepted'); // Test that a large message is rejected assertEquals((await sizeLimitPolicy(largeMessage)).action, 'reject', 'Large message should be rejected'); + assertEquals((await sizeLimitPolicy(largeReplaceable)).action, 'accept', 'Large replaceable event should be accepted'); });