From 7e3cbfc7f2a4d1c6587d7cde13df89c339b91d7b Mon Sep 17 00:00:00 2001 From: Kevin Monisit Date: Fri, 18 Oct 2024 09:59:55 -0400 Subject: [PATCH] Modification to get-buy-ins return format --- src/functions/get-buy-ins/handler.ts | 2 +- tests/get-buy-ins.test.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/functions/get-buy-ins/handler.ts b/src/functions/get-buy-ins/handler.ts index 8d696df..46e9dd6 100644 --- a/src/functions/get-buy-ins/handler.ts +++ b/src/functions/get-buy-ins/handler.ts @@ -44,7 +44,7 @@ const getBuyIns: ValidatedEventAPIGatewayProxyEvent = async (even statusCode: 200, body: JSON.stringify({ statusCode: 200, - ...result, + buyIns: result, }), }; } catch (error) { diff --git a/tests/get-buy-ins.test.ts b/tests/get-buy-ins.test.ts index 811bce8..e958ba8 100644 --- a/tests/get-buy-ins.test.ts +++ b/tests/get-buy-ins.test.ts @@ -50,11 +50,10 @@ describe('get-buy-ins tests', () => { }; const mockEvent = createEvent(userData, path, httpMethod); - const result = await main(mockEvent, mockContext, jest.fn()); expect(result.statusCode).toBe(200); const body = JSON.parse(result.body); - expect(body.prizeA).toBe(30); + expect(body.buyIns.prizeA).toBe(30); }); });