@duffel/components 3.0.7-canary → 3.1.2
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/.eslintrc.js +8 -0
- package/.github/CODEOWNERS +4 -0
- package/.github/renovate.json +1 -5
- package/.github/workflows/release.yml +3 -0
- package/.storybook/__snapshots__/Storyshots.test.js.snap +20384 -533
- package/README.md +16 -2
- package/config/esbuild.base.config.js +6 -2
- package/config/esbuild.cdn.config.js +2 -1
- package/config/esbuild.dev.config.js +2 -1
- package/config/esbuild.react.config.js +1 -1
- package/data/airports.csv +9084 -0
- package/data/cities.csv +256 -0
- package/package.json +11 -1
- package/react-dist/components/{Card.d.ts → DuffelAncillaries/Card.d.ts} +1 -1
- package/react-dist/components/{DuffelAncillaries.d.ts → DuffelAncillaries/DuffelAncillaries.d.ts} +1 -1
- package/react-dist/components/{DuffelAncillariesCustomElement.d.ts → DuffelAncillaries/DuffelAncillariesCustomElement.d.ts} +1 -1
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionCard.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionController.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModal.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBody.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBodyPassenger.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalFooter.d.ts +1 -1
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalHeader.d.ts +1 -1
- package/react-dist/components/{bags → DuffelAncillaries/bags}/IncludedBaggageBanner.d.ts +1 -1
- package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionCard.d.ts +2 -2
- package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModal.d.ts +2 -2
- package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalBody.d.ts +1 -1
- package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalFooter.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/Amenity.d.ts +1 -1
- package/react-dist/components/{seats → DuffelAncillaries/seats}/Element.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/Legend.d.ts +1 -1
- package/react-dist/components/{seats → DuffelAncillaries/seats}/Row.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/RowSection.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatElement.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatInfo.d.ts +1 -1
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatMap.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionCard.d.ts +3 -3
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModal.d.ts +3 -3
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalFooter.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalHeader.d.ts +1 -1
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatUnavailable.d.ts +1 -1
- package/react-dist/components/DuffelPayments/DuffelPayments.d.ts +11 -0
- package/react-dist/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +14 -0
- package/react-dist/components/PlacesLookup/PlacesLookup.d.ts +20 -0
- package/react-dist/components/{Button.d.ts → shared/Button.d.ts} +2 -2
- package/react-dist/components/{ErrorBoundary.d.ts → shared/ErrorBoundary.d.ts} +1 -1
- package/react-dist/components/{Icon.d.ts → shared/Icon.d.ts} +2 -0
- package/react-dist/components/{IconButton.d.ts → shared/IconButton.d.ts} +1 -1
- package/react-dist/components/{NonIdealState.d.ts → shared/NonIdealState.d.ts} +1 -1
- package/react-dist/custom-elements.d.ts +2 -1
- package/react-dist/custom-elements.js +21 -20
- package/react-dist/custom-elements.js.map +4 -4
- package/react-dist/index.d.ts +3 -1
- package/react-dist/index.js +51 -21
- package/react-dist/index.js.map +4 -4
- package/react-dist/lib/captureErrorInSentry.d.ts +1 -1
- package/react-dist/lib/fetchFromDuffelAPI.d.ts +7 -0
- package/react-dist/lib/hasHighLuminance.d.ts +1 -0
- package/react-dist/lib/logging.d.ts +7 -14
- package/react-dist/lib/retrieveSeatMaps.d.ts +1 -1
- package/react-dist/types/DuffelAncillariesProps.d.ts +1 -1
- package/scripts/generate-fixture.ts +13 -8
- package/scripts/setup-suggestion-data.ts +100 -0
- package/scripts/upload-to-cdn.sh +1 -1
- package/src/components/{Card.tsx → DuffelAncillaries/Card.tsx} +1 -1
- package/src/components/{Counter.tsx → DuffelAncillaries/Counter.tsx} +1 -1
- package/src/components/{DuffelAncillaries.tsx → DuffelAncillaries/DuffelAncillaries.tsx} +68 -64
- package/src/components/{DuffelAncillariesCustomElement.tsx → DuffelAncillaries/DuffelAncillariesCustomElement.tsx} +2 -2
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionCard.tsx +10 -5
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionController.tsx +2 -2
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModal.tsx +4 -4
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBody.tsx +3 -3
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBodyPassenger.tsx +4 -4
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalFooter.tsx +23 -16
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalHeader.tsx +24 -18
- package/src/components/{bags → DuffelAncillaries/bags}/IncludedBaggageBanner.tsx +1 -1
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionCard.tsx +4 -4
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModal.tsx +3 -3
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalBody.tsx +3 -3
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalBodyListItem.tsx +1 -1
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalFooter.tsx +5 -5
- package/src/components/{seats → DuffelAncillaries/seats}/Amenity.tsx +2 -2
- package/src/components/{seats → DuffelAncillaries/seats}/DeckSelect.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/Element.tsx +2 -2
- package/src/components/{seats → DuffelAncillaries/seats}/ExitElement.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/Legend.tsx +2 -2
- package/src/components/{seats → DuffelAncillaries/seats}/Row.tsx +2 -2
- package/src/components/{seats → DuffelAncillaries/seats}/RowSection.tsx +5 -2
- package/src/components/{seats → DuffelAncillaries/seats}/SeatElement.tsx +3 -3
- package/src/components/{seats → DuffelAncillaries/seats}/SeatInfo.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/SeatMap.tsx +6 -2
- package/src/components/{seats → DuffelAncillaries/seats}/SeatMapUnavailable.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionCard.tsx +5 -5
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModal.tsx +5 -5
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalBody.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalFooter.tsx +24 -17
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalHeader.tsx +30 -20
- package/src/components/{seats → DuffelAncillaries/seats}/SeatUnavailable.tsx +2 -2
- package/src/components/DuffelPayments/DuffelPayments.tsx +224 -0
- package/src/components/DuffelPayments/DuffelPaymentsCustomElement.tsx +130 -0
- package/src/components/PlacesLookup/PlacesLookup.tsx +123 -0
- package/src/components/{Button.tsx → shared/Button.tsx} +4 -3
- package/src/components/{ErrorBoundary.tsx → shared/ErrorBoundary.tsx} +2 -2
- package/src/components/{Icon.tsx → shared/Icon.tsx} +11 -11
- package/src/components/{IconButton.tsx → shared/IconButton.tsx} +1 -1
- package/src/components/{Modal.tsx → shared/Modal.tsx} +5 -1
- package/src/components/{NonIdealState.tsx → shared/NonIdealState.tsx} +1 -1
- package/src/custom-elements.ts +6 -1
- package/src/examples/client-side/index.html +1 -1
- package/src/examples/full-stack/index.html +1 -1
- package/src/examples/full-stack/server.mjs +1 -0
- package/src/examples/just-typescript/src/index.html +2 -2
- package/src/examples/just-typescript/src/index.ts +2 -1
- package/src/examples/payments-custom-element/README.md +17 -0
- package/src/examples/payments-custom-element/index.html +43 -0
- package/src/examples/payments-just-typescript/README.md +37 -0
- package/src/examples/payments-just-typescript/package.json +16 -0
- package/src/examples/payments-just-typescript/src/index.html +23 -0
- package/src/examples/payments-just-typescript/src/index.ts +18 -0
- package/src/examples/payments-just-typescript/yarn.lock +154 -0
- package/src/examples/react-app/src/index.tsx +11 -6
- package/src/fixtures/offers/off_1.json +1 -10
- package/src/index.ts +3 -1
- package/src/lib/captureErrorInSentry.ts +2 -20
- package/src/lib/fetchFromDuffelAPI.ts +36 -6
- package/src/lib/formatDate.ts +3 -4
- package/src/lib/getBaggageServiceDescription.ts +1 -6
- package/src/lib/getPassengerName.ts +4 -0
- package/src/lib/getTotalAmountForServices.ts +1 -1
- package/src/lib/hasHighLuminance.ts +9 -0
- package/src/lib/logging.ts +52 -32
- package/src/lib/retrieveOffer.ts +13 -6
- package/src/lib/retrieveSeatMaps.ts +13 -8
- package/src/stories/BaggageSelectionModalHeader.stories.tsx +1 -1
- package/src/stories/Button.stories.tsx +33 -2
- package/src/stories/DuffelAncillaries.stories.tsx +42 -2
- package/src/stories/DuffelPayments.stories.tsx +34 -0
- package/src/stories/Icon.stories.tsx +3 -2
- package/src/stories/IconButton.stories.tsx +1 -1
- package/src/stories/PlacesLookup.stories.tsx +22 -0
- package/src/styles/components/Button.css +11 -3
- package/src/styles/components/Card.css +3 -3
- package/src/styles/components/CfarSelectionModal.css +1 -1
- package/src/styles/components/DuffelPayments.css +42 -0
- package/src/styles/components/Legend.css +10 -6
- package/src/styles/components/LoadingState.css +8 -2
- package/src/styles/components/Modal.css +2 -1
- package/src/styles/components/PassengerSelect.css +8 -2
- package/src/styles/components/PlacesLookup.css +36 -0
- package/src/styles/components/Seat.css +9 -7
- package/src/styles/components/SeatInfo.css +1 -1
- package/src/styles/components/Tabs.css +5 -2
- package/src/styles/global.css +2 -0
- package/src/tests/components/DuffelAncillaries.test.tsx +1 -1
- package/src/tests/lib/createPriceFormatters.test.tsx +1 -1
- package/src/tests/lib/formatAvailableServices.test.tsx +1 -1
- package/src/tests/lib/formatSeatMaps.test.tsx +2 -2
- package/src/tests/lib/getCurrencyForServices.test.tsx +1 -1
- package/src/tests/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.test.ts +1 -1
- package/src/tests/lib/logging.test.tsx +14 -14
- package/src/tests/lib/moneyStringFormatter.test.tsx +1 -1
- package/src/tests/lib/validateProps.test.tsx +1 -1
- package/src/types/DuffelAncillariesProps.ts +1 -1
- /package/react-dist/components/{Counter.d.ts → DuffelAncillaries/Counter.d.ts} +0 -0
- /package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalBodyListItem.d.ts +0 -0
- /package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalHeader.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/DeckSelect.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/EmptyElement.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/ExitElement.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatMapUnavailable.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalBody.d.ts +0 -0
- /package/react-dist/components/{AnimatedLoaderEllipsis.d.ts → shared/AnimatedLoaderEllipsis.d.ts} +0 -0
- /package/react-dist/components/{FetchOfferErrorState.d.ts → shared/FetchOfferErrorState.d.ts} +0 -0
- /package/react-dist/components/{Modal.d.ts → shared/Modal.d.ts} +0 -0
- /package/react-dist/components/{Stamp.d.ts → shared/Stamp.d.ts} +0 -0
- /package/react-dist/components/{Tabs.d.ts → shared/Tabs.d.ts} +0 -0
- /package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalHeader.tsx +0 -0
- /package/src/components/{seats → DuffelAncillaries/seats}/EmptyElement.tsx +0 -0
- /package/src/components/{AnimatedLoaderEllipsis.tsx → shared/AnimatedLoaderEllipsis.tsx} +0 -0
- /package/src/components/{FetchOfferErrorState.tsx → shared/FetchOfferErrorState.tsx} +0 -0
- /package/src/components/{Stamp.tsx → shared/Stamp.tsx} +0 -0
- /package/src/components/{Tabs.tsx → shared/Tabs.tsx} +0 -0
|
@@ -21,16 +21,17 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.map-element--available {
|
|
24
|
-
border: 2px solid
|
|
24
|
+
border: 2px solid
|
|
25
|
+
var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-200)));
|
|
25
26
|
background-color: rgba(var(--ACCENT), var(--ACCENT-LIGHT-100));
|
|
26
|
-
color: rgba(var(--ACCENT), var(--ACCENT-LIGHT-300));
|
|
27
|
+
color: var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-300)));
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
.map-element--fee-payable {
|
|
30
31
|
position: absolute;
|
|
31
32
|
bottom: -2px;
|
|
32
33
|
right: -2px;
|
|
33
|
-
color: rgba(var(--ACCENT), var(--ACCENT-LIGHT-300));
|
|
34
|
+
color: var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-300)));
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
@media (hover: hover) and (pointer: fine) {
|
|
@@ -40,18 +41,19 @@
|
|
|
40
41
|
|
|
41
42
|
.map-element--actionable:not(.map-element--selected):hover {
|
|
42
43
|
background-color: rgba(var(--ACCENT), var(--ACCENT-LIGHT-200));
|
|
43
|
-
color: rgba(var(--ACCENT), var(--ACCENT-LIGHT-1000));
|
|
44
|
+
color: var(--SECONDARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-1000)));
|
|
44
45
|
transition: var(--TRANSITIONS-CUBIC-BEZIER);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
.map-element--fee-payable {
|
|
48
|
-
color: rgba(var(--ACCENT), var(--ACCENT-LIGHT-1000));
|
|
49
|
+
color: var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-1000)));
|
|
49
50
|
transition: var(--TRANSITIONS-CUBIC-BEZIER);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
.map-element--selected {
|
|
54
55
|
background-color: rgba(var(--ACCENT), var(--ACCENT-LIGHT-1000));
|
|
55
|
-
border: 2px solid
|
|
56
|
-
|
|
56
|
+
border: 2px solid
|
|
57
|
+
var(--SECONDARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-1000)));
|
|
58
|
+
color: var(--SECONDARY, rgba(var(--WHITE), 1));
|
|
57
59
|
}
|
|
@@ -28,8 +28,11 @@
|
|
|
28
28
|
.seat-map__tab-select-option:hover,
|
|
29
29
|
.seat-map__tab-select-option:focus,
|
|
30
30
|
.seat-map__tab-select-option:active {
|
|
31
|
-
color: rgba(var(--ACCENT), var(--ACCENT-LIGHT-1000));
|
|
32
|
-
background-color:
|
|
31
|
+
color: var(--SECONDARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-1000)));
|
|
32
|
+
background-color: var(
|
|
33
|
+
--TERTIARY,
|
|
34
|
+
rgba(var(--ACCENT), var(--ACCENT-LIGHT-200))
|
|
35
|
+
);
|
|
33
36
|
transition: var(--TRANSITIONS-CUBIC-BEZIER);
|
|
34
37
|
}
|
|
35
38
|
|
package/src/styles/global.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@import "./components/CfarSelectionModal.css";
|
|
13
13
|
@import "./components/Card.css";
|
|
14
14
|
@import "./components/Counter.css";
|
|
15
|
+
@import "./components/DuffelPayments.css";
|
|
15
16
|
@import "./components/IconButton.css";
|
|
16
17
|
@import "./components/Legend.css";
|
|
17
18
|
@import "./components/Loader.css";
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
@import "./components/Modal.css";
|
|
20
21
|
@import "./components/PassengerSelect.css";
|
|
21
22
|
@import "./components/PassengersLayout.css";
|
|
23
|
+
@import "./components/PlacesLookup.css";
|
|
22
24
|
@import "./components/Row.css";
|
|
23
25
|
@import "./components/Seat.css";
|
|
24
26
|
@import "./components/SeatInfo.css";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fireEvent, render } from "@testing-library/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { DuffelAncillaries } from "../../components/DuffelAncillaries";
|
|
3
|
+
import { DuffelAncillaries } from "../../components/DuffelAncillaries/DuffelAncillaries";
|
|
4
4
|
import mockPassengers from "../../fixtures/passengers/mock_passengers";
|
|
5
5
|
import {
|
|
6
6
|
DuffelAncillariesPropsWithOffersAndSeatMaps,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createPriceFormatters } from "
|
|
1
|
+
import { createPriceFormatters } from "../../lib/createPriceFormatters";
|
|
2
2
|
|
|
3
3
|
describe("createPriceFormatters", () => {
|
|
4
4
|
it("should return an empty object if neither markup nor priceFormatters are supplied", () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatAvailableServices } from "
|
|
1
|
+
import { formatAvailableServices } from "../../lib/formatAvailableServices";
|
|
2
2
|
import { OfferAvailableServiceBaggage } from "../../types/Offer";
|
|
3
3
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { formatSeatMaps } from "
|
|
2
|
-
import { getFirstSeatElementMatchingCriteria } from "
|
|
1
|
+
import { formatSeatMaps } from "../../lib/formatSeatMaps";
|
|
2
|
+
import { getFirstSeatElementMatchingCriteria } from "../../lib/getFirstSeatElementMatchingCriteria";
|
|
3
3
|
import { SeatMapCabinRowSectionElementSeat } from "../../types/SeatMap";
|
|
4
4
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasServiceOfSameMetadataTypeAlreadyBeenSelected } from "
|
|
1
|
+
import { hasServiceOfSameMetadataTypeAlreadyBeenSelected } from "../../lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected";
|
|
2
2
|
import { CreateOrderPayloadService } from "../../types/CreateOrderPayload";
|
|
3
3
|
import { OfferAvailableBaggageService } from "../../types/Offer";
|
|
4
4
|
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { initializeLogger } from "
|
|
1
|
+
import { initializeLogger, log, logGroup } from "../../lib/logging";
|
|
2
2
|
|
|
3
3
|
const consoleSpies = {
|
|
4
|
-
log: jest.spyOn(console, "
|
|
4
|
+
log: jest.spyOn(console, "info"),
|
|
5
5
|
groupCollapsed: jest.spyOn(console, "groupCollapsed"),
|
|
6
6
|
groupEnd: jest.spyOn(console, "groupEnd"),
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
describe("
|
|
9
|
+
describe("logging", () => {
|
|
10
10
|
it("should return functions that do nothing when debugMode is false", () => {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
initializeLogger(false);
|
|
12
|
+
log("This should not be logged");
|
|
13
13
|
expect(consoleSpies.log).not.toHaveBeenCalled();
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
it("should return functions that log a message when debugMode is true", () => {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
initializeLogger(true);
|
|
18
|
+
log("This should be logged");
|
|
19
19
|
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
expect(consoleSpies.log).toHaveBeenCalledTimes(
|
|
20
|
+
// Once because initializeLogger was initialised on the test above
|
|
21
|
+
// And so, the initialisation message would not show up twice.
|
|
22
|
+
expect(consoleSpies.log).toHaveBeenCalledTimes(1);
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
logGroup("This should be logged", ["one", "two"]);
|
|
25
25
|
expect(consoleSpies.groupCollapsed).toHaveBeenCalledTimes(1);
|
|
26
26
|
expect(consoleSpies.groupEnd).toHaveBeenCalledTimes(1);
|
|
27
27
|
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
expect(consoleSpies.log).toHaveBeenCalledTimes(
|
|
28
|
+
// once for the call to `log` above and then
|
|
29
|
+
// twice for the array passed to logGroup
|
|
30
|
+
expect(consoleSpies.log).toHaveBeenCalledTimes(3);
|
|
31
31
|
});
|
|
32
32
|
});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* that we can test functions with invalid props.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { hasCommonRequiredProps } from "
|
|
7
|
+
import { hasCommonRequiredProps } from "../../lib/validateProps";
|
|
8
8
|
import { Ancillaries } from "../../types/DuffelAncillariesProps";
|
|
9
9
|
|
|
10
10
|
describe("hasCommonRequiredProps", () => {
|
|
@@ -75,7 +75,7 @@ export type DuffelAncillariesPriceFormatterForCancelForAnyReason = (
|
|
|
75
75
|
amount: number,
|
|
76
76
|
currency: string,
|
|
77
77
|
service: OfferAvailableServiceCancelForAnyReason
|
|
78
|
-
) => { amount: number; currency
|
|
78
|
+
) => { amount: number; currency?: string };
|
|
79
79
|
|
|
80
80
|
export interface DuffelAncillariesPriceFormatters {
|
|
81
81
|
bags?: DuffelAncillariesPriceFormatterForBags;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalBody.d.ts
RENAMED
|
File without changes
|
/package/react-dist/components/{AnimatedLoaderEllipsis.d.ts → shared/AnimatedLoaderEllipsis.d.ts}
RENAMED
|
File without changes
|
/package/react-dist/components/{FetchOfferErrorState.d.ts → shared/FetchOfferErrorState.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|