[CCFPCM-395] mocks, jest config, added unit tests for entities#99
[CCFPCM-395] mocks, jest config, added unit tests for entities#99chelsea-EYDS merged 9 commits intoCHORE-exceptions-service-refactorfrom
Conversation
01cb8e7 to
c728e68
Compare
fw-noel
left a comment
There was a problem hiding this comment.
Entity specs don't strike me as particularly useful, but I'd love to hear your take on their value.
| } | ||
| return transactions; | ||
| } | ||
| constructor( |
There was a problem hiding this comment.
Constructor at the bottom?
| import { Payment } from './payment_mock'; | ||
| import { BaseData } from '../types/interface'; | ||
| import { PaymentMock } from './payment_mock'; | ||
| import { PaymentEntity } from './../../../src/transaction/entities/payment.entity'; |
There was a problem hiding this comment.
nitpick: for consistency, we can remove ./. TBH I like it better with, but yeah
| this.source_id = program; | ||
| this.location_id = location.location_id; | ||
| this.transaction_date = dateRange.to_date; | ||
| this.transaction_time = '00:00:00'; |
There was a problem hiding this comment.
Any value in randomizing / fakering this?
There was a problem hiding this comment.
They're randomized and using faker, but have a specific set of rules in order for them to be 'reconcile-able'.
ie: if generating random cash deposits and cash transactions/payments to test (happy path) reconciliation then we need to make sure the sum of payments per fiscal_close_date === the deposit_amt_cdn for a deposit date, and also that the payment methods and locations match.
The purpose of the mocks was to avoid writing it out for each unit test, but I am 100% open to suggestions for a better approach :)
It's 90% for coverage, and also for examples in the codebase/regression testing. I thought it would be unlikely for these to change (and if they do change we'd need to make sure the fields used in reconciliation aren't affected or altered) but I'm sure the tests for reconciliation are enough to cover this, I'm happy to remove if you would prefer. |
CCFPCM-0395
Objective: