1- import { patchLetters } from '../../index' ;
1+ import { patchLetter } from '../../index' ;
22import { APIGatewayProxyResult , Context } from 'aws-lambda' ;
33import { mockDeep } from 'jest-mock-extended' ;
44import { makeApiGwEvent } from './utils/test-utils' ;
@@ -45,7 +45,7 @@ beforeEach(() => {
4545 jest . clearAllMocks ( ) ;
4646} ) ;
4747
48- describe ( 'patchLetters API Handler' , ( ) => {
48+ describe ( 'patchLetter API Handler' , ( ) => {
4949
5050 it ( 'returns 200 OK with updated resource' , async ( ) => {
5151 const event = makeApiGwEvent ( {
@@ -72,7 +72,7 @@ describe('patchLetters API Handler', () => {
7272 } ;
7373 mockedPatchLetterStatus . mockResolvedValue ( updateLetterServiceResponse ) ;
7474
75- const result = await patchLetters ( event , context , callback ) ;
75+ const result = await patchLetter ( event , context , callback ) ;
7676
7777 expect ( result ) . toEqual ( {
7878 statusCode : 200 ,
@@ -89,7 +89,7 @@ describe('patchLetters API Handler', () => {
8989 const context = mockDeep < Context > ( ) ;
9090 const callback = jest . fn ( ) ;
9191
92- const result = await patchLetters ( event , context , callback ) ;
92+ const result = await patchLetter ( event , context , callback ) ;
9393
9494 expect ( mockedMapErrorToResponse ) . toHaveBeenCalledWith ( new ValidationError ( errors . ApiErrorDetail . InvalidRequestMissingBody ) , 'correlationId' ) ;
9595 expect ( result ) . toEqual ( expectedErrorResponse ) ;
@@ -103,7 +103,7 @@ describe('patchLetters API Handler', () => {
103103 } ) ;
104104 const context = mockDeep < Context > ( ) ;
105105 const callback = jest . fn ( ) ;
106- const result = await patchLetters ( event , context , callback ) ;
106+ const result = await patchLetter ( event , context , callback ) ;
107107
108108 expect ( mockedMapErrorToResponse ) . toHaveBeenCalledWith ( new ValidationError ( errors . ApiErrorDetail . InvalidRequestMissingLetterIdPathParameter ) , 'correlationId' ) ;
109109 expect ( result ) . toEqual ( expectedErrorResponse ) ;
@@ -122,7 +122,7 @@ describe('patchLetters API Handler', () => {
122122 const context = mockDeep < Context > ( ) ;
123123 const callback = jest . fn ( ) ;
124124
125- const result = await patchLetters ( event , context , callback ) ;
125+ const result = await patchLetter ( event , context , callback ) ;
126126
127127 expect ( mockedMapErrorToResponse ) . toHaveBeenCalledWith ( error , 'correlationId' ) ;
128128 expect ( result ) . toEqual ( expectedErrorResponse ) ;
@@ -138,7 +138,7 @@ describe('patchLetters API Handler', () => {
138138 const context = mockDeep < Context > ( ) ;
139139 const callback = jest . fn ( ) ;
140140
141- const result = await patchLetters ( event , context , callback ) ;
141+ const result = await patchLetter ( event , context , callback ) ;
142142
143143 expect ( mockedMapErrorToResponse ) . toHaveBeenCalledWith ( new ValidationError ( errors . ApiErrorDetail . InvalidRequestMissingSupplierId ) , 'correlationId' ) ;
144144 expect ( result ) . toEqual ( expectedErrorResponse ) ;
@@ -154,7 +154,7 @@ describe('patchLetters API Handler', () => {
154154 const context = mockDeep < Context > ( ) ;
155155 const callback = jest . fn ( ) ;
156156
157- const result = await patchLetters ( event , context , callback ) ;
157+ const result = await patchLetter ( event , context , callback ) ;
158158
159159 expect ( mockedMapErrorToResponse ) . toHaveBeenCalledWith ( new ValidationError ( errors . ApiErrorDetail . InvalidRequestBody ) , 'correlationId' ) ;
160160 expect ( result ) . toEqual ( expectedErrorResponse ) ;
@@ -170,7 +170,7 @@ describe('patchLetters API Handler', () => {
170170 const context = mockDeep < Context > ( ) ;
171171 const callback = jest . fn ( ) ;
172172
173- const result = await patchLetters ( event , context , callback ) ;
173+ const result = await patchLetter ( event , context , callback ) ;
174174
175175 expect ( mockedMapErrorToResponse ) . toHaveBeenCalledWith ( new ValidationError ( errors . ApiErrorDetail . InvalidRequestBody ) , 'correlationId' ) ;
176176 expect ( result ) . toEqual ( expectedErrorResponse ) ;
@@ -191,7 +191,7 @@ describe('patchLetters API Handler', () => {
191191 throw error ;
192192 } ) ;
193193
194- const result = await patchLetters ( event , context , callback ) ;
194+ const result = await patchLetter ( event , context , callback ) ;
195195
196196 expect ( mockedMapErrorToResponse ) . toHaveBeenCalledWith ( error , 'correlationId' ) ;
197197 expect ( result ) . toEqual ( expectedErrorResponse ) ;
@@ -209,7 +209,7 @@ describe('patchLetters API Handler', () => {
209209 const context = mockDeep < Context > ( ) ;
210210 const callback = jest . fn ( ) ;
211211
212- const result = await patchLetters ( event , context , callback ) ;
212+ const result = await patchLetter ( event , context , callback ) ;
213213
214214 expect ( mockedMapErrorToResponse ) . toHaveBeenCalledWith ( new Error ( "The request headers don't contain the APIM correlation id" ) , undefined ) ;
215215 expect ( result ) . toEqual ( expectedErrorResponse ) ;
@@ -225,7 +225,7 @@ describe('patchLetters API Handler', () => {
225225 const context = mockDeep < Context > ( ) ;
226226 const callback = jest . fn ( ) ;
227227
228- const result = await patchLetters ( event , context , callback ) ;
228+ const result = await patchLetter ( event , context , callback ) ;
229229
230230 expect ( mockedMapErrorToResponse ) . toHaveBeenCalledWith ( new Error ( 'The request headers are empty' ) , undefined ) ;
231231 expect ( result ) . toEqual ( expectedErrorResponse ) ;
0 commit comments