@@ -79,7 +79,7 @@ describe("allocator", () => {
7979 } ) ;
8080
8181 describe ( "createAllocator" , ( ) => {
82- it ( "should process a single SNS record and send message to SQS" , async ( ) => {
82+ it ( "should place the SNS event unchanged on the SQS queue " , async ( ) => {
8383 const letterEvent = createLetterEvent ( "id1" ) ;
8484 const snsEvent = createSNSEvent ( [
8585 createSNSEventRecord ( JSON . stringify ( letterEvent ) ) ,
@@ -92,8 +92,8 @@ describe("allocator", () => {
9292 expect . objectContaining ( {
9393 input : {
9494 QueueUrl : mockQueueUrl ,
95- MessageBody : JSON . stringify ( letterEvent ) ,
96- MessageGroupId : "id1" ,
95+ MessageBody : JSON . stringify ( snsEvent . Records [ 0 ] ) ,
96+ MessageGroupId : expect . any ( String ) ,
9797 } ,
9898 } ) ,
9999 ) ;
@@ -120,8 +120,8 @@ describe("allocator", () => {
120120 expect . objectContaining ( {
121121 input : {
122122 QueueUrl : mockQueueUrl ,
123- MessageBody : JSON . stringify ( letterEvent1 ) ,
124- MessageGroupId : "id1" ,
123+ MessageBody : JSON . stringify ( snsEvent . Records [ 0 ] ) ,
124+ MessageGroupId : expect . any ( String ) ,
125125 } ,
126126 } ) ,
127127 ) ;
@@ -130,8 +130,8 @@ describe("allocator", () => {
130130 expect . objectContaining ( {
131131 input : {
132132 QueueUrl : mockQueueUrl ,
133- MessageBody : JSON . stringify ( letterEvent2 ) ,
134- MessageGroupId : "id2" ,
133+ MessageBody : JSON . stringify ( snsEvent . Records [ 1 ] ) ,
134+ MessageGroupId : expect . any ( String ) ,
135135 } ,
136136 } ) ,
137137 ) ;
@@ -140,8 +140,8 @@ describe("allocator", () => {
140140 expect . objectContaining ( {
141141 input : {
142142 QueueUrl : mockQueueUrl ,
143- MessageBody : JSON . stringify ( letterEvent3 ) ,
144- MessageGroupId : "id3" ,
143+ MessageBody : JSON . stringify ( snsEvent . Records [ 2 ] ) ,
144+ MessageGroupId : expect . any ( String ) ,
145145 } ,
146146 } ) ,
147147 ) ;
0 commit comments