btrz-api-client 8.65.0 → 8.66.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslint-report.json +1 -0
- package/.eslintignore +2 -0
- package/fetch-test.js +5 -6
- package/index.js +2 -2
- package/lib/client-standalone-min.js +3 -3
- package/lib/client.js +50 -38
- package/lib/endpoints/accounts/journey-prices-settings.js +2 -2
- package/lib/endpoints/accounts/market-pricing-settings.js +3 -3
- package/lib/endpoints/accounts/multiproduct-sales-settings.js +6 -2
- package/lib/endpoints/accounts/operation-settings.js +3 -1
- package/lib/endpoints/btrzpay/referenced-payments.js +6 -2
- package/lib/endpoints/btrzpay/square.js +12 -3
- package/lib/endpoints/btrzpay/stripe-terminals.js +9 -3
- package/lib/endpoints/btrzpay/terminalPayments.js +14 -4
- package/lib/endpoints/inventory/document-types.js +2 -1
- package/lib/endpoints/inventory/products.js +1 -0
- package/lib/endpoints/operations/movements.js +7 -2
- package/lib/endpoints/operations/pago-express.js +9 -3
- package/lib/endpoints/operations/parcels.js +3 -1
- package/lib/endpoints/sales/cancellations.js +31 -8
- package/package.json +6 -8
- package/src/client.js +0 -1
- package/src/endpoints/accounts/journey-prices-settings.js +2 -2
- package/src/endpoints/accounts/market-pricing-settings.js +3 -3
- package/src/endpoints/accounts/multiproduct-sales-settings.js +6 -2
- package/src/endpoints/accounts/operation-settings.js +3 -1
- package/src/endpoints/btrzpay/referenced-payments.js +6 -2
- package/src/endpoints/btrzpay/square.js +12 -3
- package/src/endpoints/btrzpay/stripe-terminals.js +9 -3
- package/src/endpoints/btrzpay/terminalPayments.js +14 -4
- package/src/endpoints/inventory/document-types.js +2 -1
- package/src/endpoints/inventory/products.js +1 -0
- package/src/endpoints/operations/movements.js +7 -2
- package/src/endpoints/operations/pago-express.js +9 -3
- package/src/endpoints/operations/parcels.js +3 -1
- package/src/endpoints/sales/cancellations.js +31 -8
- package/test/all.test.js +218 -0
- package/test/client.test.js +58 -44
- package/test/endpoints/accounts/application-settings.test.js +2 -2
- package/test/endpoints/accounts/applications.test.js +2 -2
- package/test/endpoints/accounts/current-shifts.test.js +2 -2
- package/test/endpoints/accounts/customers.js +17 -17
- package/test/endpoints/accounts/domains.test.js +6 -8
- package/test/endpoints/accounts/exchange-rates.test.js +3 -3
- package/test/endpoints/accounts/exchange-receipts.test.js +3 -3
- package/test/endpoints/accounts/images.test.js +2 -2
- package/test/endpoints/accounts/interline.test.js +10 -12
- package/test/endpoints/accounts/network.test.js +3 -5
- package/test/endpoints/accounts/people-lookups.test.js +13 -13
- package/test/endpoints/accounts/print-templates.test.js +3 -3
- package/test/endpoints/accounts/printers.test.js +2 -2
- package/test/endpoints/accounts/tokens.js +2 -2
- package/test/endpoints/accounts/trusted-machines.test.js +2 -2
- package/test/endpoints/accounts/websales-config.test.js +47 -50
- package/test/endpoints/btrzpay/carpointe.tests.js +2 -2
- package/test/endpoints/btrzpay/datalogicPayments.tests.js +2 -2
- package/test/endpoints/btrzpay/datalogicReferenceNumber.tests.js +2 -2
- package/test/endpoints/btrzpay/oxxoPayments.tests.js +2 -2
- package/test/endpoints/btrzpay/oxxoToken.tests.js +2 -2
- package/test/endpoints/btrzpay/payment-methods.test.js +3 -3
- package/test/endpoints/btrzpay/payments.tests.js +6 -6
- package/test/endpoints/btrzpay/reference-numbers.test.js +5 -5
- package/test/endpoints/btrzpay/referenced-payments.test.js +2 -2
- package/test/endpoints/btrzpay/square.tests.js +2 -2
- package/test/endpoints/btrzpay/terminalPayments.tests.js +2 -2
- package/test/endpoints/endpoints_helpers.test.js +28 -24
- package/test/endpoints/inventory/amenities.test.js +20 -20
- package/test/endpoints/inventory/amenity-groups.test.js +15 -15
- package/test/endpoints/inventory/bare-routes.test.js +2 -2
- package/test/endpoints/inventory/brands.test.js +9 -9
- package/test/endpoints/inventory/bundle-fares.test.js +10 -11
- package/test/endpoints/inventory/bundles.test.js +9 -9
- package/test/endpoints/inventory/companies.test.js +6 -6
- package/test/endpoints/inventory/custom-content.test.js +4 -4
- package/test/endpoints/inventory/custom-fields.test.js +2 -2
- package/test/endpoints/inventory/document-types.test.js +2 -2
- package/test/endpoints/inventory/fare-classes.test.js +10 -10
- package/test/endpoints/inventory/fares.test.js +14 -16
- package/test/endpoints/inventory/fees.test.js +14 -15
- package/test/endpoints/inventory/filtered-trips-v2.test.js +5 -5
- package/test/endpoints/inventory/insurances.test.js +2 -2
- package/test/endpoints/inventory/insurancesCost.test.js +2 -2
- package/test/endpoints/inventory/journey-prices.test.js +13 -15
- package/test/endpoints/inventory/labels.test.js +2 -2
- package/test/endpoints/inventory/marital-status.test.js +2 -2
- package/test/endpoints/inventory/mit-terminal-settings.test.js +2 -2
- package/test/endpoints/inventory/mit-terminals.test.js +7 -7
- package/test/endpoints/inventory/operating-companies.test.js +14 -14
- package/test/endpoints/inventory/operation-messages.test.js +10 -10
- package/test/endpoints/inventory/parcel-zones.test.js +12 -13
- package/test/endpoints/inventory/payment-terminals.test.js +7 -7
- package/test/endpoints/inventory/prisma-terminals.test.js +2 -2
- package/test/endpoints/inventory/products.test.js +25 -20
- package/test/endpoints/inventory/promos.test.js +50 -50
- package/test/endpoints/inventory/seatclasses.test.js +2 -2
- package/test/endpoints/inventory/seatfees.test.js +6 -6
- package/test/endpoints/inventory/seatmaps.test.js +7 -7
- package/test/endpoints/inventory/segments-information.test.js +2 -2
- package/test/endpoints/inventory/service-numbers.test.js +6 -6
- package/test/endpoints/inventory/service-types.test.js +7 -7
- package/test/endpoints/inventory/shift-settings.test.js +2 -2
- package/test/endpoints/inventory/ssrs.test.js +10 -11
- package/test/endpoints/inventory/stations-zones.test.js +8 -9
- package/test/endpoints/inventory/stations.test.js +2 -2
- package/test/endpoints/inventory/travel-routes.test.js +2 -2
- package/test/endpoints/inventory/traveller-car-types.test.js +8 -8
- package/test/endpoints/inventory/traveller-card-providers-types.test.js +2 -2
- package/test/endpoints/inventory/traveller-card-providers.test.js +7 -7
- package/test/endpoints/inventory/vehicles.test.js +2 -2
- package/test/endpoints/inventory/zone-price-overages.test.js +2 -2
- package/test/endpoints/inventory/zone-prices.test.js +2 -2
- package/test/endpoints/invoices/dlink.test.js +2 -2
- package/test/endpoints/invoices/gti.test.js +2 -2
- package/test/endpoints/invoices/infile.test.js +2 -2
- package/test/endpoints/invoices/infileJson.test.js +2 -2
- package/test/endpoints/invoices/providers.test.js +4 -4
- package/test/endpoints/invoices/providersSequences.test.js +2 -2
- package/test/endpoints/invoices/system.test.js +2 -2
- package/test/endpoints/loyalty/movements.test.js +11 -11
- package/test/endpoints/loyalty/programs.test.js +21 -21
- package/test/endpoints/notifications/customers.test.js +6 -6
- package/test/endpoints/notifications/external-customers.test.js +10 -10
- package/test/endpoints/notifications/manifet-notifications.test.js +3 -3
- package/test/endpoints/notifications/notify.test.js +5 -5
- package/test/endpoints/notifications/orders-rules-validations.test.js +5 -6
- package/test/endpoints/notifications/pdfs.test.js +4 -4
- package/test/endpoints/notifications/printed-tickets.test.js +17 -18
- package/test/endpoints/notifications/short-urls.test.js +9 -9
- package/test/endpoints/operations/applied_insurance.test.js +10 -14
- package/test/endpoints/operations/calendar_entries.test.js +8 -9
- package/test/endpoints/operations/cancellation_settings.test.js +2 -2
- package/test/endpoints/operations/loans.test.js +2 -2
- package/test/endpoints/operations/manifest.test.js +11 -9
- package/test/endpoints/operations/operations.test.js +42 -25
- package/test/endpoints/operations/parcel_manifests.test.js +3 -3
- package/test/endpoints/operations/parcels.test.js +27 -22
- package/test/endpoints/operations/passenger_check_in_info.test.js +2 -2
- package/test/endpoints/operations/redemption.test.js +2 -2
- package/test/endpoints/operations/sold-items-fulfillment.test.js +2 -2
- package/test/endpoints/operations/sold_items.test.js +3 -3
- package/test/endpoints/operations/tickets.test.js +4 -4
- package/test/endpoints/operations/transaction.test.js +12 -15
- package/test/endpoints/operations/transactions.test.js +11 -11
- package/test/endpoints/operations/transport_regulations.js +2 -4
- package/test/endpoints/operations/trip_change_info.test.js +9 -10
- package/test/endpoints/operations/vehicle-assignments.test.js +5 -7
- package/test/endpoints/operations/waitlists.test.js +3 -3
- package/test/endpoints/ratality/auth.test.js +5 -5
- package/test/endpoints/ratality/client.test.js +4 -4
- package/test/endpoints/ratality/integrations.test.js +15 -9
- package/test/endpoints/reports/custom-reports.test.js +12 -12
- package/test/endpoints/reports/email.test.js +3 -3
- package/test/endpoints/reports/report-types.test.js +6 -6
- package/test/endpoints/reports/trip-manifests.test.js +5 -6
- package/test/endpoints/sales/bundles.test.js +9 -10
- package/test/endpoints/sales/cart-promo.test.js +15 -16
- package/test/endpoints/sales/cart.test.js +7 -7
- package/test/endpoints/sales/check-in-info.test.js +3 -3
- package/test/endpoints/sales/custom-fields.test.js +10 -13
- package/test/endpoints/sales/flexpasses.test.js +2 -2
- package/test/endpoints/sales/git-certificates.test.js +10 -13
- package/test/endpoints/sales/order.test.js +19 -21
- package/test/endpoints/sales/payment-providers.test.js +14 -15
- package/test/endpoints/sales/redeemable-items.test.js +14 -15
- package/test/endpoints/sales/sync-entry.test.js +9 -11
- package/test/endpoints/sales/voucher.test.js +19 -17
- package/test/endpoints/seatmaps/access-ticket.test.js +6 -6
- package/test/endpoints/seatmaps/seat.test.js +6 -6
- package/test/endpoints/uploads/files.test.js +8 -7
- package/test/endpoints/uploads/images.test.js +8 -7
- package/test/endpoints/webhooks/subscriptions.test.js +27 -27
- package/test/endpoints/webhooks/undelivered.test.js +22 -22
- package/test/endpoints/webhooks/webhooks.test.js +7 -7
- package/test/node-test-globals.js +19 -0
- package/test/test-helpers.js +4 -4
- package/test-integration/all.test.js +63 -0
- package/test-integration/endpoints/accounts/current-shifts.test.js +4 -4
- package/test-integration/endpoints/accounts/docs.test.js +6 -6
- package/test-integration/endpoints/accounts/lexicons.test.js +42 -37
- package/test-integration/endpoints/accounts/shifts.test.js +5 -8
- package/test-integration/endpoints/accounts/users.test.js +4 -4
- package/test-integration/endpoints/btrzpay/customerCards.test.js +24 -48
- package/test-integration/endpoints/btrzpay/customers.test.js +20 -34
- package/test-integration/endpoints/btrzpay/payment-methods.test.js +34 -34
- package/test-integration/endpoints/btrzpay/payments.test.js +21 -21
- package/test-integration/endpoints/btrzpay/reference-numbers.test.js +15 -15
- package/test-integration/endpoints/btrzpay/referenced-payments.test.js +5 -5
- package/test-integration/endpoints/client.test.js +6 -10
- package/test-integration/endpoints/inventory/amenities.test.js +34 -34
- package/test-integration/endpoints/inventory/amenity-groups.test.js +30 -31
- package/test-integration/endpoints/inventory/bundle-fares.test.js +10 -12
- package/test-integration/endpoints/inventory/companies.test.js +7 -8
- package/test-integration/endpoints/inventory/countries.test.js +10 -12
- package/test-integration/endpoints/inventory/custom-fields.test.js +2 -2
- package/test-integration/endpoints/inventory/docs.test.js +5 -7
- package/test-integration/endpoints/inventory/fare-classes.test.js +12 -13
- package/test-integration/endpoints/inventory/fares.test.js +7 -9
- package/test-integration/endpoints/inventory/fees.test.js +8 -10
- package/test-integration/endpoints/inventory/filtered-trips.test.js +15 -12
- package/test-integration/endpoints/inventory/gift-certificate-definitions.test.js +5 -5
- package/test-integration/endpoints/inventory/insurances.test.js +36 -34
- package/test-integration/endpoints/inventory/items.js +10 -12
- package/test-integration/endpoints/inventory/journey-prices.test.js +11 -11
- package/test-integration/endpoints/inventory/parcel-zones.test.js +15 -18
- package/test-integration/endpoints/inventory/products.test.js +12 -14
- package/test-integration/endpoints/inventory/promos.test.js +46 -42
- package/test-integration/endpoints/inventory/routes.test.js +13 -15
- package/test-integration/endpoints/inventory/schedule-groups.test.js +23 -23
- package/test-integration/endpoints/inventory/ssrs.test.js +16 -11
- package/test-integration/endpoints/inventory/stations-zones.test.js +5 -6
- package/test-integration/endpoints/inventory/stations.test.js +17 -20
- package/test-integration/endpoints/inventory/trips.test.js +30 -16
- package/test-integration/endpoints/notifications/printed-tickets.test.js +2 -2
- package/test-integration/endpoints/operations/applied_insurance.test.js +9 -11
- package/test-integration/endpoints/operations/manifest.test.js +32 -34
- package/test-integration/endpoints/operations/parcel.test.js +36 -38
- package/test-integration/endpoints/operations/redemption.test.js +9 -12
- package/test-integration/endpoints/operations/segments.js +8 -10
- package/test-integration/endpoints/operations/tickets.test.js +11 -11
- package/test-integration/endpoints/operations/transaction.test.js +1 -1
- package/test-integration/endpoints/operations/transactions.test.js +2 -2
- package/test-integration/endpoints/operations/trip_change_info.test.js +11 -13
- package/test-integration/endpoints/reports/custom-reports.test.js +21 -21
- package/test-integration/endpoints/reports/report-types.test.js +22 -22
- package/test-integration/endpoints/sales/bundles.test.js +5 -5
- package/test-integration/endpoints/sales/cart-promo.test.js +17 -32
- package/test-integration/endpoints/sales/cart.test.js +45 -51
- package/test-integration/endpoints/sales/check-in-info.test.js +2 -2
- package/test-integration/endpoints/sales/custom-fields.test.js +8 -10
- package/test-integration/endpoints/sales/flexpasses.test.js +2 -2
- package/test-integration/endpoints/sales/gift-certificates.test.js +14 -18
- package/test-integration/endpoints/sales/order.test.js +42 -50
- package/test-integration/endpoints/sales/payment-providers.test.js +7 -9
- package/test-integration/endpoints/sales/redeemable-items.test.js +17 -19
- package/test-integration/endpoints/sales/voucher.test.js +12 -14
- package/test-integration/endpoints/seatmaps/access-ticket.test.js +7 -9
- package/test-integration/endpoints/seatmaps/seat.test.js +7 -9
- package/test-integration/endpoints/uploads/files.test.js +14 -14
- package/test-integration/endpoints/uploads/images.test.js +3 -5
- package/test-integration/ports.js +4 -4
- package/test-integration/test-integration-helpers.js +13 -9
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
|
-
describe(
|
|
5
|
-
const token =
|
|
4
|
+
describe("inventory/stations/zones", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
6
|
|
|
7
|
-
afterEach(
|
|
7
|
+
afterEach(() => {
|
|
8
8
|
axiosMock.reset();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
it("should list zones",
|
|
12
|
-
axiosMock.onGet(
|
|
13
|
-
return api.inventory.stationsZones.get({
|
|
11
|
+
it("should list zones", () => {
|
|
12
|
+
axiosMock.onGet("/stations/zones").reply(expectRequest({statusCode: 200, token}));
|
|
13
|
+
return api.inventory.stationsZones.get({token});
|
|
14
14
|
});
|
|
15
|
-
|
|
16
15
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("inventory/stations", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
describe("inventory/travel-routes", () => {
|
|
2
2
|
const {
|
|
3
3
|
axiosMock, expectRequest
|
|
4
|
-
} = require("./../../test-helpers");
|
|
5
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
4
|
+
} = require("./../../test-helpers.js");
|
|
5
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
6
6
|
|
|
7
7
|
const token = "I owe you a token";
|
|
8
8
|
const jwtToken = "I owe you a JWT token";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("inventory/traveller-card-types", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -10,14 +10,14 @@ describe("inventory/traveller-card-types", () => {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it("should list Traveller Card Types", () => {
|
|
13
|
-
axiosMock.onGet("/traveller-card-types").reply(expectRequest({
|
|
14
|
-
return api.inventory.travellerCardTypes.all({
|
|
13
|
+
axiosMock.onGet("/traveller-card-types").reply(expectRequest({statusCode: 200, token}));
|
|
14
|
+
return api.inventory.travellerCardTypes.all({token});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
it("should get an Traveller Card Types", () => {
|
|
19
19
|
const travellerCardTypeId = "5ad7804216b426412c19f06f";
|
|
20
|
-
axiosMock.onGet(`/traveller-card-types/${travellerCardTypeId}`).reply(expectRequest({
|
|
20
|
+
axiosMock.onGet(`/traveller-card-types/${travellerCardTypeId}`).reply(expectRequest({statusCode: 200, token}));
|
|
21
21
|
return api.inventory.travellerCardTypes.get({
|
|
22
22
|
token,
|
|
23
23
|
travellerCardTypeId
|
|
@@ -25,7 +25,7 @@ describe("inventory/traveller-card-types", () => {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
it("should create a Traveller Card Types", () => {
|
|
28
|
-
axiosMock.onPost("/traveller-card-types").reply(expectRequest({
|
|
28
|
+
axiosMock.onPost("/traveller-card-types").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
29
29
|
return api.inventory.travellerCardTypes.create({
|
|
30
30
|
jwtToken,
|
|
31
31
|
token,
|
|
@@ -38,7 +38,7 @@ describe("inventory/traveller-card-types", () => {
|
|
|
38
38
|
|
|
39
39
|
it("should update a Traveller Card Types", () => {
|
|
40
40
|
const travellerCardTypeId = "5ad7804216b426412c19f06f";
|
|
41
|
-
axiosMock.onPut(`/traveller-card-types/${travellerCardTypeId}`).reply(expectRequest({
|
|
41
|
+
axiosMock.onPut(`/traveller-card-types/${travellerCardTypeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
42
42
|
return api.inventory.travellerCardTypes.update({
|
|
43
43
|
jwtToken,
|
|
44
44
|
token,
|
|
@@ -51,7 +51,7 @@ describe("inventory/traveller-card-types", () => {
|
|
|
51
51
|
|
|
52
52
|
it("should remove an Traveller Card Types", () => {
|
|
53
53
|
const travellerCardTypeId = "5ad7804216b426412c19f06f";
|
|
54
|
-
axiosMock.onDelete(`/traveller-card-types/${travellerCardTypeId}`).reply(expectRequest({
|
|
54
|
+
axiosMock.onDelete(`/traveller-card-types/${travellerCardTypeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
55
55
|
return api.inventory.travellerCardTypes.remove({
|
|
56
56
|
token,
|
|
57
57
|
travellerCardTypeId,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable import/extensions */
|
|
2
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
3
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
2
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
3
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
4
4
|
|
|
5
5
|
describe("inventory/traveller-card-providers-types", () => {
|
|
6
6
|
const token = "I owe you a token";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("inventory/traveller-card-providers", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -10,14 +10,14 @@ describe("inventory/traveller-card-providers", () => {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it("should list Traveller Card Providerss", () => {
|
|
13
|
-
axiosMock.onGet("/traveller-card-providers").reply(expectRequest({
|
|
14
|
-
return api.inventory.travellerCardProviders.all({
|
|
13
|
+
axiosMock.onGet("/traveller-card-providers").reply(expectRequest({statusCode: 200, token}));
|
|
14
|
+
return api.inventory.travellerCardProviders.all({token});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
it("should get an Traveller Card Providers", () => {
|
|
19
19
|
const travellerCardProviderId = "5ad7804216b426412c19f06f";
|
|
20
|
-
axiosMock.onGet(`/traveller-card-providers/${travellerCardProviderId}`).reply(expectRequest({
|
|
20
|
+
axiosMock.onGet(`/traveller-card-providers/${travellerCardProviderId}`).reply(expectRequest({statusCode: 200, token}));
|
|
21
21
|
return api.inventory.travellerCardProviders.get({
|
|
22
22
|
token,
|
|
23
23
|
travellerCardProviderId
|
|
@@ -25,7 +25,7 @@ describe("inventory/traveller-card-providers", () => {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
it("should create a Traveller Card Providers", () => {
|
|
28
|
-
axiosMock.onPost("/traveller-card-providers").reply(expectRequest({
|
|
28
|
+
axiosMock.onPost("/traveller-card-providers").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
29
29
|
return api.inventory.travellerCardProviders.create({
|
|
30
30
|
jwtToken,
|
|
31
31
|
token,
|
|
@@ -38,7 +38,7 @@ describe("inventory/traveller-card-providers", () => {
|
|
|
38
38
|
|
|
39
39
|
it("should update a Traveller Card Providers", () => {
|
|
40
40
|
const travellerCardProviderId = "5ad7804216b426412c19f06f";
|
|
41
|
-
axiosMock.onPut(`/traveller-card-providers/${travellerCardProviderId}`).reply(expectRequest({
|
|
41
|
+
axiosMock.onPut(`/traveller-card-providers/${travellerCardProviderId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
42
42
|
return api.inventory.travellerCardProviders.update({
|
|
43
43
|
jwtToken,
|
|
44
44
|
token,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const {
|
|
2
2
|
axiosMock, expectRequest
|
|
3
|
-
} = require("./../../test-helpers");
|
|
4
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
} = require("./../../test-helpers.js");
|
|
4
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
5
5
|
|
|
6
6
|
describe("inventory/vehicles", () => {
|
|
7
7
|
const token = "I owe you a token";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const {
|
|
2
2
|
axiosMock, expectRequest
|
|
3
|
-
} = require("./../../test-helpers");
|
|
4
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
} = require("./../../test-helpers.js");
|
|
4
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
5
5
|
|
|
6
6
|
describe("inventory/zone-price-overages", () => {
|
|
7
7
|
const token = "I owe you a token";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const {
|
|
2
2
|
axiosMock, expectRequest
|
|
3
|
-
} = require("./../../test-helpers");
|
|
4
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
} = require("./../../test-helpers.js");
|
|
4
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
5
5
|
|
|
6
6
|
describe("inventory/zone-prices", () => {
|
|
7
7
|
const token = "I owe you a token";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("invoices/dlink", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("../../test-helpers");
|
|
2
|
-
const api = require("../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
1
|
+
const {axiosMock, expectRequest} = require("../../test-helpers.js");
|
|
2
|
+
const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("invoices/gti", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("invoices/infile", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("invoices/infileJson", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("invoices/providers", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -19,8 +19,8 @@ describe("invoices/providers", () => {
|
|
|
19
19
|
const id = "12312312312312";
|
|
20
20
|
axiosMock.onGet(`/providers/${id}`)
|
|
21
21
|
.reply(expectRequest({
|
|
22
|
-
statusCode: 200,
|
|
23
|
-
token,
|
|
22
|
+
statusCode: 200,
|
|
23
|
+
token,
|
|
24
24
|
jwtToken
|
|
25
25
|
}));
|
|
26
26
|
return api.invoices.providers.get({token, jwtToken, query: {}, id});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("invoices/providers/{invoiceProviderId}/sequences", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("invoices/system", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("loyalty/programs/:programId/movements", () => {
|
|
5
|
-
const token =
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
|
+
const programId = "abcf-2659-12sdf-12345";
|
|
8
8
|
|
|
9
|
-
afterEach(
|
|
9
|
+
afterEach(() => {
|
|
10
10
|
axiosMock.restore();
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
it("should list movements", () => {
|
|
14
|
-
axiosMock.onGet(`/programs/${programId}/movements`).reply(expectRequest({
|
|
14
|
+
axiosMock.onGet(`/programs/${programId}/movements`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
15
15
|
return api.loyalty.movements.all({token, jwtToken, programId});
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
it("should create a movement",
|
|
19
|
-
axiosMock.onPost(`/programs/${programId}/movements`).reply(expectRequest({
|
|
20
|
-
return api.loyalty.movements.create({
|
|
18
|
+
it("should create a movement", () => {
|
|
19
|
+
axiosMock.onPost(`/programs/${programId}/movements`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
20
|
+
return api.loyalty.movements.create({jwtToken, token, programId, movement: {amount: 1234}});
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
it("should get the current balance", () => {
|
|
24
24
|
const customerId = "5beaec044fe897f24b000001";
|
|
25
|
-
axiosMock.onGet(`/programs/${programId}/movements/balance/${customerId}`).reply(expectRequest({
|
|
25
|
+
axiosMock.onGet(`/programs/${programId}/movements/balance/${customerId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
26
26
|
return api.loyalty.movements.balance.get({token, jwtToken, programId, customerId});
|
|
27
27
|
});
|
|
28
28
|
});
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
4
|
describe("loyalty/programs", () => {
|
|
5
|
-
const token =
|
|
6
|
-
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
7
|
|
|
8
|
-
afterEach(
|
|
8
|
+
afterEach(() => {
|
|
9
9
|
axiosMock.restore();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it("should list programs", () => {
|
|
13
|
-
axiosMock.onGet("/programs").reply(expectRequest({
|
|
14
|
-
return api.loyalty.programs.all({token, jwtToken})
|
|
13
|
+
axiosMock.onGet("/programs").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
14
|
+
return api.loyalty.programs.all({token, jwtToken});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
it("should create a program", () => {
|
|
18
|
-
axiosMock.onPost(
|
|
18
|
+
axiosMock.onPost("/programs").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
19
19
|
return api.loyalty.programs.create({
|
|
20
20
|
jwtToken,
|
|
21
21
|
token,
|
|
@@ -31,18 +31,18 @@ describe("loyalty/programs", () => {
|
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
it("should PUT a program",
|
|
35
|
-
const programId = "123123123123"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
axiosMock.onPut(`/programs/${programId}`).reply(expectRequest({
|
|
46
|
-
return api.loyalty.programs.put({
|
|
34
|
+
it("should PUT a program", () => {
|
|
35
|
+
const programId = "123123123123";
|
|
36
|
+
const program = {
|
|
37
|
+
accumulateOn: "redemption",
|
|
38
|
+
disabled: false,
|
|
39
|
+
expirationDays: 20,
|
|
40
|
+
name: "An updated program",
|
|
41
|
+
terms: "Updated Loyalty program terms",
|
|
42
|
+
paymentMethods: ["cash"],
|
|
43
|
+
products: ["123123123"]
|
|
44
|
+
};
|
|
45
|
+
axiosMock.onPut(`/programs/${programId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
46
|
+
return api.loyalty.programs.put({jwtToken, token, programId, program});
|
|
47
47
|
});
|
|
48
48
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const assert = require("node:assert/strict");
|
|
2
2
|
const {axiosMock} = require("./../../test-helpers.js");
|
|
3
3
|
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
4
4
|
|
|
@@ -14,8 +14,8 @@ describe("notifications/customers", () => {
|
|
|
14
14
|
};
|
|
15
15
|
it("Should POST a reset email", () => {
|
|
16
16
|
axiosMock.onPost("/customers/reset").reply((config) => {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
assert.deepStrictEqual(config.params, query);
|
|
18
|
+
assert.deepStrictEqual(config.headers.authorization, `Bearer ${jwtToken}`);
|
|
19
19
|
const response = {
|
|
20
20
|
email: query.email
|
|
21
21
|
};
|
|
@@ -38,9 +38,9 @@ describe("notifications/customers", () => {
|
|
|
38
38
|
};
|
|
39
39
|
it("Should POST a activation email", () => {
|
|
40
40
|
axiosMock.onPost("/customers/activation").reply((config) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
assert.deepStrictEqual(config.params, query);
|
|
42
|
+
assert.deepStrictEqual(config.data, JSON.stringify(body));
|
|
43
|
+
assert.deepStrictEqual(config.headers["x-api-key"], token);
|
|
44
44
|
return [200];
|
|
45
45
|
});
|
|
46
46
|
return api.notifications.customers.sendActivationEmail({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const assert = require("node:assert/strict");
|
|
2
2
|
const {axiosMock} = require("./../../test-helpers.js");
|
|
3
3
|
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
4
4
|
|
|
@@ -13,9 +13,9 @@ describe("notifications/external-customers", () => {
|
|
|
13
13
|
it("should POST to request Saldo Max verification code (ado/registration)", () => {
|
|
14
14
|
const data = {email: "user@example.com"};
|
|
15
15
|
axiosMock.onPost("/external-customers/ado/registration").reply((config) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
assert.deepStrictEqual(config.data, JSON.stringify(data));
|
|
17
|
+
assert.deepStrictEqual(config.headers["x-api-key"], token);
|
|
18
|
+
assert.deepStrictEqual(config.headers.authorization, `Bearer ${jwtToken}`);
|
|
19
19
|
return [200, {code: "success", message: "Registration successful"}];
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -24,16 +24,16 @@ describe("notifications/external-customers", () => {
|
|
|
24
24
|
jwtToken,
|
|
25
25
|
data
|
|
26
26
|
}).then((res) => {
|
|
27
|
-
|
|
27
|
+
assert.deepStrictEqual(res.data, {code: "success", message: "Registration successful"});
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
it("should POST Saldo Max statement email (ado/external-wallets/:walletId/statements)", () => {
|
|
32
32
|
const walletId = "15154";
|
|
33
33
|
axiosMock.onPost(`/external-customers/ado/external-wallets/${walletId}/statements`).reply((config) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
assert.deepStrictEqual(config.data, JSON.stringify({}));
|
|
35
|
+
assert.deepStrictEqual(config.headers["x-api-key"], token);
|
|
36
|
+
assert.deepStrictEqual(config.headers.authorization, `Bearer ${jwtToken}`);
|
|
37
37
|
return [200, {success: true}];
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ describe("notifications/external-customers", () => {
|
|
|
42
42
|
jwtToken,
|
|
43
43
|
walletId
|
|
44
44
|
}).then((res) => {
|
|
45
|
-
|
|
45
|
+
assert.deepStrictEqual(res.data, {success: true});
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -55,7 +55,7 @@ describe("notifications/external-customers", () => {
|
|
|
55
55
|
jwtToken,
|
|
56
56
|
walletId
|
|
57
57
|
}).then((res) => {
|
|
58
|
-
|
|
58
|
+
assert.deepStrictEqual(res.data.success, true);
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const {
|
|
2
2
|
axiosMock,
|
|
3
3
|
expectRequest
|
|
4
|
-
} = require("./../../test-helpers");
|
|
5
|
-
const api = require("./../../../src/client").createApiClient({
|
|
4
|
+
} = require("./../../test-helpers.js");
|
|
5
|
+
const api = require("./../../../src/client.js").createApiClient({
|
|
6
6
|
baseURL: "http://test.com"
|
|
7
7
|
});
|
|
8
8
|
|
|
@@ -35,6 +35,6 @@ describe("notifications/manifest-notifications", () => {
|
|
|
35
35
|
.reply(expectRequest({
|
|
36
36
|
statusCode: 200, token
|
|
37
37
|
}));
|
|
38
|
-
return api.notifications.manifestNotifications.all({token
|
|
38
|
+
return api.notifications.manifestNotifications.all({token});
|
|
39
39
|
});
|
|
40
40
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const assert = require("node:assert/strict");
|
|
2
2
|
const {axiosMock} = require("../../test-helpers.js");
|
|
3
3
|
const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
4
4
|
|
|
@@ -129,8 +129,8 @@ describe("notifications/notify/email", () => {
|
|
|
129
129
|
itemId: "507f1f77bcf86cd799439011"
|
|
130
130
|
}
|
|
131
131
|
}).then((res) => {
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
assert.deepStrictEqual(res.status, 200);
|
|
133
|
+
assert.deepStrictEqual(res.data.success, true);
|
|
134
134
|
});
|
|
135
135
|
});
|
|
136
136
|
});
|
|
@@ -162,8 +162,8 @@ describe("notifications/notify/sms", () => {
|
|
|
162
162
|
itemId: "507f1f77bcf86cd799439011"
|
|
163
163
|
}
|
|
164
164
|
}).then((res) => {
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
assert.deepStrictEqual(res.status, 200);
|
|
166
|
+
assert.deepStrictEqual(res.data.success, true);
|
|
167
167
|
});
|
|
168
168
|
});
|
|
169
169
|
});
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
const {
|
|
2
2
|
axiosMock
|
|
3
|
-
} = require("./../../test-helpers");
|
|
4
|
-
const api = require("./../../../src/client").createApiClient({
|
|
3
|
+
} = require("./../../test-helpers.js");
|
|
4
|
+
const api = require("./../../../src/client.js").createApiClient({
|
|
5
5
|
baseURL: "http://test.com"
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
describe("notifications/orders-rules-validations", () => {
|
|
9
9
|
const token = "my-api-key";
|
|
10
|
-
const jwtToken = "my-jwt";
|
|
11
10
|
|
|
12
11
|
afterEach(() => {
|
|
13
12
|
axiosMock.reset();
|
|
14
13
|
});
|
|
15
14
|
|
|
16
15
|
it("should post an orders rules validations", () => {
|
|
17
|
-
axiosMock.onPost("/orders-rules-validations").reply((
|
|
18
|
-
|
|
16
|
+
axiosMock.onPost("/orders-rules-validations").reply(() => {
|
|
17
|
+
return [200];
|
|
19
18
|
});
|
|
20
19
|
return api.notifications.ordersRulesValidations.create({
|
|
21
|
-
token,
|
|
20
|
+
token,
|
|
22
21
|
orderRulesValidation: {
|
|
23
22
|
rules: {}, facts: {}
|
|
24
23
|
}
|
|
@@ -349,11 +349,11 @@ describe("notifications/pdfs", () => {
|
|
|
349
349
|
type: "manualTickets"
|
|
350
350
|
};
|
|
351
351
|
axiosMock.onGet(`/pdf-manual-tickets/${itemId}`)
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
.reply(expectRequest({
|
|
353
|
+
statusCode: 200, token
|
|
354
|
+
}));
|
|
355
355
|
return api.notifications.pdfs.get({
|
|
356
356
|
token, query, itemId
|
|
357
357
|
});
|
|
358
|
-
})
|
|
358
|
+
});
|
|
359
359
|
});
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
|
-
describe(
|
|
5
|
-
const token = "my-api-key"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
afterEach(
|
|
4
|
+
describe("notifications/printed-tickets", () => {
|
|
5
|
+
const token = "my-api-key";
|
|
6
|
+
const jwtToken = "my-token";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
9
|
axiosMock.reset();
|
|
10
|
-
})
|
|
10
|
+
});
|
|
11
11
|
|
|
12
|
-
it("should return the tickets to print",
|
|
12
|
+
it("should return the tickets to print", () => {
|
|
13
13
|
const trxId = "transactionId1";
|
|
14
|
-
axiosMock.onGet(
|
|
15
|
-
return api.notifications.printedTickets.get({
|
|
14
|
+
axiosMock.onGet("/printed-tickets").reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
return api.notifications.printedTickets.get({token, jwtToken, trxId});
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
it("should return the tickets to print with custom responseType",
|
|
19
|
-
const trxId = "transactionId1"
|
|
20
|
-
|
|
21
|
-
axiosMock.onGet(
|
|
22
|
-
return api.notifications.printedTickets.get({
|
|
18
|
+
it("should return the tickets to print with custom responseType", () => {
|
|
19
|
+
const trxId = "transactionId1";
|
|
20
|
+
const responseType = "blob";
|
|
21
|
+
axiosMock.onGet("/printed-tickets").reply(expectRequest({statusCode: 200, token}));
|
|
22
|
+
return api.notifications.printedTickets.get({token, jwtToken, trxId, responseType});
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
});
|
|
24
|
+
});
|