@@ -176,23 +176,23 @@ describe('Step-based Audit Tests', () => {
176
176
fullAuditRef : 's3://test/123' ,
177
177
} ) ;
178
178
179
- // Verify message sent to content scraper
180
- expect ( context . sqs . sendMessage ) . to . have . been . calledWith ( {
181
- QueueUrl : 'https://space.cat/content-scraper' ,
182
- MessageBody : sinon . match . string ,
183
- } ) ;
184
-
185
- const sentMessage = JSON . parse ( context . sqs . sendMessage . firstCall . args [ 0 ] . MessageBody ) ;
186
- expect ( sentMessage ) . to . deep . include ( {
179
+ // Update verification to match actual implementation
180
+ const expectedPayload = {
187
181
urls : [ { url : baseURL } ] ,
188
182
jobId : '42322ae6-b8b1-4a61-9c88-25205fa65b07' ,
183
+ processingType : 'default' ,
189
184
auditContext : {
190
185
next : 'process' ,
191
186
auditId : '109b71f7-2005-454e-8191-8e92e05daac2' ,
192
187
auditType : 'content-audit' ,
193
188
fullAuditRef : 's3://test/123' ,
194
189
} ,
195
- } ) ;
190
+ } ;
191
+
192
+ expect ( context . sqs . sendMessage ) . to . have . been . calledWith (
193
+ 'https://space.cat/content-scraper' ,
194
+ expectedPayload ,
195
+ ) ;
196
196
} ) ;
197
197
198
198
it ( 'continues execution from specified step' , async ( ) => {
@@ -223,14 +223,8 @@ describe('Step-based Audit Tests', () => {
223
223
// Verify no new audit record is created
224
224
expect ( context . dataAccess . Audit . create ) . not . to . have . been . called ;
225
225
226
- // Verify message sent to import worker
227
- expect ( context . sqs . sendMessage ) . to . have . been . calledWith ( {
228
- QueueUrl : 'https://space.cat/import-worker' ,
229
- MessageBody : sinon . match . string ,
230
- } ) ;
231
-
232
- const sentMessage = JSON . parse ( context . sqs . sendMessage . firstCall . args [ 0 ] . MessageBody ) ;
233
- expect ( sentMessage ) . to . deep . include ( {
226
+ // Update verification to match actual implementation
227
+ const expectedPayload = {
234
228
type : 'content-import' ,
235
229
siteId : '42322ae6-b8b1-4a61-9c88-25205fa65b07' ,
236
230
auditContext : {
@@ -239,7 +233,12 @@ describe('Step-based Audit Tests', () => {
239
233
auditType : 'content-audit' ,
240
234
fullAuditRef : 's3://test/123' ,
241
235
} ,
242
- } ) ;
236
+ } ;
237
+
238
+ expect ( context . sqs . sendMessage ) . to . have . been . calledWith (
239
+ 'https://space.cat/import-worker' ,
240
+ expectedPayload ,
241
+ ) ;
243
242
} ) ;
244
243
245
244
it ( 'handles final step without sending messages' , async ( ) => {
0 commit comments