From 8a915866913ccfbaceca8e1f4e7c56f3989be168 Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Thu, 5 Dec 2024 12:35:05 -0500 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=92=8D=20add=20cases=20for=20null?= =?UTF-8?q?=20trade/value=20dates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entities/Instruction/__tests__/index.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/api/entities/Instruction/__tests__/index.ts b/src/api/entities/Instruction/__tests__/index.ts index e690117296..b31f4acf3d 100644 --- a/src/api/entities/Instruction/__tests__/index.ts +++ b/src/api/entities/Instruction/__tests__/index.ts @@ -521,6 +521,27 @@ describe('Instruction class', () => { expect(result.venue).toBeNull(); expect(result.memo).toBeNull(); + + dsMockUtils.createApolloQueryMock( + instructionsQuery(false, { + id: id.toString(), + }), + { + instructions: { + nodes: [ + { + ...middlewareInstruction, + valueDate: undefined, + tradeDate: undefined, + }, + ], + }, + } + ); + result = await instruction.details(); + + expect(result.tradeDate).toBeNull(); + expect(result.valueDate).toBeNull(); }); it('should throw an error if an Instruction is not yet processed by middleware', () => {