Skip to content

Commit 6bc4c99

Browse files
committed
test(protect): add empty batch edge case for searchableJson
1 parent 19c352b commit 6bc4c99

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/protect/__tests__/encrypt-query-searchable-json.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,13 @@ describe('searchableJson batch edge cases', () => {
792792
expect(data[2]).toBeNull()
793793
}, 30000)
794794

795+
it('handles empty batch', async () => {
796+
const result = await protectClient.encryptQuery([])
797+
798+
const data = unwrapResult(result)
799+
expect(data).toHaveLength(0)
800+
}, 30000)
801+
795802
it('handles large batch (10+ items)', async () => {
796803
const items = Array.from({ length: 12 }, (_, i) => ({
797804
value: i % 2 === 0 ? `$.path${i}` : { index: i },

0 commit comments

Comments
 (0)