From 3cbdda065cfde3d925c42fb0a30b034a1b4797eb Mon Sep 17 00:00:00 2001 From: JunYanBJSS <144220886+JunYanBJSS@users.noreply.github.com> Date: Tue, 9 Jan 2024 14:34:51 +0000 Subject: [PATCH] feat(cb2-9882): Correct Letter Api to meet the AC of front-end ticket(cb2-9882) (#92) --- src/handler/letter.ts | 4 ++-- tests/unit/handler/letter.unit.test.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/handler/letter.ts b/src/handler/letter.ts index 3c860297..82f8bb51 100644 --- a/src/handler/letter.ts +++ b/src/handler/letter.ts @@ -33,10 +33,10 @@ export const handler = async (event: APIGatewayProxyEvent): Promise { }); }); - it('should error if the record is not current', async () => { - mockGetBySystemNumberAndCreatedTimestamp.mockResolvedValueOnce({ techRecord_statusCode: 'provisional' }); + it('should error if the record is archived', async () => { + mockGetBySystemNumberAndCreatedTimestamp.mockResolvedValueOnce({ techRecord_statusCode: 'archived' }); mockValidateLetterErrors.mockReturnValueOnce(undefined); const res = await handler({ pathParameters: { systemNumber: '123456', createdTimestamp: '12345' } } as unknown as APIGatewayProxyEvent); expect(res).toEqual({ statusCode: 400, - body: 'Tech record provided is not current', + body: 'Tech record provided is archived', headers, }); });