btrz-api-client 8.64.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/notifications/pdf-data.js +3 -6
- 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/notifications/pdf-data.js +3 -6
- 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/pdf-data.test.js +4 -4
- 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 =
|
|
4
|
+
describe("inventory/bundle-fares", () => {
|
|
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 fares for a bundle",
|
|
12
|
-
const bundleId = "bundleId1"
|
|
13
|
-
|
|
14
|
-
axiosMock.onGet(`/bundle/${bundleId}/product/${productId}`).reply(expectRequest({
|
|
15
|
-
return api.inventory.bundleFares.all({
|
|
11
|
+
it("should list fares for a bundle", () => {
|
|
12
|
+
const bundleId = "bundleId1";
|
|
13
|
+
const productId = "productId1";
|
|
14
|
+
axiosMock.onGet(`/bundle/${bundleId}/product/${productId}`).reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
return api.inventory.bundleFares.all({token, bundleId, productId});
|
|
16
16
|
});
|
|
17
|
-
|
|
18
17
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
-
|
|
4
|
+
describe("inventory/bundles", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
7
|
|
|
8
8
|
afterEach(() => {
|
|
9
9
|
axiosMock.reset();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it("should get all bundles", () => {
|
|
13
|
-
axiosMock.onGet("/bundles").reply(expectRequest({
|
|
13
|
+
axiosMock.onGet("/bundles").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
14
14
|
return api.inventory.bundles.all({
|
|
15
15
|
jwtToken,
|
|
16
16
|
token,
|
|
@@ -21,12 +21,12 @@ describe('inventory/bundles', () => {
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
it("should get a bundle by ID", () => {
|
|
24
|
-
const bundleId = "bundleId"
|
|
25
|
-
axiosMock.onGet(`/bundles/${bundleId}`).reply(expectRequest({
|
|
24
|
+
const bundleId = "bundleId";
|
|
25
|
+
axiosMock.onGet(`/bundles/${bundleId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
26
26
|
return api.inventory.bundles.get({
|
|
27
27
|
jwtToken,
|
|
28
28
|
token,
|
|
29
29
|
bundleId
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
});
|
|
32
|
+
});
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
-
|
|
4
|
+
describe("inventory/companies", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
7
|
|
|
8
8
|
afterEach(() => {
|
|
9
9
|
axiosMock.reset();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it("should get all companies", () => {
|
|
13
|
-
axiosMock.onGet(
|
|
13
|
+
axiosMock.onGet("/companies").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
14
14
|
return api.inventory.companies.all({
|
|
15
15
|
jwtToken,
|
|
16
16
|
token,
|
|
@@ -12,7 +12,7 @@ describe("inventory/custom-content", () => {
|
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
it("should create a custom content", () => {
|
|
15
|
-
axiosMock.onPost("/custom-content").reply(expectRequest({
|
|
15
|
+
axiosMock.onPost("/custom-content").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
16
16
|
return api.inventory.customContent.create({
|
|
17
17
|
jwtToken,
|
|
18
18
|
token,
|
|
@@ -23,7 +23,7 @@ describe("inventory/custom-content", () => {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
it("should get all pieces of custom content", () => {
|
|
26
|
-
axiosMock.onGet("/custom-content").reply(expectRequest({statusCode: 200, token, jwtToken
|
|
26
|
+
axiosMock.onGet("/custom-content").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
27
27
|
return api.inventory.customContent.all({
|
|
28
28
|
jwtToken,
|
|
29
29
|
token,
|
|
@@ -33,7 +33,7 @@ describe("inventory/custom-content", () => {
|
|
|
33
33
|
|
|
34
34
|
it("should update a piece of custom content", () => {
|
|
35
35
|
const customContentId = "1234";
|
|
36
|
-
axiosMock.onPut(`/custom-content/${customContentId}`).reply(expectRequest({
|
|
36
|
+
axiosMock.onPut(`/custom-content/${customContentId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
37
37
|
return api.inventory.customContent.update({
|
|
38
38
|
jwtToken,
|
|
39
39
|
token,
|
|
@@ -46,7 +46,7 @@ describe("inventory/custom-content", () => {
|
|
|
46
46
|
|
|
47
47
|
it("should get a piece of custom content", () => {
|
|
48
48
|
const customContentId = "1234";
|
|
49
|
-
axiosMock.onGet(`/custom-content/${customContentId}`).reply(expectRequest({
|
|
49
|
+
axiosMock.onGet(`/custom-content/${customContentId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
50
50
|
return api.inventory.customContent.get({
|
|
51
51
|
jwtToken,
|
|
52
52
|
token,
|
|
@@ -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/custom-fields", () => {
|
|
6
6
|
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("inventory/document-types", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
-
|
|
4
|
+
describe("inventory/fare-classes", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
7
|
|
|
8
8
|
afterEach(() => {
|
|
9
9
|
axiosMock.reset();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it("should create a fare class", () => {
|
|
13
|
-
axiosMock.onPost(
|
|
13
|
+
axiosMock.onPost("/fare-classes").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
14
14
|
return api.inventory.fareClasses.create({
|
|
15
15
|
jwtToken,
|
|
16
16
|
token,
|
|
@@ -25,14 +25,14 @@ describe('inventory/fare-classes', () => {
|
|
|
25
25
|
lexiconKeys: {
|
|
26
26
|
name: "fare-class-name-97ba4o9al2837g0w9",
|
|
27
27
|
description: "fare-class-description-97ba4o9al2837g0w9",
|
|
28
|
-
terms: "fare-class-terms-97ba4o9al2837g0w9"
|
|
28
|
+
terms: "fare-class-terms-97ba4o9al2837g0w9"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
it("should get all fare classes", () => {
|
|
35
|
-
axiosMock.onGet(
|
|
35
|
+
axiosMock.onGet("/fare-classes").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
36
36
|
return api.inventory.fareClasses.all({
|
|
37
37
|
jwtToken,
|
|
38
38
|
token,
|
|
@@ -44,7 +44,7 @@ describe('inventory/fare-classes', () => {
|
|
|
44
44
|
|
|
45
45
|
it("should update a fare class", () => {
|
|
46
46
|
const fareClassId = "5ad7804216b426412c19f06f";
|
|
47
|
-
axiosMock.onPatch(`/fare-classes/${fareClassId}`).reply(expectRequest({
|
|
47
|
+
axiosMock.onPatch(`/fare-classes/${fareClassId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
48
48
|
|
|
49
49
|
return api.inventory.fareClasses.update({
|
|
50
50
|
jwtToken,
|
|
@@ -61,7 +61,7 @@ describe('inventory/fare-classes', () => {
|
|
|
61
61
|
lexiconKeys: {
|
|
62
62
|
name: "fare-class-name-97ba4o9al2837g0w9",
|
|
63
63
|
description: "fare-class-description-97ba4o9al2837g0w9",
|
|
64
|
-
terms: "fare-class-terms-97ba4o9al2837g0w9"
|
|
64
|
+
terms: "fare-class-terms-97ba4o9al2837g0w9"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
});
|
|
@@ -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
|
-
describe(
|
|
5
|
-
const token =
|
|
4
|
+
describe("inventory/fares", () => {
|
|
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 list fares",
|
|
13
|
-
axiosMock.onGet(
|
|
14
|
-
return api.inventory.fares.all({
|
|
12
|
+
it("should list fares", () => {
|
|
13
|
+
axiosMock.onGet("/fares").reply(expectRequest({statusCode: 200, token}));
|
|
14
|
+
return api.inventory.fares.all({token});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
it("should get a fare by id",
|
|
17
|
+
it("should get a fare by id", () => {
|
|
18
18
|
const id = "fareId1";
|
|
19
|
-
axiosMock.onGet(`/fare/${id}`).reply(expectRequest({
|
|
20
|
-
return api.inventory.fares.get({
|
|
19
|
+
axiosMock.onGet(`/fare/${id}`).reply(expectRequest({statusCode: 200, token}));
|
|
20
|
+
return api.inventory.fares.get({token, id});
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
it("should create a fare", () => {
|
|
24
24
|
const fare = {
|
|
25
|
-
name: "newFare"
|
|
25
|
+
name: "newFare"
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
axiosMock.onPost("/fares").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
@@ -36,7 +36,7 @@ describe('inventory/fares', function() {
|
|
|
36
36
|
it("should update a fare", () => {
|
|
37
37
|
const fareId = "123123123123";
|
|
38
38
|
const fare = {
|
|
39
|
-
name: "newFare"
|
|
39
|
+
name: "newFare"
|
|
40
40
|
};
|
|
41
41
|
axiosMock.onPut(`/fare/${fareId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
42
42
|
return api.inventory.fares.update({jwtToken, token, fareId, fare});
|
|
@@ -45,7 +45,7 @@ describe('inventory/fares', function() {
|
|
|
45
45
|
it("should create an adjustment", () => {
|
|
46
46
|
const fareId = "123123123123";
|
|
47
47
|
const adjustmentsOverride = {
|
|
48
|
-
name: "newAdjustment"
|
|
48
|
+
name: "newAdjustment"
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
axiosMock.onPost(`/fares/${fareId}/adjustments-overrides`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
@@ -69,6 +69,4 @@ describe('inventory/fares', function() {
|
|
|
69
69
|
adjustmentId
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
72
|
});
|
|
@@ -1,23 +1,23 @@
|
|
|
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(
|
|
4
|
+
describe("inventory/fees", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
6
6
|
const jwtToken = "I owe you a JWT token";
|
|
7
|
-
|
|
8
|
-
afterEach(
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
9
|
axiosMock.reset();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
it("should list fees",
|
|
13
|
-
axiosMock.onGet(
|
|
14
|
-
return api.inventory.fees.all({
|
|
12
|
+
it("should list fees", () => {
|
|
13
|
+
axiosMock.onGet("/fees").reply(expectRequest({statusCode: 200, token}));
|
|
14
|
+
return api.inventory.fees.all({token});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
it("should get a fee by id",
|
|
17
|
+
it("should get a fee by id", () => {
|
|
18
18
|
const feeId = "feeId1";
|
|
19
|
-
axiosMock.onGet(`/fees/${feeId}`).reply(expectRequest({
|
|
20
|
-
return api.inventory.fees.get({
|
|
19
|
+
axiosMock.onGet(`/fees/${feeId}`).reply(expectRequest({statusCode: 200, token}));
|
|
20
|
+
return api.inventory.fees.get({token, feeId});
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
it("should create a fee", () => {
|
|
@@ -26,7 +26,7 @@ describe('inventory/fees', function() {
|
|
|
26
26
|
jwtToken,
|
|
27
27
|
token,
|
|
28
28
|
data: {
|
|
29
|
-
name: "fee"
|
|
29
|
+
name: "fee"
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
});
|
|
@@ -34,10 +34,9 @@ describe('inventory/fees', function() {
|
|
|
34
34
|
it("should update a fee", () => {
|
|
35
35
|
const feeId = "123123123123";
|
|
36
36
|
const data = {
|
|
37
|
-
name: "newFee"
|
|
37
|
+
name: "newFee"
|
|
38
38
|
};
|
|
39
39
|
axiosMock.onPut(`/fees/${feeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
40
40
|
return api.inventory.fees.update({jwtToken, token, feeId, data});
|
|
41
41
|
});
|
|
42
|
-
|
|
43
|
-
});
|
|
42
|
+
});
|
|
@@ -1,15 +1,15 @@
|
|
|
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
|
-
describe("inventory/v2/filtered-trips",
|
|
4
|
+
describe("inventory/v2/filtered-trips", () => {
|
|
5
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 create a filtered trip",
|
|
12
|
+
it("should create a filtered trip", () => {
|
|
13
13
|
axiosMock.onPost("/v2/filtered-trips").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
14
14
|
return api.inventory.filteredTripsV2.create({token, jwtToken, filteredTrip: {someProperty: "some value"}});
|
|
15
15
|
});
|
|
@@ -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({
|
|
5
5
|
baseURL: "http://test.com"
|
|
6
6
|
});
|
|
7
7
|
|
|
@@ -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({
|
|
5
5
|
baseURL: "http://test.com"
|
|
6
6
|
});
|
|
7
7
|
|
|
@@ -1,17 +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
4
|
|
|
5
|
-
describe(
|
|
6
|
-
const token =
|
|
7
|
-
|
|
5
|
+
describe("inventory/journey-prices", () => {
|
|
6
|
+
const token = "I owe you a token";
|
|
7
|
+
const jwtToken = "I owe you a JWT token";
|
|
8
8
|
|
|
9
9
|
afterEach(() => {
|
|
10
10
|
axiosMock.reset();
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
it("should get all journey prices that match the provided query", () => {
|
|
14
|
-
axiosMock.onGet(
|
|
14
|
+
axiosMock.onGet("/journey-prices").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
15
15
|
return api.inventory.journeyPrices.all({
|
|
16
16
|
jwtToken,
|
|
17
17
|
token,
|
|
@@ -32,7 +32,7 @@ describe('inventory/journey-prices', () => {
|
|
|
32
32
|
|
|
33
33
|
it("should delete the journey price with the specified ID", () => {
|
|
34
34
|
const id = "1234567890";
|
|
35
|
-
axiosMock.onDelete(`/journey-prices/${id}`).reply(expectRequest({
|
|
35
|
+
axiosMock.onDelete(`/journey-prices/${id}`).reply(expectRequest({statusCode: 204, token, jwtToken}));
|
|
36
36
|
return api.inventory.journeyPrices.deleteById({
|
|
37
37
|
jwtToken,
|
|
38
38
|
token,
|
|
@@ -42,14 +42,14 @@ describe('inventory/journey-prices', () => {
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
it("should create a Journey Pricing rule", () => {
|
|
45
|
-
axiosMock.onPost(
|
|
45
|
+
axiosMock.onPost("/journey-prices").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
46
46
|
return api.inventory.journeyPrices.create({
|
|
47
47
|
jwtToken,
|
|
48
48
|
token,
|
|
49
49
|
journeyPrice: {
|
|
50
|
-
price:
|
|
51
|
-
originId:
|
|
52
|
-
destinationId:
|
|
50
|
+
price: "75000000",
|
|
51
|
+
originId: "112312-123123-121321-13123",
|
|
52
|
+
destinationId: "112312-123123-121321-13123"
|
|
53
53
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
@@ -57,17 +57,15 @@ describe('inventory/journey-prices', () => {
|
|
|
57
57
|
|
|
58
58
|
it("should update a Journey Pricing rule", () => {
|
|
59
59
|
const journeyPriceId = "5ad7804216b426412c19f06f";
|
|
60
|
-
axiosMock.onPatch(`/journey-prices/${journeyPriceId}`).reply(expectRequest({
|
|
60
|
+
axiosMock.onPatch(`/journey-prices/${journeyPriceId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
61
61
|
|
|
62
62
|
return api.inventory.journeyPrices.update({
|
|
63
63
|
jwtToken,
|
|
64
64
|
token,
|
|
65
65
|
journeyPriceId,
|
|
66
66
|
"journeyPrice": {
|
|
67
|
-
"price": "englishName"
|
|
67
|
+
"price": "englishName"
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
71
|
});
|
|
@@ -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/labels", () => {
|
|
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("inventory/marital-status", () => {
|
|
5
5
|
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/mit-terminals-settings", () => {
|
|
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/mit-terminals", () => {
|
|
7
7
|
const token = "I owe you a token";
|
|
@@ -12,7 +12,7 @@ describe("inventory/mit-terminals", () => {
|
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
it("should create a MIT terminal", () => {
|
|
15
|
-
axiosMock.onPost("/mit-terminals").reply(expectRequest({
|
|
15
|
+
axiosMock.onPost("/mit-terminals").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
16
16
|
return api.inventory.mitTerminals.create({
|
|
17
17
|
jwtToken,
|
|
18
18
|
token,
|
|
@@ -23,7 +23,7 @@ describe("inventory/mit-terminals", () => {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
it("should get all MIT terminals", () => {
|
|
26
|
-
axiosMock.onGet("/mit-terminals").reply(expectRequest({statusCode: 200, token, jwtToken
|
|
26
|
+
axiosMock.onGet("/mit-terminals").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
27
27
|
return api.inventory.mitTerminals.all({
|
|
28
28
|
jwtToken,
|
|
29
29
|
token,
|
|
@@ -33,7 +33,7 @@ describe("inventory/mit-terminals", () => {
|
|
|
33
33
|
|
|
34
34
|
it("should update a MIT terminal", () => {
|
|
35
35
|
const mitTerminalId = "1234";
|
|
36
|
-
axiosMock.onPut(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({
|
|
36
|
+
axiosMock.onPut(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
37
37
|
return api.inventory.mitTerminals.update({
|
|
38
38
|
jwtToken,
|
|
39
39
|
token,
|
|
@@ -46,7 +46,7 @@ describe("inventory/mit-terminals", () => {
|
|
|
46
46
|
|
|
47
47
|
it("should get a MIT terminal", () => {
|
|
48
48
|
const mitTerminalId = "1234";
|
|
49
|
-
axiosMock.onGet(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({
|
|
49
|
+
axiosMock.onGet(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
50
50
|
return api.inventory.mitTerminals.get({
|
|
51
51
|
jwtToken,
|
|
52
52
|
token,
|
|
@@ -56,7 +56,7 @@ describe("inventory/mit-terminals", () => {
|
|
|
56
56
|
|
|
57
57
|
it("should delete a MIT terminal", () => {
|
|
58
58
|
const mitTerminalId = "1234";
|
|
59
|
-
axiosMock.onDelete(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({
|
|
59
|
+
axiosMock.onDelete(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
60
60
|
return api.inventory.mitTerminals.remove({
|
|
61
61
|
jwtToken,
|
|
62
62
|
token,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const
|
|
3
|
-
const api = require("./../../../src/client").createApiClient({
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const assert = require("node:assert/strict");
|
|
3
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
4
4
|
|
|
5
|
-
describe(
|
|
6
|
-
const token =
|
|
7
|
-
|
|
5
|
+
describe("inventory/operating-companies", () => {
|
|
6
|
+
const token = "I owe you a token";
|
|
7
|
+
const jwtToken = "I owe you a JWT token";
|
|
8
8
|
|
|
9
9
|
afterEach(() => {
|
|
10
10
|
axiosMock.reset();
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
it("should create an operatingCompany", () => {
|
|
14
|
-
axiosMock.onPost(
|
|
14
|
+
axiosMock.onPost("/operating-companies").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
15
15
|
return api.inventory.operatingCompanies.create({
|
|
16
16
|
jwtToken,
|
|
17
17
|
token,
|
|
@@ -23,7 +23,7 @@ describe('inventory/operating-companies', () => {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
it("should get all operatingCompanies", () => {
|
|
26
|
-
axiosMock.onGet(
|
|
26
|
+
axiosMock.onGet("/operating-companies").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
27
27
|
return api.inventory.operatingCompanies.all({
|
|
28
28
|
jwtToken,
|
|
29
29
|
token,
|
|
@@ -35,7 +35,7 @@ describe('inventory/operating-companies', () => {
|
|
|
35
35
|
|
|
36
36
|
it("should update an operatingCompany", () => {
|
|
37
37
|
const operatingCompanyId = "1234";
|
|
38
|
-
axiosMock.onPut(`/operating-companies/${operatingCompanyId}`).reply(expectRequest({
|
|
38
|
+
axiosMock.onPut(`/operating-companies/${operatingCompanyId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
39
39
|
return api.inventory.operatingCompanies.update({
|
|
40
40
|
jwtToken,
|
|
41
41
|
token,
|
|
@@ -49,7 +49,7 @@ describe('inventory/operating-companies', () => {
|
|
|
49
49
|
|
|
50
50
|
it("should get an operatingCompany", () => {
|
|
51
51
|
const operatingCompanyId = "1234";
|
|
52
|
-
axiosMock.onGet(`/operating-companies/${operatingCompanyId}`).reply(expectRequest({
|
|
52
|
+
axiosMock.onGet(`/operating-companies/${operatingCompanyId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
53
53
|
return api.inventory.operatingCompanies.get({
|
|
54
54
|
jwtToken,
|
|
55
55
|
token,
|
|
@@ -68,7 +68,7 @@ describe('inventory/operating-companies', () => {
|
|
|
68
68
|
operatingCompanyId,
|
|
69
69
|
sequence: operatingCompanySequenceData
|
|
70
70
|
}).then((httpResponse) => {
|
|
71
|
-
|
|
71
|
+
assert.deepStrictEqual(httpResponse.status, 200);
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
|
|
@@ -80,7 +80,7 @@ describe('inventory/operating-companies', () => {
|
|
|
80
80
|
token,
|
|
81
81
|
operatingCompanyId
|
|
82
82
|
}).then((httpResponse) => {
|
|
83
|
-
|
|
83
|
+
assert.deepStrictEqual(httpResponse.status, 200);
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
|
|
@@ -95,7 +95,7 @@ describe('inventory/operating-companies', () => {
|
|
|
95
95
|
operatingCompanyId,
|
|
96
96
|
sequenceId
|
|
97
97
|
}).then((httpResponse) => {
|
|
98
|
-
|
|
98
|
+
assert.deepStrictEqual(httpResponse.status, 200);
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
101
|
|
|
@@ -112,7 +112,7 @@ describe('inventory/operating-companies', () => {
|
|
|
112
112
|
sequenceId,
|
|
113
113
|
sequence: operatingCompanySequenceData
|
|
114
114
|
}).then((httpResponse) => {
|
|
115
|
-
|
|
115
|
+
assert.deepStrictEqual(httpResponse.status, 200);
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
118
|
});
|