@vergelijkdirect/insurance-transmission-client
v1.3.38
Published
Usage:
Downloads
235
Keywords
Readme
insurance-transmission-client
Usage:
import InsuranceTransmissionClient from './clients/insurance-transmission.client';
import LocalStorageAdapter from './adapters/local-storage.adapter';
const storage = new LocalStorageAdapter('insurances');
const client = new InsuranceTransmissionClient(storage);
let rate = client.save('moped', {
'Premium':20,
'CompanyName': 'Unigarant'
}).get('moped').first();
const summary = {
"Name": "Test",
"Initials": "B",
"NameInfix": "string",
"Gender": "M",
"Birthdate": "2000-01-01",
"Email": "[email protected]",
"ZipCode": "0000xx",
"HouseNumber": 0,
"HouseNumberAddition": "string",
"IBAN": "NL43ABNA5239941823",
"MobileNumber": "0XXXXXXXXX",
"CustomerId": "string",
"CustomerIdExtern": "string",
};
let url = rate.getPaymentUrl();
let companyName = rate.getCompanyName();
let request = client.getRequest(summary);
client.remove('moped');
console.log(rate, url, companyName, request);
Testing in browser
In some cases we need to test directly from browser as some package as fetch are different. Node has own fetch for example which used as polyfill. So we need to be able sometime to test not only from cli(node) environment but also from browser during development
To test in browser install browserify
npm i -g browserify
Build bundle
npm run browserify --arg=comparison
Open index.html (src/tests/browser) in browser, open console and call function makeItcCall Change code in comparison.webtest.js, change request if needed or create new one in directory (src/tests/browser/requests)
If you changed ITC run compile first
npm run compile and then run
and then run
npm run browserify --arg=comparison
for testing specific test you need to run
npm run test -- api --testNamePattern="VehicleData"