@@ -14,7 +14,7 @@ test.beforeAll(async () => {
1414} ) ;
1515
1616test . describe ( 'API Gateway Tests to Verify Patch Status Endpoint' , ( ) => {
17- test ( `Patch /letters returns 200 and status is updated to ACCEPTED` , async ( { request } ) => {
17+ test ( `Patch /letters returns 202 and status is updated to ACCEPTED` , async ( { request } ) => {
1818
1919 await createTestData ( SUPPLIERID ) ;
2020 const letters = await getLettersBySupplier ( SUPPLIERID , 'PENDING' , 1 ) ;
@@ -33,23 +33,12 @@ test.describe('API Gateway Tests to Verify Patch Status Endpoint', () => {
3333 } ) ;
3434
3535 const responseBody = await response . json ( ) ;
36- expect ( response . status ( ) ) . toBe ( 200 ) ;
37- expect ( responseBody ) . toMatchObject ( {
38- data :{
39- attributes : {
40- status : 'ACCEPTED' ,
41- specificationId : letter . specificationId ,
42- groupId : letter . groupId ,
43- } ,
44- id : letter . id ,
45- type : 'Letter'
46- }
47- } ) ;
36+ expect ( response . status ( ) ) . toBe ( 202 ) ;
4837
4938 await deleteLettersBySupplier ( letter . id ) ;
5039 } ) ;
5140
52- test ( `Patch /letters returns 200 and status is updated to REJECTED` , async ( { request } ) => {
41+ test ( `Patch /letters returns 202 and status is updated to REJECTED` , async ( { request } ) => {
5342
5443 await createTestData ( SUPPLIERID ) ;
5544 const letters = await getLettersBySupplier ( SUPPLIERID , 'PENDING' , 1 ) ;
@@ -68,18 +57,7 @@ test.describe('API Gateway Tests to Verify Patch Status Endpoint', () => {
6857 } ) ;
6958
7059 const responseBody = await response . json ( ) ;
71- expect ( response . status ( ) ) . toBe ( 200 ) ;
72- expect ( responseBody ) . toMatchObject ( {
73- data :{
74- attributes : {
75- status : 'REJECTED' ,
76- specificationId : letter . specificationId ,
77- groupId : letter . groupId ,
78- } ,
79- id : letter . id ,
80- type : 'Letter'
81- }
82- } ) ;
60+ expect ( response . status ( ) ) . toBe ( 202 ) ;
8361
8462 await deleteLettersBySupplier ( letter . id ) ;
8563 } ) ;
0 commit comments