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,18 +1,17 @@
|
|
|
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 =
|
|
6
|
-
const jwtToken =
|
|
4
|
+
describe("operations/trip-change-info", () => {
|
|
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.reset();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
it("should get a trip info to change",
|
|
12
|
+
it("should get a trip info to change", () => {
|
|
13
13
|
const productId = "productId1";
|
|
14
|
-
axiosMock.onGet(`/trip-change-info/${productId}`).reply(expectRequest({
|
|
15
|
-
return api.operations.tripChangeInfo.get({
|
|
14
|
+
axiosMock.onGet(`/trip-change-info/${productId}`).reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
return api.operations.tripChangeInfo.get({token, jwtToken, productId});
|
|
16
16
|
});
|
|
17
|
-
|
|
18
17
|
});
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
expect
|
|
3
|
-
} = require("chai");
|
|
1
|
+
const assert = require("node:assert/strict");
|
|
4
2
|
const {
|
|
5
3
|
axiosMock,
|
|
6
4
|
expectRequest
|
|
@@ -23,7 +21,7 @@ describe("operations/vehicle-assignments", () => {
|
|
|
23
21
|
return api.operations.vehicleAssignments.all({
|
|
24
22
|
token
|
|
25
23
|
}).then((httpResponse) => {
|
|
26
|
-
|
|
24
|
+
assert.deepStrictEqual(httpResponse.status, 200);
|
|
27
25
|
});
|
|
28
26
|
});
|
|
29
27
|
|
|
@@ -38,7 +36,7 @@ describe("operations/vehicle-assignments", () => {
|
|
|
38
36
|
vehicleAssignmentId,
|
|
39
37
|
token
|
|
40
38
|
}).then((httpResponse) => {
|
|
41
|
-
|
|
39
|
+
assert.deepStrictEqual(httpResponse.status, 200);
|
|
42
40
|
});
|
|
43
41
|
});
|
|
44
42
|
|
|
@@ -57,7 +55,7 @@ describe("operations/vehicle-assignments", () => {
|
|
|
57
55
|
jwtToken,
|
|
58
56
|
data
|
|
59
57
|
}).then((httpResponse) => {
|
|
60
|
-
|
|
58
|
+
assert.deepStrictEqual(httpResponse.status, 200);
|
|
61
59
|
});
|
|
62
60
|
});
|
|
63
61
|
|
|
@@ -78,7 +76,7 @@ describe("operations/vehicle-assignments", () => {
|
|
|
78
76
|
jwtToken,
|
|
79
77
|
data
|
|
80
78
|
}).then((httpResponse) => {
|
|
81
|
-
|
|
79
|
+
assert.deepStrictEqual(httpResponse.status, 200);
|
|
82
80
|
});
|
|
83
81
|
});
|
|
84
82
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const {
|
|
2
2
|
axiosMock, expectRequest
|
|
3
|
-
} = require("../../test-helpers");
|
|
4
|
-
const api = require("../../../src/client").createApiClient({
|
|
3
|
+
} = require("../../test-helpers.js");
|
|
4
|
+
const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
5
5
|
|
|
6
6
|
describe("operations/waitlists", () => {
|
|
7
7
|
const token = "I owe you a token";
|
|
@@ -36,7 +36,7 @@ describe("operations/waitlists", () => {
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
it("should create a Waitlist", () => {
|
|
39
|
-
axiosMock.onPost(
|
|
39
|
+
axiosMock.onPost("/waitlists").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
40
40
|
return api.operations.waitlists.create({
|
|
41
41
|
jwtToken,
|
|
42
42
|
token,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
const {axiosMock} = require("./../../test-helpers");
|
|
3
|
-
const api = require("./../../../src/client").createApiClient({
|
|
1
|
+
const assert = require("node:assert/strict");
|
|
2
|
+
const {axiosMock} = require("./../../test-helpers.js");
|
|
3
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://ratality.com"});
|
|
4
4
|
|
|
5
5
|
describe("auth", () => {
|
|
6
|
-
afterEach(
|
|
6
|
+
afterEach(() => {
|
|
7
7
|
axiosMock.restore();
|
|
8
8
|
});
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ describe("auth", () => {
|
|
|
15
15
|
};
|
|
16
16
|
const response = {id_token: "someToken"};
|
|
17
17
|
axiosMock.onPost("/authenticate").reply((config) => {
|
|
18
|
-
|
|
18
|
+
assert.deepStrictEqual(config.data, JSON.stringify(data));
|
|
19
19
|
return [200, response];
|
|
20
20
|
});
|
|
21
21
|
return api.ratality.auth.create({data});
|
|
@@ -1,11 +1,11 @@
|
|
|
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://ratality.com/v2"});
|
|
3
3
|
|
|
4
4
|
describe("client", () => {
|
|
5
|
-
const jwtToken =
|
|
5
|
+
const jwtToken = "I owe you a JWT token";
|
|
6
6
|
const version = "v2";
|
|
7
7
|
|
|
8
|
-
afterEach(
|
|
8
|
+
afterEach(() => {
|
|
9
9
|
axiosMock.restore();
|
|
10
10
|
});
|
|
11
11
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const
|
|
2
|
-
const {
|
|
3
|
-
const api = require("./../../../src/client").createApiClient({
|
|
1
|
+
const assert = require("node:assert/strict");
|
|
2
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
3
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://ratality.com/v2"});
|
|
4
4
|
|
|
5
5
|
describe("integrations", () => {
|
|
6
|
-
const jwtToken =
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
7
|
const version = "v2";
|
|
8
8
|
|
|
9
|
-
afterEach(
|
|
9
|
+
afterEach(() => {
|
|
10
10
|
axiosMock.restore();
|
|
11
11
|
});
|
|
12
12
|
|
|
@@ -22,7 +22,9 @@ describe("integrations", () => {
|
|
|
22
22
|
};
|
|
23
23
|
axiosMock.onPost(`/${version}/client/integrations`).reply((config) => {
|
|
24
24
|
expectRequest({statusCode: 200, jwtToken, body: data, withoutApiKey: true});
|
|
25
|
-
|
|
25
|
+
Object.entries({clientId}).forEach(([k, v]) => {
|
|
26
|
+
assert.deepStrictEqual(config.headers[k], v);
|
|
27
|
+
});
|
|
26
28
|
return [200, {
|
|
27
29
|
"integrationType": "Betterez",
|
|
28
30
|
"clientId": clientId,
|
|
@@ -63,7 +65,9 @@ describe("integrations", () => {
|
|
|
63
65
|
const clientId = "clientId123";
|
|
64
66
|
axiosMock.onGet(`/${version}/client/integrations`).reply((config) => {
|
|
65
67
|
expectRequest({statusCode: 200, jwtToken, withoutApiKey: true});
|
|
66
|
-
|
|
68
|
+
Object.entries({clientId}).forEach(([k, v]) => {
|
|
69
|
+
assert.deepStrictEqual(config.headers[k], v);
|
|
70
|
+
});
|
|
67
71
|
return [200, {integrations: []}];
|
|
68
72
|
});
|
|
69
73
|
return api.ratality.integrations.get({
|
|
@@ -77,8 +81,10 @@ describe("integrations", () => {
|
|
|
77
81
|
const integrationType = "Betterez";
|
|
78
82
|
axiosMock.onDelete(`/${version}/client/integrations/${integrationType}`).reply((config) => {
|
|
79
83
|
expectRequest({statusCode: 200, jwtToken, withoutApiKey: true});
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
Object.entries({clientId}).forEach(([k, v]) => {
|
|
85
|
+
assert.deepStrictEqual(config.headers[k], v);
|
|
86
|
+
});
|
|
87
|
+
assert.ok(config.url.includes("Betterez"));
|
|
82
88
|
return [200, {integrations: []}];
|
|
83
89
|
});
|
|
84
90
|
return api.ratality.integrations.remove({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const {
|
|
2
|
-
|
|
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("reports/custom-reports", () => {
|
|
5
|
-
const token = "token"
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const token = "token";
|
|
6
|
+
const jwtToken = "jwtToken";
|
|
7
|
+
const customReportId = "5a959a4aa7114ffd7f000001";
|
|
8
8
|
|
|
9
9
|
afterEach(() => {
|
|
10
10
|
axiosMock.reset();
|
|
@@ -15,17 +15,17 @@ describe("reports/custom-reports", () => {
|
|
|
15
15
|
name: "customReportName"
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
axiosMock.onPost("/custom-reports").reply(expectRequest({
|
|
19
|
-
return api.reports.customReports.create({
|
|
18
|
+
axiosMock.onPost("/custom-reports").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
19
|
+
return api.reports.customReports.create({jwtToken, token, customReport});
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
it("should get all the custom reports",
|
|
23
|
-
axiosMock.onGet("/custom-reports").reply(expectRequest({
|
|
22
|
+
it("should get all the custom reports", () => {
|
|
23
|
+
axiosMock.onGet("/custom-reports").reply(expectRequest({statusCode: 200, token}));
|
|
24
24
|
return api.reports.customReports.all({token, query: {}});
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
it("should remove custom report with given id",
|
|
28
|
-
axiosMock.onDelete(`/custom-reports/${customReportId}`).reply(expectRequest({
|
|
29
|
-
return api.reports.customReports.remove({
|
|
27
|
+
it("should remove custom report with given id", () => {
|
|
28
|
+
axiosMock.onDelete(`/custom-reports/${customReportId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
29
|
+
return api.reports.customReports.remove({jwtToken, token, customReportId});
|
|
30
30
|
});
|
|
31
31
|
});
|
|
@@ -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/reports"});
|
|
4
4
|
|
|
@@ -46,8 +46,8 @@ describe("reports/email", () => {
|
|
|
46
46
|
describe("sendReportEmail", () => {
|
|
47
47
|
it("should POST a report email", () => {
|
|
48
48
|
axiosMock.onPost("/email").reply((config) => {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
assert.deepStrictEqual(config.data, JSON.stringify(report));
|
|
50
|
+
assert.deepStrictEqual(config.headers.authorization, `Bearer ${jwtToken}`);
|
|
51
51
|
const response = {
|
|
52
52
|
email: report.sender
|
|
53
53
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {
|
|
2
|
-
|
|
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("reports/report-types", () => {
|
|
5
5
|
const token = "token";
|
|
@@ -10,13 +10,13 @@ describe("reports/report-types", () => {
|
|
|
10
10
|
|
|
11
11
|
it("should get a report type by id", () => {
|
|
12
12
|
const reportTypeId = "reportTypeId";
|
|
13
|
-
axiosMock.onGet(`/types/${reportTypeId}`).reply(expectRequest({
|
|
14
|
-
return api.reports.reportTypes.get({
|
|
13
|
+
axiosMock.onGet(`/types/${reportTypeId}`).reply(expectRequest({statusCode: 200, token}));
|
|
14
|
+
return api.reports.reportTypes.get({token, id: reportTypeId});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
it("should get a report type by name", () => {
|
|
18
18
|
const reportTypeName = "reportTypeName";
|
|
19
|
-
axiosMock.onGet(`/types?name=${reportTypeName}`).reply(expectRequest({
|
|
20
|
-
return api.reports.reportTypes.getByName({
|
|
19
|
+
axiosMock.onGet(`/types?name=${reportTypeName}`).reply(expectRequest({statusCode: 200, token}));
|
|
20
|
+
return api.reports.reportTypes.getByName({token, name: reportTypeName});
|
|
21
21
|
});
|
|
22
22
|
});
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
const {
|
|
2
|
-
|
|
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("reports/trip-manifests", () => {
|
|
5
|
-
const token = "token"
|
|
6
|
-
jwtToken = "jwtToken";
|
|
5
|
+
const token = "token";
|
|
7
6
|
|
|
8
7
|
afterEach(() => {
|
|
9
8
|
axiosMock.reset();
|
|
10
9
|
});
|
|
11
10
|
|
|
12
|
-
it("should get all the trip manifests",
|
|
13
|
-
axiosMock.onGet("/trip-manifests").reply(expectRequest({
|
|
11
|
+
it("should get all the trip manifests", () => {
|
|
12
|
+
axiosMock.onGet("/trip-manifests").reply(expectRequest({statusCode: 200, token}));
|
|
14
13
|
return api.reports.tripManifests.all({token, query: {}});
|
|
15
14
|
});
|
|
16
15
|
});
|
|
@@ -1,20 +1,19 @@
|
|
|
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 =
|
|
6
|
-
|
|
7
|
-
afterEach(
|
|
4
|
+
describe("sales/bundles", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
|
|
7
|
+
afterEach(() => {
|
|
8
8
|
axiosMock.reset();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
it("should list bundles",
|
|
11
|
+
it("should list bundles", () => {
|
|
12
12
|
const query = {
|
|
13
13
|
providerId: "providerId1",
|
|
14
14
|
type: "bundles"
|
|
15
15
|
};
|
|
16
|
-
axiosMock.onGet("/bundles").reply(expectRequest({
|
|
17
|
-
return api.sales.bundles.all({
|
|
16
|
+
axiosMock.onGet("/bundles").reply(expectRequest({statusCode: 200, token}));
|
|
17
|
+
return api.sales.bundles.all({token, query});
|
|
18
18
|
});
|
|
19
|
-
|
|
20
19
|
});
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
3
|
-
const expect = require("chai").expect;
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
4
3
|
|
|
5
|
-
describe(
|
|
6
|
-
const token =
|
|
7
|
-
const jwtToken =
|
|
8
|
-
|
|
9
|
-
afterEach(
|
|
4
|
+
describe("sales/cart/{cartId}/promo/{promoCode}", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
10
9
|
axiosMock.reset();
|
|
11
10
|
});
|
|
12
11
|
|
|
13
|
-
it("should apply a promo to cart",
|
|
14
|
-
const cartId = "123"
|
|
15
|
-
|
|
16
|
-
axiosMock.onPost(`/cart/${cartId}/promos`).reply(expectRequest({
|
|
17
|
-
return api.sales.cartPromo.create({
|
|
12
|
+
it("should apply a promo to cart", () => {
|
|
13
|
+
const cartId = "123";
|
|
14
|
+
const promoCode = "ABC";
|
|
15
|
+
axiosMock.onPost(`/cart/${cartId}/promos`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
16
|
+
return api.sales.cartPromo.create({jwtToken, token, cartId, query: {providerId: "provideId1", promoCode}});
|
|
18
17
|
});
|
|
19
18
|
|
|
20
|
-
it("should remove promos from cart",
|
|
19
|
+
it("should remove promos from cart", () => {
|
|
21
20
|
const cartId = "123";
|
|
22
|
-
axiosMock.onDelete(`/cart/${cartId}`).reply(expectRequest({
|
|
23
|
-
return api.sales.cartPromo.remove({
|
|
21
|
+
axiosMock.onDelete(`/cart/${cartId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
22
|
+
return api.sales.cartPromo.remove({jwtToken, token, cartId, query: {providerId: "provideId1"}});
|
|
24
23
|
});
|
|
25
24
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
2
|
const api = require("./../../../src/client.js").createApiClient({baseURL: ""});
|
|
3
|
-
const
|
|
3
|
+
const assert = require("node:assert/strict");
|
|
4
4
|
|
|
5
5
|
describe("sales/cart", () => {
|
|
6
6
|
const token = "I owe you a token";
|
|
@@ -30,12 +30,12 @@ describe("sales/cart", () => {
|
|
|
30
30
|
it("should delete item from existing cart", () => {
|
|
31
31
|
const cartId = "someCartId";
|
|
32
32
|
axiosMock.onDelete(`/cart/${cartId}/items`).reply((request) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
assert.deepStrictEqual(request.params, {operationId: 1234, providerId: 123});
|
|
34
|
+
assert.deepStrictEqual(request.headers.Accept, "application/json");
|
|
35
|
+
assert.deepStrictEqual(request.headers["x-api-key"], "I owe you a token");
|
|
36
|
+
assert.deepStrictEqual(request.headers.authorization, "Bearer I owe you a JWT token");
|
|
37
|
+
assert.deepStrictEqual(request.method, "delete");
|
|
38
|
+
assert.deepStrictEqual(request.url, `/cart/${cartId}/items`);
|
|
39
39
|
return [200];
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
-
const apiClient = require("./../../../src/client");
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const apiClient = require("./../../../src/client.js");
|
|
3
3
|
|
|
4
4
|
describe("sales/check-in", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -17,4 +17,4 @@ describe("sales/check-in", () => {
|
|
|
17
17
|
|
|
18
18
|
return api.sales.checkInInfo.get({token, jwtToken, id: checkInId});
|
|
19
19
|
});
|
|
20
|
-
});
|
|
20
|
+
});
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
3
|
-
const expect = require("chai").expect;
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
4
3
|
|
|
5
|
-
describe(
|
|
6
|
-
const token =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
afterEach(function() {
|
|
4
|
+
describe("sales/custom-fields", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
|
|
7
|
+
afterEach(() => {
|
|
10
8
|
axiosMock.reset();
|
|
11
9
|
});
|
|
12
10
|
|
|
13
|
-
it("should list custom fields",
|
|
14
|
-
axiosMock.onGet("/custom-fields").reply(expectRequest({
|
|
15
|
-
return api.sales.customFields.all({
|
|
11
|
+
it("should list custom fields", () => {
|
|
12
|
+
axiosMock.onGet("/custom-fields").reply(expectRequest({statusCode: 200, token}));
|
|
13
|
+
return api.sales.customFields.all({token});
|
|
16
14
|
});
|
|
17
|
-
|
|
18
|
-
});
|
|
15
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
-
const apiClient = require("./../../../src/client");
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const apiClient = require("./../../../src/client.js");
|
|
3
3
|
|
|
4
4
|
describe("sales/flexpasses", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
3
|
-
const expect = require("chai").expect;
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
4
3
|
|
|
5
|
-
describe(
|
|
6
|
-
const token =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
afterEach(function() {
|
|
4
|
+
describe("sales/gift-certificates", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
|
|
7
|
+
afterEach(() => {
|
|
10
8
|
axiosMock.reset();
|
|
11
9
|
});
|
|
12
10
|
|
|
13
|
-
it("should get a gift certificate by GC number",
|
|
11
|
+
it("should get a gift certificate by GC number", () => {
|
|
14
12
|
const GCNumber = "GC-12345ABCDE";
|
|
15
|
-
axiosMock.onGet(`/gift-certificates/${GCNumber}`).reply(expectRequest({
|
|
16
|
-
return api.sales.giftCertificates.get({
|
|
13
|
+
axiosMock.onGet(`/gift-certificates/${GCNumber}`).reply(expectRequest({statusCode: 200, token}));
|
|
14
|
+
return api.sales.giftCertificates.get({token, GCNumber});
|
|
17
15
|
});
|
|
18
|
-
|
|
19
|
-
});
|
|
16
|
+
});
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const api = require("./../../../src/client").createApiClient({
|
|
3
|
-
const expect = require("chai").expect;
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
4
3
|
|
|
5
|
-
describe(
|
|
6
|
-
const token =
|
|
7
|
-
const jwtToken =
|
|
4
|
+
describe("sales/order", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
8
7
|
const orderId = "orderId1";
|
|
9
8
|
|
|
10
|
-
afterEach(
|
|
9
|
+
afterEach(() => {
|
|
11
10
|
axiosMock.reset();
|
|
12
11
|
});
|
|
13
12
|
|
|
14
|
-
it("should get an order by id",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return api.sales.order.get({ token, orderId });
|
|
13
|
+
it("should get an order by id", () => {
|
|
14
|
+
axiosMock.onGet(`/order/${orderId}`).reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
return api.sales.order.get({token, orderId});
|
|
18
16
|
});
|
|
19
17
|
|
|
20
|
-
it("should create an order",
|
|
21
|
-
axiosMock.onPost(
|
|
22
|
-
return api.sales.order.create({
|
|
18
|
+
it("should create an order", () => {
|
|
19
|
+
axiosMock.onPost("/order").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
20
|
+
return api.sales.order.create({jwtToken, token, order: {cartId: 1234}});
|
|
23
21
|
});
|
|
24
22
|
|
|
25
|
-
it("should overwrite an order payment by id",
|
|
26
|
-
axiosMock.onPost(`/orders/${orderId}/payments`).reply(expectRequest({
|
|
27
|
-
return api.sales.order.overwrite({
|
|
23
|
+
it("should overwrite an order payment by id", () => {
|
|
24
|
+
axiosMock.onPost(`/orders/${orderId}/payments`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
25
|
+
return api.sales.order.overwrite({jwtToken, token, payments: {payments: []}, orderId: "orderId1"});
|
|
28
26
|
});
|
|
29
27
|
|
|
30
|
-
it("should patch an order (complete referenced payment)",
|
|
31
|
-
const operation = {
|
|
32
|
-
axiosMock.onPatch("/orders").reply(expectRequest({
|
|
33
|
-
return api.sales.order.patch({
|
|
28
|
+
it("should patch an order (complete referenced payment)", () => {
|
|
29
|
+
const operation = {name: "completeReferencedPayment", data: {transactionId: "tx1", paymentResult: {status: "success"}}};
|
|
30
|
+
axiosMock.onPatch("/orders").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
31
|
+
return api.sales.order.patch({jwtToken, token, operation});
|
|
34
32
|
});
|
|
35
33
|
});
|
|
@@ -1,22 +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
|
-
describe(
|
|
5
|
-
const token =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
afterEach(
|
|
4
|
+
describe("sales/payment-providers", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
9
|
axiosMock.reset();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
it("should list payment providers",
|
|
13
|
-
axiosMock.onGet(
|
|
14
|
-
return api.sales.paymentProviders.all({
|
|
12
|
+
it("should list payment providers", () => {
|
|
13
|
+
axiosMock.onGet("/payment-providers").reply(expectRequest({statusCode: 200, token}));
|
|
14
|
+
return api.sales.paymentProviders.all({token});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
it("should list payment providers when request include jwtToken",
|
|
18
|
-
axiosMock.onGet(
|
|
19
|
-
return api.sales.paymentProviders.all({
|
|
17
|
+
it("should list payment providers when request include jwtToken", () => {
|
|
18
|
+
axiosMock.onGet("/payment-providers").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
19
|
+
return api.sales.paymentProviders.all({token, jwtToken});
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
});
|
|
21
|
+
});
|
|
@@ -1,26 +1,25 @@
|
|
|
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("sales/redeemable-items", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
6
|
const jwtToken = "I owe you a JWT token";
|
|
7
7
|
|
|
8
|
-
afterEach(
|
|
8
|
+
afterEach(() => {
|
|
9
9
|
axiosMock.reset();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
it("should get a redeemable item by id",
|
|
13
|
-
const redeemableItemId = "RI-12345ABCDE"
|
|
14
|
-
|
|
15
|
-
axiosMock.onGet(`/redeemable-items/${redeemableItemId}`).reply(expectRequest({
|
|
16
|
-
return api.sales.redeemableItems.get({
|
|
12
|
+
it("should get a redeemable item by id", () => {
|
|
13
|
+
const redeemableItemId = "RI-12345ABCDE";
|
|
14
|
+
const providerId = "providerId1";
|
|
15
|
+
axiosMock.onGet(`/redeemable-items/${redeemableItemId}`).reply(expectRequest({statusCode: 200, token}));
|
|
16
|
+
return api.sales.redeemableItems.get({token, redeemableItemId, query: {providerId}});
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
it("should get all the valid redeemable items",
|
|
19
|
+
it("should get all the valid redeemable items", () => {
|
|
20
20
|
const providerId = "providerId1";
|
|
21
|
-
const ids = "RIDisplayId1,RIDisplayId2"
|
|
22
|
-
axiosMock.onGet("/redeemable-items").reply(expectRequest({
|
|
23
|
-
return api.sales.redeemableItems.getValid({
|
|
21
|
+
const ids = "RIDisplayId1,RIDisplayId2";
|
|
22
|
+
axiosMock.onGet("/redeemable-items").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
23
|
+
return api.sales.redeemableItems.getValid({token, jwtToken, query: {providerId, ids}});
|
|
24
24
|
});
|
|
25
|
-
|
|
26
25
|
});
|