@roomstay/frontend 2.1.7 → 2.1.10

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.
Files changed (112) hide show
  1. package/dist/201.bundle.js +1 -1
  2. package/dist/449.bundle.js +1 -1
  3. package/dist/535.bundle.js +2 -0
  4. package/dist/559.bundle.js +1 -1
  5. package/dist/760.bundle.js +1 -1
  6. package/dist/882.bundle.js +1 -1
  7. package/dist/main.bundle.js +1 -1
  8. package/dist/src/components/generic/Icon/Icon.d.ts +1 -0
  9. package/dist/src/components/generic/Icon/Icon.js +2 -1
  10. package/dist/src/components/generic/Icon/Icon.js.map +1 -1
  11. package/dist/src/components/generic/Layout/StepLayout/StepLayoutContainer.d.ts +3 -0
  12. package/dist/src/components/generic/Layout/StepLayout/StepLayoutContainer.js +28 -0
  13. package/dist/src/components/generic/Layout/StepLayout/StepLayoutContainer.js.map +1 -0
  14. package/dist/src/components/generic/Layout/StepLayout/StepLayoutLeftContent.d.ts +3 -0
  15. package/dist/src/components/generic/Layout/StepLayout/StepLayoutLeftContent.js +25 -0
  16. package/dist/src/components/generic/Layout/StepLayout/StepLayoutLeftContent.js.map +1 -0
  17. package/dist/src/components/generic/Layout/StepLayout/StepLayoutRightContent.d.ts +3 -0
  18. package/dist/src/components/generic/Layout/StepLayout/StepLayoutRightContent.js +25 -0
  19. package/dist/src/components/generic/Layout/StepLayout/StepLayoutRightContent.js.map +1 -0
  20. package/dist/src/components/generic/Layout/StepLayout/index.d.ts +3 -0
  21. package/dist/src/components/generic/Layout/StepLayout/index.js +13 -0
  22. package/dist/src/components/generic/Layout/StepLayout/index.js.map +1 -0
  23. package/dist/src/components/generic/date/DatePicker.js +10 -11
  24. package/dist/src/components/generic/date/DatePicker.js.map +1 -1
  25. package/dist/src/components/steps/addons/AddonList.js +32 -12
  26. package/dist/src/components/steps/addons/AddonList.js.map +1 -1
  27. package/dist/src/components/steps/hotel/HotelCard.js +24 -11
  28. package/dist/src/components/steps/hotel/HotelCard.js.map +1 -1
  29. package/dist/src/components/summary/BESummaryAddonRow.js +4 -3
  30. package/dist/src/components/summary/BESummaryAddonRow.js.map +1 -1
  31. package/dist/src/contexts/BasketContext/BasketContextType.d.ts +1 -0
  32. package/dist/src/contexts/BasketContext/BasketContextType.js.map +1 -1
  33. package/dist/src/contexts/BasketContext/BasketContextWrapper.js +38 -8
  34. package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
  35. package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +1 -0
  36. package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
  37. package/dist/src/index.d.ts +1 -0
  38. package/dist/src/index.js +3 -1
  39. package/dist/src/index.js.map +1 -1
  40. package/dist/src/models/Addon/Addon.d.ts +1 -0
  41. package/dist/src/models/Addon/Addon.js +10 -1
  42. package/dist/src/models/Addon/Addon.js.map +1 -1
  43. package/dist/src/models/BasketAddonRow.js +26 -19
  44. package/dist/src/models/BasketAddonRow.js.map +1 -1
  45. package/dist/src/pages/findReservation/ReservationRow.js +4 -6
  46. package/dist/src/pages/findReservation/ReservationRow.js.map +1 -1
  47. package/dist/src/pages/steps/StepAddon/StepAddonComponent.js +32 -9
  48. package/dist/src/pages/steps/StepAddon/StepAddonComponent.js.map +1 -1
  49. package/dist/src/pages/steps/StepAddon/StepAddonLoader.js +45 -44
  50. package/dist/src/pages/steps/StepAddon/StepAddonLoader.js.map +1 -1
  51. package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js +35 -12
  52. package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js.map +1 -1
  53. package/dist/src/pages/steps/StepConfirmation/StepConfirmationLoader.js +10 -10
  54. package/dist/src/pages/steps/StepConfirmation/StepConfirmationLoader.js.map +1 -1
  55. package/dist/src/pages/steps/StepRoom/StepRoomComponent.js +33 -33
  56. package/dist/src/pages/steps/StepRoom/StepRoomComponent.js.map +1 -1
  57. package/dist/src/pages/steps/StepRoom/StepRoomLoader.js +10 -10
  58. package/dist/src/pages/steps/StepRoom/StepRoomLoader.js.map +1 -1
  59. package/dist/src/providers/FeatureProvider.js +2 -0
  60. package/dist/src/providers/FeatureProvider.js.map +1 -1
  61. package/dist/src/providers/feature/FullPageEngineSmallSpacingFeature.d.ts +6 -0
  62. package/dist/src/providers/feature/FullPageEngineSmallSpacingFeature.js +10 -0
  63. package/dist/src/providers/feature/FullPageEngineSmallSpacingFeature.js.map +1 -0
  64. package/dist/src/reducers/BasketReducer.d.ts +2 -1
  65. package/dist/src/reducers/BasketReducer.js +7 -0
  66. package/dist/src/reducers/BasketReducer.js.map +1 -1
  67. package/dist/src/util/TotalCalculator.js +7 -1
  68. package/dist/src/util/TotalCalculator.js.map +1 -1
  69. package/dist/test.bundle.js +1 -1
  70. package/dist/vendors.bundle.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/399.bundle.js +0 -2
  73. package/dist/tests/jest/engines/RoomstayThemeEngine.test.d.ts +0 -1
  74. package/dist/tests/jest/engines/RoomstayThemeEngine.test.js +0 -41
  75. package/dist/tests/jest/engines/RoomstayThemeEngine.test.js.map +0 -1
  76. package/dist/tests/jest/events/EventManager.test.d.ts +0 -1
  77. package/dist/tests/jest/events/EventManager.test.js +0 -101
  78. package/dist/tests/jest/events/EventManager.test.js.map +0 -1
  79. package/dist/tests/jest/helpers/ObjectHelper.test.d.ts +0 -1
  80. package/dist/tests/jest/helpers/ObjectHelper.test.js +0 -72
  81. package/dist/tests/jest/helpers/ObjectHelper.test.js.map +0 -1
  82. package/dist/tests/jest/models/RoomRate.test.d.ts +0 -1
  83. package/dist/tests/jest/models/RoomRate.test.js +0 -133
  84. package/dist/tests/jest/models/RoomRate.test.js.map +0 -1
  85. package/dist/tests/jest/providers/LanguageProvider.test.d.ts +0 -1
  86. package/dist/tests/jest/providers/LanguageProvider.test.js +0 -32
  87. package/dist/tests/jest/providers/LanguageProvider.test.js.map +0 -1
  88. package/dist/tests/jest/providers/SessionProvider.test.d.ts +0 -1
  89. package/dist/tests/jest/providers/SessionProvider.test.js +0 -230
  90. package/dist/tests/jest/providers/SessionProvider.test.js.map +0 -1
  91. package/dist/tests/jest/providers/storage/LocalStorageProvider.test.d.ts +0 -1
  92. package/dist/tests/jest/providers/storage/LocalStorageProvider.test.js +0 -126
  93. package/dist/tests/jest/providers/storage/LocalStorageProvider.test.js.map +0 -1
  94. package/dist/tests/jest/reducers/BasketReducer.test.d.ts +0 -1
  95. package/dist/tests/jest/reducers/BasketReducer.test.js +0 -103
  96. package/dist/tests/jest/reducers/BasketReducer.test.js.map +0 -1
  97. package/dist/tests/offline/RoomstayBestRateAlert.d.ts +0 -1
  98. package/dist/tests/offline/RoomstayBestRateAlert.js +0 -48
  99. package/dist/tests/offline/RoomstayBestRateAlert.js.map +0 -1
  100. package/dist/tests/offline/entry/ReactWrapper.d.ts +0 -1
  101. package/dist/tests/offline/entry/ReactWrapper.js +0 -136
  102. package/dist/tests/offline/entry/ReactWrapper.js.map +0 -1
  103. package/dist/tests/offline/entry/allEngines.d.ts +0 -1
  104. package/dist/tests/offline/entry/allEngines.js +0 -50
  105. package/dist/tests/offline/entry/allEngines.js.map +0 -1
  106. package/dist/tests/offline/entry/components/TestPicker.d.ts +0 -1
  107. package/dist/tests/offline/entry/components/TestPicker.js +0 -156
  108. package/dist/tests/offline/entry/components/TestPicker.js.map +0 -1
  109. package/dist/tests/setupTests.d.ts +0 -0
  110. package/dist/tests/setupTests.js +0 -12
  111. package/dist/tests/setupTests.js.map +0 -1
  112. /package/dist/{399.bundle.js.LICENSE.txt → 535.bundle.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- export {};
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- document.body.appendChild(document.createElement('dijiengine'));
7
- const RoomstayThemeEngine_1 = __importDefault(require("../../../src/providers/RoomstayThemeEngine"));
8
- describe('Roomstay Theme Engine', () => {
9
- RoomstayThemeEngine_1.default.EngineContainer = document.createElement('div');
10
- beforeEach(() => {
11
- RoomstayThemeEngine_1.default.init();
12
- });
13
- describe('Registering Scripts', () => {
14
- it('Appends a script based on url to the target container', () => {
15
- var _a, _b;
16
- expect((_a = RoomstayThemeEngine_1.default.ScriptContainer) === null || _a === void 0 ? void 0 : _a.childNodes.length).toBe(0);
17
- RoomstayThemeEngine_1.default.loadScript('https://notarealscript.com/wejustneedatestscript', 'cool script');
18
- expect((_b = RoomstayThemeEngine_1.default.ScriptContainer) === null || _b === void 0 ? void 0 : _b.childNodes.length).toBe(1);
19
- });
20
- });
21
- describe('Finding Elements on the Dom created by Roomstay', () => {
22
- it('creates an element, and inserts it to the dom with a specific name', () => {
23
- expect(RoomstayThemeEngine_1.default.EngineContainer.childNodes.length).toBe(2);
24
- RoomstayThemeEngine_1.default.createElementOrReuseExisting('script', 'vgssource');
25
- expect(RoomstayThemeEngine_1.default.EngineContainer.childNodes.length).toBe(3);
26
- });
27
- it('creates a new node with a prefixed name', () => {
28
- var _a;
29
- RoomstayThemeEngine_1.default.ScriptContainer = document.createElement('div');
30
- const container = RoomstayThemeEngine_1.default.createElementOrReuseExisting('script', 'vgssource');
31
- expect((_a = container.getAttribute('name')) === null || _a === void 0 ? void 0 : _a.startsWith('roomstay')).toBeTruthy();
32
- });
33
- it('returns found node if it already exists', () => {
34
- RoomstayThemeEngine_1.default.createElementOrReuseExisting('script', 'vgssource');
35
- expect(RoomstayThemeEngine_1.default.EngineContainer.childNodes.length).toBe(3);
36
- RoomstayThemeEngine_1.default.createElementOrReuseExisting('script', 'vgssource');
37
- expect(RoomstayThemeEngine_1.default.EngineContainer.childNodes.length).toBe(3);
38
- });
39
- });
40
- });
41
- //# sourceMappingURL=RoomstayThemeEngine.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RoomstayThemeEngine.test.js","sourceRoot":"/","sources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,EAAE,GAAG,EAAE;;YAC/C,6BAAmB,CAAC,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAEpE,MAAM,SAAS,GAAG,6BAAmB,CAAC,4BAA4B,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAE1F,MAAM,CAAC,MAAA,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,0CAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QAChF,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;YAC/C,6BAAmB,CAAC,4BAA4B,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAExE,MAAM,CAAC,6BAAmB,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAEtE,6BAAmB,CAAC,4BAA4B,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAExE,MAAM,CAAC,6BAAmB,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["document.body.appendChild(document.createElement('dijiengine'));\n\nimport RoomstayThemeEngine from \"../../../src/providers/RoomstayThemeEngine\";\n\ndescribe('Roomstay Theme Engine', () => {\n RoomstayThemeEngine.EngineContainer = document.createElement('div');\n\n beforeEach(() => {\n RoomstayThemeEngine.init();\n });\n\n describe('Registering Scripts', () => {\n\n it('Appends a script based on url to the target container', () => {\n\n expect(RoomstayThemeEngine.ScriptContainer?.childNodes.length).toBe(0);\n\n RoomstayThemeEngine.loadScript('https://notarealscript.com/wejustneedatestscript', 'cool script');\n\n expect(RoomstayThemeEngine.ScriptContainer?.childNodes.length).toBe(1);\n });\n });\n\n describe('Finding Elements on the Dom created by Roomstay', () => {\n it('creates an element, and inserts it to the dom with a specific name', () => {\n expect(RoomstayThemeEngine.EngineContainer.childNodes.length).toBe(2);\n\n RoomstayThemeEngine.createElementOrReuseExisting('script', 'vgssource');\n\n expect(RoomstayThemeEngine.EngineContainer.childNodes.length).toBe(3);\n });\n\n it('creates a new node with a prefixed name', () => {\n RoomstayThemeEngine.ScriptContainer = document.createElement('div');\n\n const container = RoomstayThemeEngine.createElementOrReuseExisting('script', 'vgssource');\n \n expect(container.getAttribute('name')?.startsWith('roomstay')).toBeTruthy();\n })\n\n it('returns found node if it already exists', () => {\n RoomstayThemeEngine.createElementOrReuseExisting('script', 'vgssource');\n \n expect(RoomstayThemeEngine.EngineContainer.childNodes.length).toBe(3);\n\n RoomstayThemeEngine.createElementOrReuseExisting('script', 'vgssource');\n\n expect(RoomstayThemeEngine.EngineContainer.childNodes.length).toBe(3);\n });\n });\n});"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,101 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const events_1 = require("../../../src/events/index.js");
16
- const RoomstayEvent_1 = require("../../../src/events/RoomstayEvent");
17
- const RoomstayEventManager_1 = __importDefault(require("../../../src/events/RoomstayEventManager"));
18
- const BasketRow_1 = __importDefault(require("../../../src/models/BasketRow"));
19
- describe('Generic event manager tests', () => {
20
- describe('Adding new events', () => {
21
- it('Successfully adds a new event listener', () => {
22
- const addResponse = RoomstayEventManager_1.default.addEvent(RoomstayEvent_1.RoomstayEvent, () => __awaiter(void 0, void 0, void 0, function* () { return true; }));
23
- expect(addResponse).toBe(true);
24
- });
25
- it('Fails to add a new event listener without a callback', () => {
26
- //@ts-ignore
27
- const addResponse = RoomstayEventManager_1.default.addEvent('');
28
- expect(addResponse).toBe(false);
29
- });
30
- it('Fails to add a new event listener that is not callable', () => {
31
- //@ts-ignore
32
- const addResponse = RoomstayEventManager_1.default.addEvent('', 'things');
33
- console.log(events_1.StepCheckoutViewEvent.getLabel());
34
- expect(addResponse).toBe(false);
35
- });
36
- it('Is possible to add an event listener by name, or class', () => __awaiter(void 0, void 0, void 0, function* () {
37
- const callbackForClass = jest.fn((event) => __awaiter(void 0, void 0, void 0, function* () {
38
- return true;
39
- }));
40
- const callbackForString = jest.fn((event) => __awaiter(void 0, void 0, void 0, function* () {
41
- return true;
42
- }));
43
- RoomstayEventManager_1.default.addEvent(events_1.AddToCartEvent, callbackForClass);
44
- RoomstayEventManager_1.default.addEvent('Basket/Add', callbackForString);
45
- const basketAddEvent = new events_1.AddToCartEvent(new BasketRow_1.default(), []);
46
- yield RoomstayEventManager_1.default.raise(basketAddEvent);
47
- expect(callbackForClass).toHaveBeenCalled();
48
- expect(callbackForString).toHaveBeenCalled();
49
- }));
50
- it('Does not crash the rest of the app if one of the event listeners dies', () => __awaiter(void 0, void 0, void 0, function* () {
51
- const callback = () => __awaiter(void 0, void 0, void 0, function* () {
52
- throw new Error('Deliberate failure!');
53
- });
54
- RoomstayEventManager_1.default.addEvent(RoomstayEvent_1.RoomstayEvent, callback);
55
- const event = new RoomstayEvent_1.RoomstayEvent();
56
- expect((() => __awaiter(void 0, void 0, void 0, function* () {
57
- yield RoomstayEventManager_1.default.raise(event);
58
- }))()).resolves.not.toThrowError();
59
- }));
60
- });
61
- describe('Raising events', () => {
62
- it('Successfully calls a raised event', () => __awaiter(void 0, void 0, void 0, function* () {
63
- const callback = jest.fn((event) => __awaiter(void 0, void 0, void 0, function* () {
64
- return true;
65
- }));
66
- RoomstayEventManager_1.default.addEvent(RoomstayEvent_1.RoomstayEvent, callback);
67
- const newEvent = new RoomstayEvent_1.RoomstayEvent();
68
- yield RoomstayEventManager_1.default.raise(newEvent);
69
- expect(callback).toHaveBeenCalled();
70
- }));
71
- it('Successfully calls all raised events, not just the first', () => __awaiter(void 0, void 0, void 0, function* () {
72
- const callback = jest.fn((event) => __awaiter(void 0, void 0, void 0, function* () {
73
- return true;
74
- }));
75
- const callback2 = jest.fn((event) => __awaiter(void 0, void 0, void 0, function* () {
76
- return true;
77
- }));
78
- RoomstayEventManager_1.default.addEvent(RoomstayEvent_1.RoomstayEvent, callback);
79
- RoomstayEventManager_1.default.addEvent(RoomstayEvent_1.RoomstayEvent, callback2);
80
- const newEvent = new RoomstayEvent_1.RoomstayEvent();
81
- yield RoomstayEventManager_1.default.raise(newEvent);
82
- expect(callback).toHaveBeenCalled();
83
- expect(callback2).toHaveBeenCalled();
84
- }));
85
- it('Throws an exception if an improper object is passed to raise event function', () => __awaiter(void 0, void 0, void 0, function* () {
86
- const raiseResponseNoPrototype = RoomstayEventManager_1.default.raise('');
87
- expect(raiseResponseNoPrototype).rejects.toThrowError();
88
- const raiseResponseNoGetLabel = RoomstayEventManager_1.default.raise({});
89
- expect(raiseResponseNoGetLabel).rejects.toThrowError();
90
- }));
91
- it("Does not add event listener, if it's not possible to get a label", () => __awaiter(void 0, void 0, void 0, function* () {
92
- //@ts-ignore
93
- const addResponse = RoomstayEventManager_1.default.addEvent({}, () => { });
94
- expect(addResponse).toBeFalsy();
95
- //@ts-ignore
96
- const undefinedAddResponse = RoomstayEventManager_1.default.addEvent(undefined, () => { });
97
- expect(undefinedAddResponse).toBeFalsy();
98
- }));
99
- });
100
- });
101
- //# sourceMappingURL=EventManager.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventManager.test.js","sourceRoot":"/","sources":["tests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,OAAO,CAAC,YAAY,EAAE,CAAC;QAC3D,CAAC,CAAA,CAAC,CAAC;QAEH,EAAE,CAAC,kEAAkE,EAAE,GAAS,EAAE;YAC9E,YAAY;YACZ,MAAM,WAAW,GAAG,8BAAoB,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAEhE,MAAM,CAAC,WAAW,CAAC,CAAC,SAAS,EAAE,CAAC;YAEhC,YAAY;YACZ,MAAM,oBAAoB,GAAG,8BAAoB,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAChF,MAAM,CAAC,oBAAoB,CAAC,CAAC,SAAS,EAAE,CAAC;QAC7C,CAAC,CAAA,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { AddToCartEvent, StepCheckoutViewEvent } from '@frontend/events';\nimport { RoomstayEvent } from '../../../src/events/RoomstayEvent';\nimport RoomstayEventManager from '../../../src/events/RoomstayEventManager';\nimport BasketRow from '../../../src/models/BasketRow';\n\ndescribe('Generic event manager tests', () => {\n describe('Adding new events', () => {\n it('Successfully adds a new event listener', () => {\n const addResponse = RoomstayEventManager.addEvent(RoomstayEvent, async () => true);\n\n expect(addResponse).toBe(true);\n });\n\n it('Fails to add a new event listener without a callback', () => {\n //@ts-ignore\n const addResponse = RoomstayEventManager.addEvent('');\n\n expect(addResponse).toBe(false);\n });\n\n it('Fails to add a new event listener that is not callable', () => {\n //@ts-ignore\n const addResponse = RoomstayEventManager.addEvent('', 'things');\n\n console.log(StepCheckoutViewEvent.getLabel());\n\n expect(addResponse).toBe(false);\n });\n\n it('Is possible to add an event listener by name, or class', async () => {\n const callbackForClass = jest.fn(async (event: RoomstayEvent) => {\n return true;\n });\n\n const callbackForString = jest.fn(async (event: RoomstayEvent) => {\n return true;\n });\n\n RoomstayEventManager.addEvent(AddToCartEvent, callbackForClass);\n RoomstayEventManager.addEvent('Basket/Add', callbackForString);\n\n const basketAddEvent = new AddToCartEvent(new BasketRow(), []);\n await RoomstayEventManager.raise(basketAddEvent);\n\n expect(callbackForClass).toHaveBeenCalled();\n expect(callbackForString).toHaveBeenCalled();\n });\n\n it('Does not crash the rest of the app if one of the event listeners dies', async () => {\n const callback = async () => {\n throw new Error('Deliberate failure!');\n };\n\n RoomstayEventManager.addEvent(RoomstayEvent, callback);\n\n const event = new RoomstayEvent();\n\n expect(\n (async () => {\n await RoomstayEventManager.raise(event);\n })()\n ).resolves.not.toThrowError();\n });\n });\n\n describe('Raising events', () => {\n it('Successfully calls a raised event', async () => {\n const callback = jest.fn(async (event: RoomstayEvent) => {\n return true;\n });\n\n RoomstayEventManager.addEvent(RoomstayEvent, callback);\n\n const newEvent = new RoomstayEvent();\n\n await RoomstayEventManager.raise(newEvent);\n\n expect(callback).toHaveBeenCalled();\n });\n\n it('Successfully calls all raised events, not just the first', async () => {\n const callback = jest.fn(async (event: RoomstayEvent) => {\n return true;\n });\n\n const callback2 = jest.fn(async (event: RoomstayEvent) => {\n return true;\n });\n\n RoomstayEventManager.addEvent(RoomstayEvent, callback);\n RoomstayEventManager.addEvent(RoomstayEvent, callback2);\n\n const newEvent = new RoomstayEvent();\n await RoomstayEventManager.raise(newEvent);\n\n expect(callback).toHaveBeenCalled();\n expect(callback2).toHaveBeenCalled();\n });\n\n it('Throws an exception if an improper object is passed to raise event function', async () => {\n const raiseResponseNoPrototype = RoomstayEventManager.raise('');\n\n expect(raiseResponseNoPrototype).rejects.toThrowError();\n\n const raiseResponseNoGetLabel = RoomstayEventManager.raise({});\n expect(raiseResponseNoGetLabel).rejects.toThrowError();\n });\n\n it(\"Does not add event listener, if it's not possible to get a label\", async () => {\n //@ts-ignore\n const addResponse = RoomstayEventManager.addEvent({}, () => {});\n\n expect(addResponse).toBeFalsy();\n\n //@ts-ignore\n const undefinedAddResponse = RoomstayEventManager.addEvent(undefined, () => {});\n expect(undefinedAddResponse).toBeFalsy();\n });\n });\n});\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const ObjectHelper_1 = require("../../../src/util/ObjectHelper");
4
- describe('Object Helper', () => {
5
- describe('Merge Deep', () => {
6
- it('should return object rather than null', () => {
7
- const override = null;
8
- const override2 = {
9
- Navigation: {
10
- Title: 'Title',
11
- },
12
- };
13
- const result = (0, ObjectHelper_1.mergeDeep)(override, override2);
14
- const result1 = (0, ObjectHelper_1.mergeDeep)(override2, override);
15
- expect(result.Navigation.Title).toEqual('Title');
16
- expect(result1.Navigation.Title).toEqual('Title');
17
- });
18
- it('should prioritize object rather than primitive value', function () {
19
- const override = {
20
- Navigation: {
21
- Title: 'Title',
22
- },
23
- };
24
- const override1 = {
25
- Navigation: {
26
- Title: {
27
- Top: 'Top',
28
- },
29
- },
30
- };
31
- const result = (0, ObjectHelper_1.mergeDeep)(override, override1);
32
- const result1 = (0, ObjectHelper_1.mergeDeep)(override1, override);
33
- expect(result.Navigation.Title.Top).toEqual('Top');
34
- expect(result1.Navigation.Title.Top).toEqual('Top');
35
- });
36
- it('should update new value', function () {
37
- const override = {
38
- Navigation: {
39
- Title: 'Title',
40
- },
41
- };
42
- const override1 = {
43
- Navigation: {
44
- Title: 'Updated Title',
45
- },
46
- };
47
- const result = (0, ObjectHelper_1.mergeDeep)(override, override1);
48
- const result1 = (0, ObjectHelper_1.mergeDeep)(override1, override);
49
- expect(result.Navigation.Title).toEqual('Updated Title');
50
- expect(result1.Navigation.Title).toEqual('Title');
51
- });
52
- it('should not mutate inputs', function () {
53
- const override = {
54
- Navigation: {
55
- Title: 'Title',
56
- },
57
- };
58
- const override1 = {
59
- Navigation: {
60
- Title: 'Updated Title',
61
- },
62
- };
63
- (0, ObjectHelper_1.mergeDeep)(override, override1);
64
- expect(override.Navigation.Title).toEqual('Title');
65
- expect(override1.Navigation.Title).toEqual('Updated Title');
66
- (0, ObjectHelper_1.mergeDeep)(override1, override);
67
- expect(override.Navigation.Title).toEqual('Title');
68
- expect(override1.Navigation.Title).toEqual('Updated Title');
69
- });
70
- });
71
- });
72
- //# sourceMappingURL=ObjectHelper.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ObjectHelper.test.js","sourceRoot":"/","sources":["tests/jest/helpers/ObjectHelper.test.ts"],"names":[],"mappings":";;AAAA,iEAA2D;AAE3D,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC3B,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;YAC7C,MAAM,QAAQ,GAAQ,IAAI,CAAC;YAE3B,MAAM,SAAS,GAAG;gBACd,UAAU,EAAE;oBACR,KAAK,EAAE,OAAO;iBACjB;aACJ,CAAC;YAEF,MAAM,MAAM,GAAG,IAAA,wBAAS,EAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAC9C,MAAM,OAAO,GAAG,IAAA,wBAAS,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YAE/C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,sDAAsD,EAAE;YACvD,MAAM,QAAQ,GAAG;gBACb,UAAU,EAAE;oBACR,KAAK,EAAE,OAAO;iBACjB;aACJ,CAAC;YAEF,MAAM,SAAS,GAAG;gBACd,UAAU,EAAE;oBACR,KAAK,EAAE;wBACH,GAAG,EAAE,KAAK;qBACb;iBACJ;aACJ,CAAC;YACF,MAAM,MAAM,GAAG,IAAA,wBAAS,EAAM,QAAQ,EAAE,SAAS,CAAC,CAAC;YACnD,MAAM,OAAO,GAAG,IAAA,wBAAS,EAAM,SAAS,EAAE,QAAQ,CAAC,C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YAC5D,IAAA,wBAAS,EAAM,SAAS,EAAE,QAAQ,CAAC,CAAC;YACpC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACnD,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { mergeDeep } from '../../../src/util/ObjectHelper';\n\ndescribe('Object Helper', () => {\n describe('Merge Deep', () => {\n it('should return object rather than null', () => {\n const override: any = null;\n\n const override2 = {\n Navigation: {\n Title: 'Title',\n },\n };\n\n const result = mergeDeep(override, override2);\n const result1 = mergeDeep(override2, override);\n\n expect(result.Navigation.Title).toEqual('Title');\n expect(result1.Navigation.Title).toEqual('Title');\n });\n it('should prioritize object rather than primitive value', function () {\n const override = {\n Navigation: {\n Title: 'Title',\n },\n };\n\n const override1 = {\n Navigation: {\n Title: {\n Top: 'Top',\n },\n },\n };\n const result = mergeDeep<any>(override, override1);\n const result1 = mergeDeep<any>(override1, override);\n expect(result.Navigation.Title.Top).toEqual('Top');\n expect(result1.Navigation.Title.Top).toEqual('Top');\n });\n it('should update new value', function () {\n const override = {\n Navigation: {\n Title: 'Title',\n },\n };\n\n const override1 = {\n Navigation: {\n Title: 'Updated Title',\n },\n };\n const result = mergeDeep<any>(override, override1);\n const result1 = mergeDeep<any>(override1, override);\n expect(result.Navigation.Title).toEqual('Updated Title');\n expect(result1.Navigation.Title).toEqual('Title');\n });\n it('should not mutate inputs', function () {\n const override = {\n Navigation: {\n Title: 'Title',\n },\n };\n\n const override1 = {\n Navigation: {\n Title: 'Updated Title',\n },\n };\n mergeDeep<any>(override, override1);\n expect(override.Navigation.Title).toEqual('Title');\n expect(override1.Navigation.Title).toEqual('Updated Title');\n mergeDeep<any>(override1, override);\n expect(override.Navigation.Title).toEqual('Title');\n expect(override1.Navigation.Title).toEqual('Updated Title');\n });\n });\n});\n"]}
@@ -1 +0,0 @@
1
- import '../../../src/api/BookingAPI';
@@ -1,133 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- require("../../../src/api/BookingAPI");
7
- const RoomRate_1 = require("../../../src/models/Room/RoomRate");
8
- const dayjs_1 = __importDefault(require("dayjs"));
9
- const roomNightFactory = (obj) => {
10
- const partial = Object.assign({ date: (0, dayjs_1.default)(), cost: '0', tax: '0', fee: '0', discount: '0', available: '0', total: '0' }, obj);
11
- partial.total = [partial.cost, partial.tax, partial.fee].reduce((previousValue, currentValue) => {
12
- return parseFloat(previousValue) + parseFloat(currentValue) + '';
13
- });
14
- return partial;
15
- };
16
- const roomRateFactory = (name, code, nightRates, description, isMemberOnly) => {
17
- return RoomRate_1.RoomRate.fromData({
18
- name,
19
- code,
20
- nightRates,
21
- description,
22
- isMemberOnly,
23
- });
24
- };
25
- const rateIncludingFeesAndTaxes = roomRateFactory('Generic Rate', 'ABCD', {
26
- '20/06/2022': roomNightFactory({
27
- cost: '20',
28
- }),
29
- });
30
- const rateExcludingFeesAndTaxes = roomRateFactory('Generic Rate', 'ABCD', {
31
- '20/06/2022': roomNightFactory({
32
- cost: '20',
33
- fee: '20',
34
- tax: '20',
35
- }),
36
- });
37
- const rateExcludingTaxes = roomRateFactory('Generic Rate', 'ABCD', {
38
- '20/06/2022': roomNightFactory({
39
- cost: '20',
40
- fee: '20',
41
- }),
42
- });
43
- const rateExcludingFees = roomRateFactory('Generic Rate', 'ABCD', {
44
- '20/06/2022': roomNightFactory({
45
- cost: '20',
46
- tax: '20',
47
- }),
48
- });
49
- const rateWithTaxLast = roomRateFactory('Generic Rate', 'ABCD', {
50
- '20/06/2022': roomNightFactory({
51
- cost: '20',
52
- }),
53
- '21/06/2022': roomNightFactory({
54
- cost: '20',
55
- fee: '10',
56
- }),
57
- });
58
- const rateWithDiscountApplied = roomRateFactory('Rate with Tax', 'DISCOUNT', {
59
- '20/06/22': roomNightFactory({
60
- cost: '50',
61
- fee: '20',
62
- discount: '15',
63
- }),
64
- '21/06/22': roomNightFactory({
65
- cost: '90',
66
- fee: '20',
67
- discount: '15',
68
- }),
69
- });
70
- const memberOnlyRate = roomRateFactory('MOD Rate', 'MOD', {}, '', true);
71
- describe('Room Rate logic', () => {
72
- describe('Room Rate Tax Inclusion', () => {
73
- it('Returns correct pricing type for each rate', () => {
74
- expect(rateIncludingFeesAndTaxes.getPriceType()).toBe(RoomRate_1.RoomRatePriceInclusion.IncludingFeesAndTaxes);
75
- expect(rateExcludingFeesAndTaxes.getPriceType()).toBe(RoomRate_1.RoomRatePriceInclusion.ExcludingFeesAndTaxes);
76
- expect(rateExcludingTaxes.getPriceType()).toBe(RoomRate_1.RoomRatePriceInclusion.ExcludingTaxes);
77
- expect(rateExcludingFees.getPriceType()).toBe(RoomRate_1.RoomRatePriceInclusion.ExcludingFees);
78
- });
79
- it('Accurately picks up the correct average pricing type if more than one night is selected', () => {
80
- expect(rateWithTaxLast.getPriceType()).toBe(RoomRate_1.RoomRatePriceInclusion.ExcludingTaxes);
81
- });
82
- });
83
- describe('Total Price Calculations', () => {
84
- it('Calculates total price, with tax & fee inclusions', () => {
85
- expect(rateWithTaxLast.getTotalPrice()).toBe(50);
86
- });
87
- it('Calculates total cost, without tax & fee inclusions', () => {
88
- expect(rateWithTaxLast.getTotalPrice(true)).toBe(40);
89
- });
90
- });
91
- describe('Average Price Calculations', () => {
92
- it('Calculates average price, with tax & fee inclusions', () => {
93
- expect(rateWithTaxLast.getAveragePrice()).toBe(25);
94
- });
95
- it('Calculates total cost, without tax & fee inclusions', () => {
96
- expect(rateWithTaxLast.getAveragePrice(true)).toBe(20);
97
- });
98
- });
99
- describe('Total Price With Discount', () => {
100
- it('Returns Total price Before Discount applied', () => {
101
- expect(rateWithDiscountApplied.getTotalPriceBeforeDiscount()).toBe(210);
102
- });
103
- it('Returns total cost before Discount is applied', () => {
104
- expect(rateWithDiscountApplied.getTotalPriceBeforeDiscount(true)).toBe(170);
105
- });
106
- });
107
- describe('Average Price With Discount', () => {
108
- it('Returns Total price Before Discount applied', () => {
109
- expect(rateWithDiscountApplied.getAveragePriceBeforeDiscount()).toBe(105);
110
- });
111
- it('Returns total cost before Discount is applied', () => {
112
- expect(rateWithDiscountApplied.getAveragePriceBeforeDiscount(true)).toBe(85);
113
- });
114
- });
115
- describe('Sort Value', () => {
116
- it('Sort Value to be the average price', () => {
117
- expect(rateWithDiscountApplied.getSortValue()).toBe(90);
118
- });
119
- });
120
- describe('Total fees included', () => {
121
- it('Displays the full only fees ammount', () => {
122
- expect(rateExcludingFeesAndTaxes.getTotalFees()).toBe(20);
123
- expect(rateWithDiscountApplied.getTotalFees()).toBe(40);
124
- });
125
- });
126
- describe('Total Taxes included', () => {
127
- it('Displays the full only tax ammount', () => {
128
- expect(rateExcludingFeesAndTaxes.getTotalTaxes()).toBe(20);
129
- expect(rateWithDiscountApplied.getTotalTaxes()).toBe(0);
130
- });
131
- });
132
- });
133
- //# sourceMappingURL=RoomRate.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RoomRate.test.js","sourceRoot":"/","sources":["tests/jest/models/RoomRate.test.ts"],"names":[],"mappings":";;;;;AAAA,uCAAqC;AAGrC,gEAAqF;AACrF,kDAA0B;AAG1B,MAAM,gBAAgB,GAAG,CAAC,GAAuB,EAAa,EAAE;IAC5D,MAAM,OAAO,mBACT,IAAI,EAAE,IAAA,eAAK,GAAE,EACb,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,GAAG,EACd,KAAK,EAAE,GAAG,IAEP,GAAG,CACT,CAAC;IAEF,OAAO,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,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C,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import '../../../src/api/BookingAPI';\n\nimport RoomNight from '../../../src/models/Room/RoomRateNight';\nimport { RoomRate, RoomRatePriceInclusion } from '../../../src/models/Room/RoomRate';\nimport dayjs from 'dayjs';\nimport RoomRateNight from '../../../src/models/Room/RoomRateNight';\n\nconst roomNightFactory = (obj: Partial<RoomNight>): RoomNight => {\n const partial = {\n date: dayjs(),\n cost: '0',\n tax: '0',\n fee: '0',\n discount: '0',\n available: '0',\n total: '0',\n\n ...obj,\n };\n\n partial.total = [partial.cost, partial.tax, partial.fee].reduce((previousValue, currentValue) => {\n return parseFloat(previousValue) + parseFloat(currentValue) + '';\n });\n\n return partial as RoomNight;\n};\n\nconst roomRateFactory = (name: string, code: string, nightRates: { [date: string]: RoomRateNight }, description?: string, isMemberOnly?: boolean) => {\n return RoomRate.fromData({\n name,\n code,\n nightRates,\n description,\n isMemberOnly,\n });\n};\n\nconst rateIncludingFeesAndTaxes = roomRateFactory('Generic Rate', 'ABCD', {\n '20/06/2022': roomNightFactory({\n cost: '20',\n }),\n});\n\nconst rateExcludingFeesAndTaxes = roomRateFactory('Generic Rate', 'ABCD', {\n '20/06/2022': roomNightFactory({\n cost: '20',\n fee: '20',\n tax: '20',\n }),\n});\n\nconst rateExcludingTaxes = roomRateFactory('Generic Rate', 'ABCD', {\n '20/06/2022': roomNightFactory({\n cost: '20',\n fee: '20',\n }),\n});\n\nconst rateExcludingFees = roomRateFactory('Generic Rate', 'ABCD', {\n '20/06/2022': roomNightFactory({\n cost: '20',\n tax: '20',\n }),\n});\n\nconst rateWithTaxLast = roomRateFactory('Generic Rate', 'ABCD', {\n '20/06/2022': roomNightFactory({\n cost: '20',\n }),\n '21/06/2022': roomNightFactory({\n cost: '20',\n fee: '10',\n }),\n});\n\nconst rateWithDiscountApplied = roomRateFactory('Rate with Tax', 'DISCOUNT', {\n '20/06/22': roomNightFactory({\n cost: '50',\n fee: '20',\n discount: '15',\n }),\n '21/06/22': roomNightFactory({\n cost: '90',\n fee: '20',\n discount: '15',\n }),\n});\n\nconst memberOnlyRate = roomRateFactory('MOD Rate', 'MOD', {}, '', true);\n\ndescribe('Room Rate logic', () => {\n describe('Room Rate Tax Inclusion', () => {\n it('Returns correct pricing type for each rate', () => {\n expect(rateIncludingFeesAndTaxes.getPriceType()).toBe(RoomRatePriceInclusion.IncludingFeesAndTaxes);\n\n expect(rateExcludingFeesAndTaxes.getPriceType()).toBe(RoomRatePriceInclusion.ExcludingFeesAndTaxes);\n\n expect(rateExcludingTaxes.getPriceType()).toBe(RoomRatePriceInclusion.ExcludingTaxes);\n\n expect(rateExcludingFees.getPriceType()).toBe(RoomRatePriceInclusion.ExcludingFees);\n });\n\n it('Accurately picks up the correct average pricing type if more than one night is selected', () => {\n expect(rateWithTaxLast.getPriceType()).toBe(RoomRatePriceInclusion.ExcludingTaxes);\n });\n });\n\n describe('Total Price Calculations', () => {\n it('Calculates total price, with tax & fee inclusions', () => {\n expect(rateWithTaxLast.getTotalPrice()).toBe(50);\n });\n\n it('Calculates total cost, without tax & fee inclusions', () => {\n expect(rateWithTaxLast.getTotalPrice(true)).toBe(40);\n });\n });\n\n describe('Average Price Calculations', () => {\n it('Calculates average price, with tax & fee inclusions', () => {\n expect(rateWithTaxLast.getAveragePrice()).toBe(25);\n });\n\n it('Calculates total cost, without tax & fee inclusions', () => {\n expect(rateWithTaxLast.getAveragePrice(true)).toBe(20);\n });\n });\n\n describe('Total Price With Discount', () => {\n it('Returns Total price Before Discount applied', () => {\n expect(rateWithDiscountApplied.getTotalPriceBeforeDiscount()).toBe(210);\n });\n\n it('Returns total cost before Discount is applied', () => {\n expect(rateWithDiscountApplied.getTotalPriceBeforeDiscount(true)).toBe(170);\n });\n });\n\n describe('Average Price With Discount', () => {\n it('Returns Total price Before Discount applied', () => {\n expect(rateWithDiscountApplied.getAveragePriceBeforeDiscount()).toBe(105);\n });\n\n it('Returns total cost before Discount is applied', () => {\n expect(rateWithDiscountApplied.getAveragePriceBeforeDiscount(true)).toBe(85);\n });\n });\n\n describe('Sort Value', () => {\n it('Sort Value to be the average price', () => {\n expect(rateWithDiscountApplied.getSortValue()).toBe(90);\n });\n });\n\n describe('Total fees included', () => {\n it('Displays the full only fees ammount', () => {\n expect(rateExcludingFeesAndTaxes.getTotalFees()).toBe(20);\n expect(rateWithDiscountApplied.getTotalFees()).toBe(40);\n });\n });\n\n describe('Total Taxes included', () => {\n it('Displays the full only tax ammount', () => {\n expect(rateExcludingFeesAndTaxes.getTotalTaxes()).toBe(20);\n expect(rateWithDiscountApplied.getTotalTaxes()).toBe(0);\n });\n });\n});\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const src_1 = require("../../../src");
4
- describe('Language Provider', () => {
5
- describe('Language Overrides', () => {
6
- it('merges language files together', () => {
7
- var _a, _b;
8
- const override = {
9
- Navigation: {
10
- Back: 'hello',
11
- },
12
- };
13
- src_1.LanguageProvider.registerOverride(src_1.Language.en_us, override);
14
- const i18nLanguages = src_1.LanguageProvider.getI18nMappedLanguages();
15
- expect((_a = i18nLanguages[src_1.Language.en_us]) === null || _a === void 0 ? void 0 : _a.translation.Navigation.Back).toEqual('hello');
16
- expect((_b = i18nLanguages[src_1.Language.en_us]) === null || _b === void 0 ? void 0 : _b.translation.Navigation.FindReservation).toEqual('Find reservations');
17
- });
18
- it('it should update if empty string', () => {
19
- var _a, _b;
20
- const override = {
21
- Navigation: {
22
- Back: '',
23
- },
24
- };
25
- src_1.LanguageProvider.registerOverride(src_1.Language.en_us, override);
26
- const i18nLanguages = src_1.LanguageProvider.getI18nMappedLanguages();
27
- expect((_a = i18nLanguages[src_1.Language.en_us]) === null || _a === void 0 ? void 0 : _a.translation.Navigation.Back).toEqual('');
28
- expect((_b = i18nLanguages[src_1.Language.en_us]) === null || _b === void 0 ? void 0 : _b.translation.Navigation.FindReservation).toEqual('Find reservations');
29
- });
30
- });
31
- });
32
- //# sourceMappingURL=LanguageProvider.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LanguageProvider.test.js","sourceRoot":"/","sources":["tests/jest/providers/LanguageProvider.test.ts"],"names":[],"mappings":";;AAAA,sCAAuE;AAEvE,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;;YACtC,MAAM,QAAQ,GAAsC;gBAChD,UAAU,EAAE;oBACR,IAAI,EAAE,OAAO;iBAChB;aACJ,CAAC;YAEF,sBAAgB,CAAC,gBAAgB,CAAC,cAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAE5D,MAAM,aAAa,GAAG,sBAAgB,CAAC,sBAAsB,EAAE,CAAC;YAEhE,MAAM,CAAC,MAAA,aAAa,CAAC,cAAQ,CAAC,KAAK,CAAC,0CAAE,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpF,MAAM,CAAC,MAAA,aAAa,CAAC,cAAQ,CAAC,KAAK,CAAC,0CAAE,WAAW,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAC/G,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;;YACxC,MAAM,QAAQ,GAAsC;gBAChD,UAAU,EAAE;oBACR,IAAI,EAAE,EAAE;iBACX;aACJ,CAAC;YAEF,sBAAgB,CAAC,gBAAgB,CAAC,cAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAE5D,MAAM,aAAa,GAAG,sBAAgB,CAAC,sBAAsB,EAAE,CAAC;YAEhE,MAAM,CAAC,MAAA,aAAa,CAAC,cAAQ,CAAC,KAAK,CAAC,0CAAE,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC/E,MAAM,CAAC,MAAA,aAAa,CAAC,cAAQ,CAAC,KAAK,CAAC,0CAAE,WAAW,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAC/G,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { Language, LanguageProvider, Translation } from '../../../src';\n\ndescribe('Language Provider', () => {\n describe('Language Overrides', () => {\n it('merges language files together', () => {\n const override: Partial<typeof Translation> | any = {\n Navigation: {\n Back: 'hello',\n },\n };\n\n LanguageProvider.registerOverride(Language.en_us, override);\n\n const i18nLanguages = LanguageProvider.getI18nMappedLanguages();\n\n expect(i18nLanguages[Language.en_us]?.translation.Navigation.Back).toEqual('hello');\n expect(i18nLanguages[Language.en_us]?.translation.Navigation.FindReservation).toEqual('Find reservations');\n });\n it('it should update if empty string', () => {\n const override: Partial<typeof Translation> | any = {\n Navigation: {\n Back: '',\n },\n };\n\n LanguageProvider.registerOverride(Language.en_us, override);\n\n const i18nLanguages = LanguageProvider.getI18nMappedLanguages();\n\n expect(i18nLanguages[Language.en_us]?.translation.Navigation.Back).toEqual('');\n expect(i18nLanguages[Language.en_us]?.translation.Navigation.FindReservation).toEqual('Find reservations');\n });\n });\n});\n"]}
@@ -1 +0,0 @@
1
- import '../../../src/api/BookingAPI';