Skip to content

Commit

Permalink
test: add test for forbidden sqs payload unicode char (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
Drodevbar authored Oct 30, 2024
1 parent 4af7707 commit a16f810
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/sqs/test/publishers/SqsPermissionPublisher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,17 @@ describe('SqsPermissionPublisher', () => {
).rejects.toThrow(/Unsupported message type: bad/)
})

// See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html
it('publish message with payload containing forbidden unicode character', async () => {
await expect(
permissionPublisher.publish({
id: '\uFFFF',
messageType: 'add',
timestamp: new Date().toISOString(),
} satisfies PERMISSIONS_ADD_MESSAGE_TYPE),
).rejects.toThrow(/Error while publishing to SQS: Invalid characters found/)
})

it('publishes a message', async () => {
const { permissionPublisher } = diContainer.cradle

Expand Down

0 comments on commit a16f810

Please sign in to comment.