test: add more tests

This commit is contained in:
nanov
2019-11-20 11:12:37 +02:00
parent ddd0933c0b
commit 67d74cfa00
11 changed files with 262 additions and 34 deletions

View File

@@ -51,7 +51,6 @@ module.exports = (xml, keys) => ({
transactionKey() {
const keyNodeText = this.doc.getElementsByTagNameNS('urn:org:ebics:H004', 'TransactionKey')[0].textContent;
return Crypto.privateDecrypt(this.keys.e(), Buffer.from(keyNodeText, 'base64'));
},
@@ -64,7 +63,7 @@ module.exports = (xml, keys) => ({
orderId() {
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
const node = select('//xmlns:header/xmlns:mutable/xmlns:OrderID', this.doc);
const node = select('.//xmlns:header/xmlns:mutable/xmlns:OrderID', this.doc);
return node.length ? node[0].textContent : '';
},