-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "null" in Ctry, Street and address #64
Conversation
Hi @FreedomNX , do you think you can add a test to fix that the behavior for the future? There are already some examples with XPath expressions which you can adapt to your needs. |
I did. |
lib/sepa.js
Outdated
@@ -598,7 +598,11 @@ | |||
|
|||
if (this[pullFrom + 'Street'] && this[pullFrom + 'City'] && this[pullFrom + 'Country']) { | |||
var pstl = n(reciever, 'PstlAdr'); | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like an incomplete merge. Can you resolve this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups, i fixed it.
@lippertto Thanks for taking an initial look! Would you like to go ahead and complete the review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests. I have just some minor comments on the test setup. If you have time, it would be great if you could improve the test helpers.
lib/sepa.test.js
Outdated
|
||
test('ctry and address field not null', () => { | ||
// GIVEN | ||
const doc = validTransferDocument({debtorId: 'FR72ZZZ123456', debtorName: 'debtor-name'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove debtorId
and debtorName
here? The values are not relevant to the behavior.
I.e. write validTransferDocument({})
lib/sepa.test.js
Outdated
// GIVEN | ||
const doc = validTransferDocument({debtorId: 'FR72ZZZ123456', debtorName: 'debtor-name'}); | ||
|
||
let info = doc._paymentInfo[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you extend the functions validTransferDocument
and addTransaction
to take the debtor and creditor values. This will make the test a bit more concise but more importantly will avoid using the private fields _paymentInfo
and _payments
.
lib/sepa.test.js
Outdated
@@ -51,13 +59,22 @@ describe('xml generation for transfer documents', () => { | |||
info.debtorId = debtorId; | |||
info.requestedExecutionDate = new Date(); | |||
|
|||
if(debtorCountry) info.debtorCountry = debtorCountry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if statements are not necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@kewisch , the PR looks good for me. Can you run the pipeline and merge the branch? |
@kewisch - any thoughts on the PR? 😃 |
Friendly reminder @kewisch |
Thanks for the review, much appreciated! I've been off the past week, apologies for the delay. |
Fix error "null" in Ctry, Street and Address for Credit.