@@ -5,11 +5,12 @@ import { randomUUID } from "node:crypto";
55import { logger } from "tests/helpers/pino-logger" ;
66import { createValidRequestHeaders } from "tests/constants/request-headers" ;
77import getRestApiGatewayBaseUrl from "tests/helpers/aws-gateway-helper" ;
8- import { SUPPLIER_LETTERS } from "tests/constants/api-constants" ;
8+ import { SUPPLIER_LETTERS , envName } from "tests/constants/api-constants" ;
99import {
1010 pollSupplierAllocatorLogForResolvedSpec ,
1111 pollUpsertLetterLogForError ,
1212} from "tests/helpers/aws-cloudwatch-helper" ;
13+ import { supplierDataSetup } from "tests/helpers/suppliers-setup-helper" ;
1314
1415let baseUrl : string ;
1516
@@ -18,7 +19,7 @@ test.beforeAll(async () => {
1819} ) ;
1920
2021test . describe ( "Event Subscription SNS Tests" , ( ) => {
21- test ( " Verify that the publish event to nhs-main -supapi-eventsub topic inserts data into db" , async ( {
22+ test ( ` Verify that the publish event to nhs-${ envName } -supapi-eventsub topic inserts data into db` , async ( {
2223 request,
2324 } ) => {
2425 const domainId = randomUUID ( ) ;
@@ -43,6 +44,9 @@ test.describe("Event Subscription SNS Tests", () => {
4344 throw new Error ( "supplierId was not found in supplier allocator log" ) ;
4445 }
4546
47+ // check if supplier exists in suppliers table
48+ await supplierDataSetup ( supplierId ) ;
49+
4650 const headers = createValidRequestHeaders ( supplierId ) ;
4751 let statusCode = 0 ;
4852 let letterStatus : string | undefined ;
0 commit comments