Skip to content

Commit

Permalink
test: 💍 add cases for null trade/value dates
Browse files Browse the repository at this point in the history
  • Loading branch information
polymath-eric committed Dec 5, 2024
1 parent 4c20be3 commit 8a91586
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/api/entities/Instruction/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 8a91586

Please sign in to comment.