@livepreso/api 6.42.1 → 6.45.0

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 (196) hide show
  1. package/.eslintrc.js +3 -0
  2. package/.rush/temp/256021b5963b4c0221d3dec247b697b9691a9b2c.log +10 -0
  3. package/.rush/temp/2a322f00f12cf9d1e64afe81275cc78d01c49050.log +10 -0
  4. package/.rush/temp/30061f1865447dcbb3f20a305061205f3dbe6091.log +10 -0
  5. package/.rush/temp/45522aea0dee8cb2be1a53248ba45bd235743b43.log +10 -0
  6. package/.rush/temp/58fcbb7f15a76326d40e0839ab179755da82a891.log +10 -0
  7. package/.rush/temp/5bc0bba70b733baa4dd976667ba0a1386e516186.log +10 -0
  8. package/.rush/temp/64f1bb696f8d7d7e72907b80df316b127f72e23e.log +10 -0
  9. package/.rush/temp/6f640f951414ea68adb65c17e4ed7527cde54faf.log +10 -0
  10. package/.rush/temp/7c7b958682d4ab5697530be47d0aac62efe1adf1.log +10 -0
  11. package/.rush/temp/82bfb987463fbcfebf04022e6ed00015c73879c8.log +10 -0
  12. package/.rush/temp/844034aa6e542115075e8f3dc5ffc640973e0064.log +10 -0
  13. package/.rush/temp/8b42957a7c15da1f29cb57bee125f13affa70dca.log +10 -0
  14. package/.rush/temp/a769db9d81a23000c0e9b1bf4f1a9a9e721d0d7c.log +10 -0
  15. package/.rush/temp/a87d3a8b4ece87ec66f27c86226a9f205617681f.log +10 -0
  16. package/.rush/temp/bb7a5bdcc4af4ad1507f81f33774b31f5b4e4fb7.log +10 -0
  17. package/.rush/temp/build-cache-tar.log +7 -0
  18. package/.rush/temp/c20e29ccaaa9231b38a28bb24451b4ce7562cdc0.log +10 -0
  19. package/.rush/temp/e21303db8f59b4625fd184c9114377d781fd24f8.log +10 -0
  20. package/.rush/temp/e6d303862765b6a5f41dd483d0f9ae083a1fae10.log +10 -0
  21. package/.rush/temp/eaf69fbc059d2f1258d7569136180d4a1d3c7072.log +10 -0
  22. package/.rush/temp/f85d279e2674966daaec83e1c3986a96f86ef304.log +10 -0
  23. package/.rush/temp/fc0a332c5b34c6b90006850cf2d93a48fb4b9a6e.log +10 -0
  24. package/.rush/temp/package-deps_build.json +152 -134
  25. package/.rush/temp/package-deps_test.json +172 -0
  26. package/.rush/temp/shrinkwrap-deps.json +946 -847
  27. package/CHANGELOG.json +41 -0
  28. package/CHANGELOG.md +22 -1
  29. package/api.build.log +3 -26
  30. package/babel.config.js +1 -1
  31. package/bin/test.sh +0 -1
  32. package/cjs/api.js +1 -1
  33. package/cjs/api.js.map +1 -1
  34. package/cjs/auth.js +38 -11
  35. package/cjs/auth.js.map +1 -1
  36. package/cjs/auth.spec.js +12 -6
  37. package/cjs/auth.spec.js.map +1 -1
  38. package/cjs/caching.js +3 -3
  39. package/cjs/collections/activity.js +2 -2
  40. package/cjs/collections/appointment-adjunct-tags.js +28 -0
  41. package/cjs/collections/appointment-adjunct-tags.js.map +1 -0
  42. package/cjs/collections/appointment-deckversion-tags.js +28 -0
  43. package/cjs/collections/appointment-deckversion-tags.js.map +1 -0
  44. package/cjs/collections/appointment-section-tags.js +28 -0
  45. package/cjs/collections/appointment-section-tags.js.map +1 -0
  46. package/cjs/collections/appointment-slide-tags.js +28 -0
  47. package/cjs/collections/appointment-slide-tags.js.map +1 -0
  48. package/cjs/collections/appointment-tags.js +208 -0
  49. package/cjs/collections/appointment-tags.js.map +1 -0
  50. package/cjs/collections/appointments.js +2 -2
  51. package/cjs/collections/auto-adjuncts.js +2 -2
  52. package/cjs/collections/base.js +84 -3
  53. package/cjs/collections/base.js.map +1 -1
  54. package/cjs/collections/base.spec.js +178 -0
  55. package/cjs/collections/base.spec.js.map +1 -1
  56. package/cjs/collections/deck-version-screenshots.js +62 -0
  57. package/cjs/collections/deck-version-screenshots.js.map +1 -0
  58. package/cjs/collections/deck-versions.js +2 -2
  59. package/cjs/collections/tags.js +28 -0
  60. package/cjs/collections/tags.js.map +1 -0
  61. package/cjs/collections.js +91 -0
  62. package/cjs/collections.js.map +1 -1
  63. package/cjs/models/activity-item.js +5 -3
  64. package/cjs/models/activity-item.js.map +1 -1
  65. package/cjs/models/appointment-adjunct-tags.js +52 -0
  66. package/cjs/models/appointment-adjunct-tags.js.map +1 -0
  67. package/cjs/models/appointment-deckversion-tags.js +52 -0
  68. package/cjs/models/appointment-deckversion-tags.js.map +1 -0
  69. package/cjs/models/appointment-duplicate.js +2 -2
  70. package/cjs/models/appointment-section-tags.js +52 -0
  71. package/cjs/models/appointment-section-tags.js.map +1 -0
  72. package/cjs/models/appointment-slide-tags.js +52 -0
  73. package/cjs/models/appointment-slide-tags.js.map +1 -0
  74. package/cjs/models/appointment-tags.js +16 -15
  75. package/cjs/models/appointment-tags.js.map +1 -1
  76. package/cjs/models/appointment.js +19 -3
  77. package/cjs/models/appointment.js.map +1 -1
  78. package/cjs/models/auto-adjunct.js +3 -1
  79. package/cjs/models/auto-adjunct.js.map +1 -1
  80. package/cjs/models/base.js +19 -1
  81. package/cjs/models/base.js.map +1 -1
  82. package/cjs/models/base.spec.js +9 -0
  83. package/cjs/models/base.spec.js.map +1 -1
  84. package/cjs/models/deck-tags.js +61 -0
  85. package/cjs/models/deck-tags.js.map +1 -0
  86. package/cjs/models/deck-version-screenshot.js +59 -0
  87. package/cjs/models/deck-version-screenshot.js.map +1 -0
  88. package/cjs/models/deck-version.js +30 -5
  89. package/cjs/models/deck-version.js.map +1 -1
  90. package/cjs/models/deck.js +4 -1
  91. package/cjs/models/deck.js.map +1 -1
  92. package/cjs/models/feed-data.js +5 -0
  93. package/cjs/models/feed-data.js.map +1 -1
  94. package/cjs/models/image.js +34 -0
  95. package/cjs/models/image.js.map +1 -1
  96. package/cjs/models/manifest-json.js +56 -13
  97. package/cjs/models/manifest-json.js.map +1 -1
  98. package/cjs/models/preset.js +21 -1
  99. package/cjs/models/preset.js.map +1 -1
  100. package/cjs/models/section.js +3 -1
  101. package/cjs/models/section.js.map +1 -1
  102. package/cjs/models/slide.js +3 -1
  103. package/cjs/models/slide.js.map +1 -1
  104. package/cjs/models/tag.js +54 -0
  105. package/cjs/models/tag.js.map +1 -0
  106. package/cjs/models/template.js +3 -1
  107. package/cjs/models/template.js.map +1 -1
  108. package/cjs/models/token.js +56 -0
  109. package/cjs/models/token.js.map +1 -0
  110. package/cjs/models/user.js +4 -2
  111. package/cjs/models/user.js.map +1 -1
  112. package/cjs/models.js +104 -0
  113. package/cjs/models.js.map +1 -1
  114. package/cjs/presentation/appointment-presentation.js +11 -4
  115. package/cjs/presentation/appointment-presentation.js.map +1 -1
  116. package/cjs/presentation/base-presentation-model.js +167 -9
  117. package/cjs/presentation/base-presentation-model.js.map +1 -1
  118. package/cjs/presentation/base-presentation-model.spec.js +96 -6
  119. package/cjs/presentation/base-presentation-model.spec.js.map +1 -1
  120. package/cjs/presentation/presentation-deck.js +36 -8
  121. package/cjs/presentation/presentation-deck.js.map +1 -1
  122. package/cjs/presentation/presentation-deck.spec.js +53 -0
  123. package/cjs/presentation/presentation-deck.spec.js.map +1 -1
  124. package/cjs/presentation/presentation-section.js +64 -25
  125. package/cjs/presentation/presentation-section.js.map +1 -1
  126. package/cjs/presentation/presentation-section.spec.js +536 -0
  127. package/cjs/presentation/presentation-section.spec.js.map +1 -0
  128. package/cjs/presentation/presentation-slide.js +43 -18
  129. package/cjs/presentation/presentation-slide.js.map +1 -1
  130. package/cjs/presentation/presentation-slide.spec.js +386 -0
  131. package/cjs/presentation/presentation-slide.spec.js.map +1 -0
  132. package/cjs/presentation/presentation-subslide.js +5 -2
  133. package/cjs/presentation/presentation-subslide.js.map +1 -1
  134. package/cjs/presentation/presentation-subslide.spec.js +58 -12
  135. package/cjs/presentation/presentation-subslide.spec.js.map +1 -1
  136. package/cjs/presentation/presentation.js +120 -6
  137. package/cjs/presentation/presentation.js.map +1 -1
  138. package/cjs/state-register.js +11 -1
  139. package/cjs/state-register.js.map +1 -1
  140. package/cjs/sync.js +1 -1
  141. package/cjs/utils.js +5 -5
  142. package/config/rush-project.json +11 -0
  143. package/jest.config.js +1 -0
  144. package/package.json +66 -66
  145. package/src/api.js +1 -1
  146. package/src/auth.js +44 -8
  147. package/src/auth.spec.js +2 -0
  148. package/src/collections/appointment-adjunct-tags.js +18 -0
  149. package/src/collections/appointment-deckversion-tags.js +21 -0
  150. package/src/collections/appointment-section-tags.js +18 -0
  151. package/src/collections/appointment-slide-tags.js +18 -0
  152. package/src/collections/appointment-tags.js +136 -0
  153. package/src/collections/base.js +80 -3
  154. package/src/collections/base.spec.js +108 -1
  155. package/src/collections/deck-version-screenshots.js +48 -0
  156. package/src/collections/tags.js +18 -0
  157. package/src/collections.js +7 -0
  158. package/src/models/activity-item.js +2 -0
  159. package/src/models/appointment-adjunct-tags.js +41 -0
  160. package/src/models/appointment-deckversion-tags.js +41 -0
  161. package/src/models/appointment-section-tags.js +41 -0
  162. package/src/models/appointment-slide-tags.js +41 -0
  163. package/src/models/appointment-tags.js +16 -14
  164. package/src/models/appointment.js +18 -1
  165. package/src/models/auto-adjunct.js +2 -0
  166. package/src/models/base.js +19 -1
  167. package/src/models/base.spec.js +16 -9
  168. package/src/models/deck-tags.js +52 -0
  169. package/src/models/deck-version-screenshot.js +48 -0
  170. package/src/models/deck-version.js +32 -4
  171. package/src/models/deck.js +2 -0
  172. package/src/models/feed-data.js +2 -0
  173. package/src/models/image.js +32 -0
  174. package/src/models/manifest-json.js +55 -7
  175. package/src/models/preset.js +19 -0
  176. package/src/models/section.js +2 -0
  177. package/src/models/slide.js +2 -0
  178. package/src/models/tag.js +42 -0
  179. package/src/models/template.js +2 -0
  180. package/src/models/token.js +47 -0
  181. package/src/models/user.js +4 -0
  182. package/src/models.js +8 -0
  183. package/src/presentation/appointment-presentation.js +13 -2
  184. package/src/presentation/base-presentation-model.js +129 -8
  185. package/src/presentation/base-presentation-model.spec.js +121 -6
  186. package/src/presentation/presentation-deck.js +41 -2
  187. package/src/presentation/presentation-deck.spec.js +53 -0
  188. package/src/presentation/presentation-section.js +57 -14
  189. package/src/presentation/presentation-section.spec.js +496 -0
  190. package/src/presentation/presentation-slide.js +41 -8
  191. package/src/presentation/presentation-slide.spec.js +352 -0
  192. package/src/presentation/presentation-subslide.js +7 -2
  193. package/src/presentation/presentation-subslide.spec.js +32 -3
  194. package/src/presentation/presentation.js +35 -6
  195. package/src/state-register.js +7 -0
  196. package/api.build.error.log +0 -16
@@ -0,0 +1,536 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
6
+
7
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
+
9
+ var _adjunctSection = require("../models/adjunct-section");
10
+
11
+ var _autoAdjunct = require("../models/auto-adjunct");
12
+
13
+ var _deckVersionScreenshots = require("../collections/deck-version-screenshots.js");
14
+
15
+ var _presentationSection = require("./presentation-section");
16
+
17
+ var _section = require("../models/section");
18
+
19
+ var _slide = require("../models/slide");
20
+
21
+ describe("#createFromSection", function () {
22
+ var getSectionJSON = function getSectionJSON() {
23
+ return {
24
+ adjunctslide_limit: 0,
25
+ created_date: "2021-07-19T01:17:59.522119Z",
26
+ deckversion: "https://staging-test.salespreso.com/api/deckversions/408/",
27
+ description: "",
28
+ enabled: true,
29
+ id: 1728,
30
+ image_128: "https://staging-test-cdn.salespreso.com/media/CACHE/images/section/123/456.jpg",
31
+ image_256: "https://staging-test-cdn.salespreso.com/media/CACHE/images/section/123/456.jpg",
32
+ image_512: "https://staging-test-cdn.salespreso.com/media/CACHE/images/section/123/456.jpg",
33
+ index_asset: {
34
+ created_date: "2021-07-19T01:17:58.068483Z",
35
+ data: "sections/agenda/index.html",
36
+ hash_algorithm: "sha-256",
37
+ hash_digest: "f84e1e0b43f4b25168e4a8997b11a2c1c2848376b128b2d72ba5bd4f44c17dcc",
38
+ id: 148115,
39
+ modified_date: "2021-07-19T01:17:58.068507Z",
40
+ orig_path: "sections/agenda",
41
+ pack: "https://staging-test.salespreso.com/api/packs/409/",
42
+ url: "https://staging-test-cdn.salespreso.com/media/pack/409/assets/sections/agenda/index.html"
43
+ },
44
+ key: "agenda",
45
+ modified_date: "2021-07-19T01:20:43.815965Z",
46
+ namespaced_key: "agenda",
47
+ sequence: 0,
48
+ slide_set: [],
49
+ tags: [],
50
+ title: "Agenda",
51
+ url: "https://staging-test.salespreso.com/api/sections/1728/"
52
+ };
53
+ };
54
+
55
+ it("should create a presentation section", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
56
+ var section, presentationSection, expected;
57
+ return _regenerator.default.wrap(function _callee$(_context) {
58
+ while (1) {
59
+ switch (_context.prev = _context.next) {
60
+ case 0:
61
+ section = new _section.SectionModel(getSectionJSON());
62
+ presentationSection = _presentationSection.PresentationSection.createFromSection(section);
63
+ expected = {
64
+ adjunctID: null,
65
+ adjunctSlideLimit: 0,
66
+ autoAdjunctID: null,
67
+ createdByAutoAdjunct: false,
68
+ createdByTemplate: false,
69
+ css: "https://staging-test-cdn.salespreso.com/media/pack/409/assets/sections/agenda/slide.css",
70
+ custom: false,
71
+ deckversion: 408,
72
+ editable: false,
73
+ html: "https://staging-test-cdn.salespreso.com/media/pack/409/assets/sections/agenda/index.html",
74
+ id: 1728,
75
+ impostor: false,
76
+ index: 0,
77
+ isWelcome: false,
78
+ key: "agenda",
79
+ selectionID: null,
80
+ sequence: 0,
81
+ slides: [],
82
+ tags: [],
83
+ templateID: null,
84
+ thumbnail: "https://staging-test-cdn.salespreso.com/media/CACHE/images/section/123/456.jpg",
85
+ title: "Agenda",
86
+ url: "/api/sections/1728/",
87
+ visible: true
88
+ };
89
+ expect(presentationSection.toJSON()).toEqual(expected);
90
+
91
+ case 4:
92
+ case "end":
93
+ return _context.stop();
94
+ }
95
+ }
96
+ }, _callee);
97
+ })));
98
+ it("should use deckTags when available", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
99
+ var section, options, presentationSection;
100
+ return _regenerator.default.wrap(function _callee2$(_context2) {
101
+ while (1) {
102
+ switch (_context2.prev = _context2.next) {
103
+ case 0:
104
+ section = new _section.SectionModel(getSectionJSON());
105
+ options = {
106
+ deckTags: {
107
+ agenda: ["section-tag"]
108
+ }
109
+ };
110
+ presentationSection = _presentationSection.PresentationSection.createFromSection(section, options);
111
+ expect(presentationSection.tags).toEqual(["section-tag"]);
112
+
113
+ case 4:
114
+ case "end":
115
+ return _context2.stop();
116
+ }
117
+ }
118
+ }, _callee2);
119
+ })));
120
+ describe("Screenshots", function () {
121
+ it("should use the default image from the slide if no screenshot found", function () {
122
+ var data = getSectionJSON();
123
+ var section = new _section.SectionModel(data);
124
+
125
+ var presentationSection = _presentationSection.PresentationSection.createFromSection(section);
126
+
127
+ expect(presentationSection.thumbnail).toEqual(data.image_256);
128
+ });
129
+ it("should use the screenshot model if it matches", function () {
130
+ var section = new _section.SectionModel(getSectionJSON());
131
+ var options = {
132
+ screenshots: new _deckVersionScreenshots.DeckVersionScreenshotCollection([{
133
+ subject: section.url(),
134
+ image_256: "test-screenshot.png"
135
+ }])
136
+ };
137
+
138
+ var presentationSection = _presentationSection.PresentationSection.createFromSection(section, options);
139
+
140
+ expect(presentationSection.thumbnail).toEqual("test-screenshot.png");
141
+ });
142
+ });
143
+ });
144
+ describe("#createFromAdjunctSection", function () {
145
+ var getAdjunctSectionJSON = function getAdjunctSectionJSON(includeTemplate) {
146
+ var template = {
147
+ id: 1,
148
+ image_256: "template.png",
149
+ index_asset: {
150
+ created_date: "2021-07-22T04:57:32.977770Z",
151
+ data: "index.html",
152
+ id: 148204,
153
+ modified_date: "2021-07-22T04:57:32.977790Z",
154
+ orig_path: "templates/test-template/foo",
155
+ pack: "https://staging-test.salespreso.com/api/packs/410/",
156
+ url: "https://staging-test-cdn.salespreso.com/media/pack/410/assets/sections/test-deck/slides/slide-key/index.html"
157
+ }
158
+ };
159
+ return {
160
+ adjunct: "https://staging-test.salespreso.com/api/adjuncts/7470/",
161
+ appointment: "https://staging-test.salespreso.com/api/appointments/2422/",
162
+ created_by_autoadjunct: true,
163
+ created_date: "2021-09-20T01:57:55.125224Z",
164
+ creator_autoadjunct: "https://staging-test.salespreso.com/api/autoadjuncts/545/",
165
+ deckversion: "https://staging-test.salespreso.com/api/deckversions/408/",
166
+ deleted: false,
167
+ enabled: true,
168
+ html_content: '<img src="https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png">',
169
+ id: 1737,
170
+ image_128: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg",
171
+ image_256: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg",
172
+ image_512: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg",
173
+ image_1024: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.png",
174
+ image_original: "https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png",
175
+ modified_date: "2021-09-20T01:57:55.125229Z",
176
+ sequence: 1,
177
+ tags: [],
178
+ template: includeTemplate ? template : null,
179
+ title: "Five",
180
+ url: "https://staging-test.salespreso.com/api/adjunctsections/1737/"
181
+ };
182
+ };
183
+
184
+ it("should create a presentation section", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
185
+ var adjunctSection, presentationSection, expected;
186
+ return _regenerator.default.wrap(function _callee3$(_context3) {
187
+ while (1) {
188
+ switch (_context3.prev = _context3.next) {
189
+ case 0:
190
+ adjunctSection = new _adjunctSection.AdjunctSectionModel(getAdjunctSectionJSON());
191
+ presentationSection = _presentationSection.PresentationSection.createFromAdjunctSection(adjunctSection, {
192
+ id: 1
193
+ });
194
+ expected = {
195
+ adjunct: {
196
+ url: "https://staging-test.salespreso.com/api/adjuncts/7470/"
197
+ },
198
+ adjunctID: 1737,
199
+ adjunctSlideLimit: 0,
200
+ autoAdjunctID: 545,
201
+ createdByAutoAdjunct: true,
202
+ createdByTemplate: false,
203
+ custom: false,
204
+ deckversion: 1,
205
+ editable: false,
206
+ id: 1,
207
+ image: "https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png",
208
+ impostor: false,
209
+ index: 1,
210
+ isWelcome: false,
211
+ key: "adjunct-1737",
212
+ sequence: 1,
213
+ slides: [],
214
+ tags: [],
215
+ templateID: null,
216
+ temporary: true,
217
+ thumbnail: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg",
218
+ title: "Five",
219
+ url: "/api/adjunctsections/1737/",
220
+ visible: true,
221
+ cmsvalkey_set: []
222
+ };
223
+ expect(presentationSection.toJSON()).toEqual(expected);
224
+
225
+ case 4:
226
+ case "end":
227
+ return _context3.stop();
228
+ }
229
+ }
230
+ }, _callee3);
231
+ })));
232
+ it("should use deckTags when available", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
233
+ var adjunctSection, options, presentationSection;
234
+ return _regenerator.default.wrap(function _callee4$(_context4) {
235
+ while (1) {
236
+ switch (_context4.prev = _context4.next) {
237
+ case 0:
238
+ adjunctSection = new _adjunctSection.AdjunctSectionModel(getAdjunctSectionJSON());
239
+ options = {
240
+ deckTags: {
241
+ "adjunct-1737": ["adjunctsection-tag"]
242
+ }
243
+ };
244
+ presentationSection = _presentationSection.PresentationSection.createFromAdjunctSection(adjunctSection, {
245
+ id: 1
246
+ }, options);
247
+ expect(presentationSection.tags).toEqual(["adjunctsection-tag"]);
248
+
249
+ case 4:
250
+ case "end":
251
+ return _context4.stop();
252
+ }
253
+ }
254
+ }, _callee4);
255
+ })));
256
+ describe("Screenshots", function () {
257
+ it("should use the default image from the model if no screenshot found", function () {
258
+ var data = getAdjunctSectionJSON(true);
259
+ var adjunctSection = new _adjunctSection.AdjunctSectionModel(data);
260
+
261
+ var presentationSlide = _presentationSection.PresentationSection.createFromAdjunctSection(adjunctSection, {
262
+ id: 1
263
+ });
264
+
265
+ expect(presentationSlide.thumbnail).toEqual(data.template.image_256);
266
+ });
267
+ it("should use the screenshot model if it matches", function () {
268
+ var adjunctSection = new _adjunctSection.AdjunctSectionModel(getAdjunctSectionJSON(true));
269
+ var options = {
270
+ screenshots: new _deckVersionScreenshots.DeckVersionScreenshotCollection([{
271
+ subject: "/api/autoadjuncts/545/",
272
+ image_256: "test-screenshot.png"
273
+ }])
274
+ };
275
+
276
+ var presentationSection = _presentationSection.PresentationSection.createFromAdjunctSection(adjunctSection, {
277
+ id: 1
278
+ }, options);
279
+
280
+ expect(presentationSection.thumbnail).toEqual("test-screenshot.png");
281
+ });
282
+ });
283
+ });
284
+ describe("#createFromImpostorSection", function () {
285
+ var getImpostorSectionJSON = function getImpostorSectionJSON() {
286
+ return {
287
+ created_date: "2021-09-20T02:59:06.968285Z",
288
+ description: "",
289
+ enabled: true,
290
+ id: 23898,
291
+ image_128: "https://staging-test-cdn.salespreso.com/media/CACHE/images/slide/123/456.jpg",
292
+ image_256: "https://staging-test-cdn.salespreso.com/media/CACHE/images/slide/123/456.jpg",
293
+ image_512: "https://staging-test-cdn.salespreso.com/media/CACHE/images/slide/123/456.jpg",
294
+ index_asset: {
295
+ created_date: "2021-09-20T02:59:02.361498Z",
296
+ data: "sections/test-deck/slides/agenda/index.html",
297
+ hash_algorithm: "sha-256",
298
+ hash_digest: "b77283717f1a99bce5b8aea67e007f11aad06473f5fe26412c15e707f8758343",
299
+ id: 153400,
300
+ modified_date: "2021-09-20T02:59:02.361528Z",
301
+ orig_path: "sections/test-deck/slides/agenda",
302
+ pack: "https://staging-test.salespreso.com/api/packs/427/",
303
+ url: "https://staging-test-cdn.salespreso.com/media/pack/427/assets/sections/test-deck/slides/agenda/index.html"
304
+ },
305
+ key: "agenda",
306
+ modified_date: "2021-09-20T03:05:27.811485Z",
307
+ namespaced_key: "test-deck/agenda",
308
+ section: {
309
+ id: 2,
310
+ deckversion: {
311
+ id: 3
312
+ }
313
+ },
314
+ sequence: 0,
315
+ subslide_set: [],
316
+ tags: ["section-header"],
317
+ title: "Agenda",
318
+ url: "https://staging-test.salespreso.com/api/slides/23898/"
319
+ };
320
+ };
321
+
322
+ it("should create a presentation section", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
323
+ var impostorSection, presentationSection, expected;
324
+ return _regenerator.default.wrap(function _callee5$(_context5) {
325
+ while (1) {
326
+ switch (_context5.prev = _context5.next) {
327
+ case 0:
328
+ impostorSection = new _slide.SlideModel(getImpostorSectionJSON());
329
+ presentationSection = _presentationSection.PresentationSection.createFromImpostorSection(impostorSection);
330
+ expected = {
331
+ adjunctID: null,
332
+ adjunctSlideLimit: 0,
333
+ autoAdjunctID: null,
334
+ createdByAutoAdjunct: false,
335
+ createdByTemplate: false,
336
+ css: "https://staging-test-cdn.salespreso.com/media/pack/427/assets/sections/test-deck/slides/agenda/slide.css",
337
+ custom: false,
338
+ deckversion: 3,
339
+ editable: false,
340
+ html: "https://staging-test-cdn.salespreso.com/media/pack/427/assets/sections/test-deck/slides/agenda/index.html",
341
+ id: 23898,
342
+ impostor: true,
343
+ index: 0,
344
+ isWelcome: false,
345
+ key: "agenda",
346
+ selectionID: null,
347
+ sequence: 0,
348
+ slides: [],
349
+ tags: ["section-header"],
350
+ templateID: null,
351
+ thumbnail: "https://staging-test-cdn.salespreso.com/media/CACHE/images/slide/123/456.jpg",
352
+ title: "Agenda",
353
+ url: "/api/slides/23898/",
354
+ visible: true
355
+ };
356
+ expect(presentationSection.toJSON()).toEqual(expected);
357
+
358
+ case 4:
359
+ case "end":
360
+ return _context5.stop();
361
+ }
362
+ }
363
+ }, _callee5);
364
+ })));
365
+ it("should use deckTags when available", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
366
+ var impostorSection, options, presentationSection;
367
+ return _regenerator.default.wrap(function _callee6$(_context6) {
368
+ while (1) {
369
+ switch (_context6.prev = _context6.next) {
370
+ case 0:
371
+ impostorSection = new _slide.SlideModel(getImpostorSectionJSON());
372
+ options = {
373
+ deckTags: {
374
+ "test-deck/agenda": ["impostorsection-tag"]
375
+ }
376
+ };
377
+ presentationSection = _presentationSection.PresentationSection.createFromImpostorSection(impostorSection, null, options);
378
+ expect(presentationSection.tags).toEqual(["impostorsection-tag"]);
379
+
380
+ case 4:
381
+ case "end":
382
+ return _context6.stop();
383
+ }
384
+ }
385
+ }, _callee6);
386
+ })));
387
+ describe("Screenshots", function () {
388
+ it("should use the default image from the model if no screenshot found", function () {
389
+ var data = getImpostorSectionJSON();
390
+ var impostorSection = new _slide.SlideModel(data);
391
+
392
+ var presentationSection = _presentationSection.PresentationSection.createFromImpostorSection(impostorSection, null);
393
+
394
+ expect(presentationSection.thumbnail).toEqual(data.image_256);
395
+ });
396
+ it("should use the screenshot model if it matches", function () {
397
+ var impostorSection = new _slide.SlideModel(getImpostorSectionJSON());
398
+ var options = {
399
+ screenshots: new _deckVersionScreenshots.DeckVersionScreenshotCollection([{
400
+ subject: impostorSection.url(),
401
+ image_256: "test-screenshot.png"
402
+ }])
403
+ };
404
+
405
+ var presentationSection = _presentationSection.PresentationSection.createFromImpostorSection(impostorSection, null, options);
406
+
407
+ expect(presentationSection.thumbnail).toEqual("test-screenshot.png");
408
+ });
409
+ });
410
+ });
411
+ describe("#createFromAutoAdjunct", function () {
412
+ var getAutoAdjunctJSON = function getAutoAdjunctJSON() {
413
+ return {
414
+ after_key: "autoadjunct-i-am-template-section",
415
+ created_date: "2021-09-16T04:25:54.459641Z",
416
+ deck: "https://staging-test.salespreso.com/api/decks/6/",
417
+ enabled: true,
418
+ id: 545,
419
+ image_128: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg",
420
+ image_256: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg",
421
+ image_512: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg",
422
+ image_1024: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.png",
423
+ image_original: "https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png",
424
+ key: "autoadjunct-five",
425
+ modified_date: "2021-09-20T01:57:55.090828Z",
426
+ name: "Five",
427
+ parent_key: "",
428
+ sequence: 1,
429
+ tags: [],
430
+ team: null,
431
+ template: null,
432
+ url: "https://staging-test.salespreso.com/api/autoadjuncts/545/"
433
+ };
434
+ };
435
+
436
+ it("should create a presentation section", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
437
+ var autoAdjunct, options, presentationSection, expected;
438
+ return _regenerator.default.wrap(function _callee7$(_context7) {
439
+ while (1) {
440
+ switch (_context7.prev = _context7.next) {
441
+ case 0:
442
+ autoAdjunct = new _autoAdjunct.AutoAdjunctModel(getAutoAdjunctJSON());
443
+ options = {
444
+ index: 3,
445
+ deckversionID: 12
446
+ };
447
+ presentationSection = _presentationSection.PresentationSection.createFromAutoAdjunct(autoAdjunct, options);
448
+ expected = {
449
+ adjunctID: 545,
450
+ adjunctSlideLimit: 0,
451
+ autoAdjunctID: 545,
452
+ createdByAutoAdjunct: false,
453
+ createdByTemplate: false,
454
+ css: "",
455
+ deckversion: 12,
456
+ html: "",
457
+ id: 545,
458
+ image: "https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png",
459
+ impostor: false,
460
+ index: 3,
461
+ isWelcome: false,
462
+ key: "autoadjunct-five",
463
+ sequence: 3,
464
+ slides: [],
465
+ tags: [],
466
+ templateID: null,
467
+ temporary: true,
468
+ thumbnail: "https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg",
469
+ title: "Five",
470
+ url: "/api/adjunctsections/545/",
471
+ visible: true
472
+ };
473
+ expect(presentationSection.toJSON()).toEqual(expected);
474
+
475
+ case 5:
476
+ case "end":
477
+ return _context7.stop();
478
+ }
479
+ }
480
+ }, _callee7);
481
+ })));
482
+ it("should use deckTags when available", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
483
+ var autoAdjunct, options, presentationSection;
484
+ return _regenerator.default.wrap(function _callee8$(_context8) {
485
+ while (1) {
486
+ switch (_context8.prev = _context8.next) {
487
+ case 0:
488
+ autoAdjunct = new _autoAdjunct.AutoAdjunctModel(getAutoAdjunctJSON());
489
+ options = {
490
+ index: 3,
491
+ deckversionID: 12,
492
+ deckTags: {
493
+ "autoadjunct-five": ["autoadjunct-tag"]
494
+ }
495
+ };
496
+ presentationSection = _presentationSection.PresentationSection.createFromAutoAdjunct(autoAdjunct, options);
497
+ expect(presentationSection.tags).toEqual(["autoadjunct-tag"]);
498
+
499
+ case 4:
500
+ case "end":
501
+ return _context8.stop();
502
+ }
503
+ }
504
+ }, _callee8);
505
+ })));
506
+ describe("Screenshots", function () {
507
+ it("should use the default image from the model if no screenshot found", function () {
508
+ var data = getAutoAdjunctJSON();
509
+ var options = {
510
+ index: 3,
511
+ deckversionID: 12
512
+ };
513
+ var autoAdjunct = new _autoAdjunct.AutoAdjunctModel(data);
514
+
515
+ var presentationSection = _presentationSection.PresentationSection.createFromAutoAdjunct(autoAdjunct, options);
516
+
517
+ expect(presentationSection.thumbnail).toEqual(data.image_256);
518
+ });
519
+ it("should use the screenshot model if it matches", function () {
520
+ var autoAdjunct = new _autoAdjunct.AutoAdjunctModel(getAutoAdjunctJSON());
521
+ var options = {
522
+ index: 3,
523
+ deckversionID: 12,
524
+ screenshots: new _deckVersionScreenshots.DeckVersionScreenshotCollection([{
525
+ subject: autoAdjunct.url(),
526
+ image_256: "test-screenshot.png"
527
+ }])
528
+ };
529
+
530
+ var presentationSection = _presentationSection.PresentationSection.createFromAutoAdjunct(autoAdjunct, options);
531
+
532
+ expect(presentationSection.thumbnail).toEqual("test-screenshot.png");
533
+ });
534
+ });
535
+ });
536
+ //# sourceMappingURL=presentation-section.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/presentation/presentation-section.spec.js"],"names":["describe","getSectionJSON","adjunctslide_limit","created_date","deckversion","description","enabled","id","image_128","image_256","image_512","index_asset","data","hash_algorithm","hash_digest","modified_date","orig_path","pack","url","key","namespaced_key","sequence","slide_set","tags","title","it","section","SectionModel","presentationSection","PresentationSection","createFromSection","expected","adjunctID","adjunctSlideLimit","autoAdjunctID","createdByAutoAdjunct","createdByTemplate","css","custom","editable","html","impostor","index","isWelcome","selectionID","slides","templateID","thumbnail","visible","expect","toJSON","toEqual","options","deckTags","agenda","screenshots","DeckVersionScreenshotCollection","subject","getAdjunctSectionJSON","includeTemplate","template","adjunct","appointment","created_by_autoadjunct","creator_autoadjunct","deleted","html_content","image_1024","image_original","adjunctSection","AdjunctSectionModel","createFromAdjunctSection","image","temporary","cmsvalkey_set","presentationSlide","getImpostorSectionJSON","subslide_set","impostorSection","SlideModel","createFromImpostorSection","getAutoAdjunctJSON","after_key","deck","name","parent_key","team","autoAdjunct","AutoAdjunctModel","deckversionID","createFromAutoAdjunct"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEAA,QAAQ,CAAC,oBAAD,EAAuB,YAAM;AACpC,MAAMC,cAAc,GAAG,SAAjBA,cAAiB,GAAM;AAC5B,WAAO;AACNC,MAAAA,kBAAkB,EAAE,CADd;AAENC,MAAAA,YAAY,EAAE,6BAFR;AAGNC,MAAAA,WAAW,EAAE,2DAHP;AAINC,MAAAA,WAAW,EAAE,EAJP;AAKNC,MAAAA,OAAO,EAAE,IALH;AAMNC,MAAAA,EAAE,EAAE,IANE;AAONC,MAAAA,SAAS,EACR,gFARK;AASNC,MAAAA,SAAS,EACR,gFAVK;AAWNC,MAAAA,SAAS,EACR,gFAZK;AAaNC,MAAAA,WAAW,EAAE;AACZR,QAAAA,YAAY,EAAE,6BADF;AAEZS,QAAAA,IAAI,EAAE,4BAFM;AAGZC,QAAAA,cAAc,EAAE,SAHJ;AAIZC,QAAAA,WAAW,EACV,kEALW;AAMZ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EAAE;AAAzC,SADgD,CAApC;AAHE,OAAhB;;AAQA,UAAMmB,mBAAmB,GAAGC,yCAAoB6D,qBAApB,CAC3BH,WAD2B,EAE3BnC,OAF2B,CAA5B;;AAIAH,MAAAA,MAAM,CAACrB,mBAAmB,CAACmB,SAArB,CAAN,CAAsCI,OAAtC,CAA8C,qBAA9C;AACA,KAfC,CAAF;AAgBA,GA5BO,CAAR;AA6BA,CAnHO,CAAR","sourcesContent":["import { AdjunctSectionModel } from \"../models/adjunct-section\";\nimport { AutoAdjunctModel } from \"../models/auto-adjunct\";\nimport { DeckVersionScreenshotCollection } from \"../collections/deck-version-screenshots.js\";\nimport { PresentationSection } from \"./presentation-section\";\nimport { SectionModel } from \"../models/section\";\nimport { SlideModel } from \"../models/slide\";\n\ndescribe(\"#createFromSection\", () => {\n\tconst getSectionJSON = () => {\n\t\treturn {\n\t\t\tadjunctslide_limit: 0,\n\t\t\tcreated_date: \"2021-07-19T01:17:59.522119Z\",\n\t\t\tdeckversion: \"https://staging-test.salespreso.com/api/deckversions/408/\",\n\t\t\tdescription: \"\",\n\t\t\tenabled: true,\n\t\t\tid: 1728,\n\t\t\timage_128:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/section/123/456.jpg\",\n\t\t\timage_256:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/section/123/456.jpg\",\n\t\t\timage_512:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/section/123/456.jpg\",\n\t\t\tindex_asset: {\n\t\t\t\tcreated_date: \"2021-07-19T01:17:58.068483Z\",\n\t\t\t\tdata: \"sections/agenda/index.html\",\n\t\t\t\thash_algorithm: \"sha-256\",\n\t\t\t\thash_digest:\n\t\t\t\t\t\"f84e1e0b43f4b25168e4a8997b11a2c1c2848376b128b2d72ba5bd4f44c17dcc\",\n\t\t\t\tid: 148115,\n\t\t\t\tmodified_date: \"2021-07-19T01:17:58.068507Z\",\n\t\t\t\torig_path: \"sections/agenda\",\n\t\t\t\tpack: \"https://staging-test.salespreso.com/api/packs/409/\",\n\t\t\t\turl: \"https://staging-test-cdn.salespreso.com/media/pack/409/assets/sections/agenda/index.html\",\n\t\t\t},\n\t\t\tkey: \"agenda\",\n\t\t\tmodified_date: \"2021-07-19T01:20:43.815965Z\",\n\t\t\tnamespaced_key: \"agenda\",\n\t\t\tsequence: 0,\n\t\t\tslide_set: [],\n\t\t\ttags: [],\n\t\t\ttitle: \"Agenda\",\n\t\t\turl: \"https://staging-test.salespreso.com/api/sections/1728/\",\n\t\t};\n\t};\n\n\tit(\"should create a presentation section\", async () => {\n\t\tconst section = new SectionModel(getSectionJSON());\n\t\tconst presentationSection = PresentationSection.createFromSection(section);\n\n\t\tconst expected = {\n\t\t\tadjunctID: null,\n\t\t\tadjunctSlideLimit: 0,\n\t\t\tautoAdjunctID: null,\n\t\t\tcreatedByAutoAdjunct: false,\n\t\t\tcreatedByTemplate: false,\n\t\t\tcss: \"https://staging-test-cdn.salespreso.com/media/pack/409/assets/sections/agenda/slide.css\",\n\t\t\tcustom: false,\n\t\t\tdeckversion: 408,\n\t\t\teditable: false,\n\t\t\thtml: \"https://staging-test-cdn.salespreso.com/media/pack/409/assets/sections/agenda/index.html\",\n\t\t\tid: 1728,\n\t\t\timpostor: false,\n\t\t\tindex: 0,\n\t\t\tisWelcome: false,\n\t\t\tkey: \"agenda\",\n\t\t\tselectionID: null,\n\t\t\tsequence: 0,\n\t\t\tslides: [],\n\t\t\ttags: [],\n\t\t\ttemplateID: null,\n\t\t\tthumbnail:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/section/123/456.jpg\",\n\t\t\ttitle: \"Agenda\",\n\t\t\turl: \"/api/sections/1728/\",\n\t\t\tvisible: true,\n\t\t};\n\n\t\texpect(presentationSection.toJSON()).toEqual(expected);\n\t});\n\n\tit(\"should use deckTags when available\", async () => {\n\t\tconst section = new SectionModel(getSectionJSON());\n\t\tconst options = {\n\t\t\tdeckTags: { agenda: [\"section-tag\"] },\n\t\t};\n\n\t\tconst presentationSection = PresentationSection.createFromSection(\n\t\t\tsection,\n\t\t\toptions\n\t\t);\n\n\t\texpect(presentationSection.tags).toEqual([\"section-tag\"]);\n\t});\n\n\tdescribe(\"Screenshots\", () => {\n\t\tit(\"should use the default image from the slide if no screenshot found\", () => {\n\t\t\tconst data = getSectionJSON();\n\t\t\tconst section = new SectionModel(data);\n\t\t\tconst presentationSection =\n\t\t\t\tPresentationSection.createFromSection(section);\n\t\t\texpect(presentationSection.thumbnail).toEqual(data.image_256);\n\t\t});\n\n\t\tit(\"should use the screenshot model if it matches\", () => {\n\t\t\tconst section = new SectionModel(getSectionJSON());\n\t\t\tconst options = {\n\t\t\t\tscreenshots: new DeckVersionScreenshotCollection([\n\t\t\t\t\t{ subject: section.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t]),\n\t\t\t};\n\n\t\t\tconst presentationSection = PresentationSection.createFromSection(\n\t\t\t\tsection,\n\t\t\t\toptions\n\t\t\t);\n\t\t\texpect(presentationSection.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t});\n\t});\n});\n\ndescribe(\"#createFromAdjunctSection\", () => {\n\tconst getAdjunctSectionJSON = (includeTemplate) => {\n\t\tconst template = {\n\t\t\tid: 1,\n\t\t\timage_256: \"template.png\",\n\t\t\tindex_asset: {\n\t\t\t\tcreated_date: \"2021-07-22T04:57:32.977770Z\",\n\t\t\t\tdata: \"index.html\",\n\t\t\t\tid: 148204,\n\t\t\t\tmodified_date: \"2021-07-22T04:57:32.977790Z\",\n\t\t\t\torig_path: \"templates/test-template/foo\",\n\t\t\t\tpack: \"https://staging-test.salespreso.com/api/packs/410/\",\n\t\t\t\turl: \"https://staging-test-cdn.salespreso.com/media/pack/410/assets/sections/test-deck/slides/slide-key/index.html\",\n\t\t\t},\n\t\t};\n\n\t\treturn {\n\t\t\tadjunct: \"https://staging-test.salespreso.com/api/adjuncts/7470/\",\n\t\t\tappointment: \"https://staging-test.salespreso.com/api/appointments/2422/\",\n\t\t\tcreated_by_autoadjunct: true,\n\t\t\tcreated_date: \"2021-09-20T01:57:55.125224Z\",\n\t\t\tcreator_autoadjunct:\n\t\t\t\t\"https://staging-test.salespreso.com/api/autoadjuncts/545/\",\n\t\t\tdeckversion: \"https://staging-test.salespreso.com/api/deckversions/408/\",\n\t\t\tdeleted: false,\n\t\t\tenabled: true,\n\t\t\thtml_content:\n\t\t\t\t'<img src=\"https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png\">',\n\t\t\tid: 1737,\n\t\t\timage_128:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg\",\n\t\t\timage_256:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg\",\n\t\t\timage_512:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg\",\n\t\t\timage_1024:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.png\",\n\t\t\timage_original:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png\",\n\t\t\tmodified_date: \"2021-09-20T01:57:55.125229Z\",\n\t\t\tsequence: 1,\n\t\t\ttags: [],\n\t\t\ttemplate: includeTemplate ? template : null,\n\t\t\ttitle: \"Five\",\n\t\t\turl: \"https://staging-test.salespreso.com/api/adjunctsections/1737/\",\n\t\t};\n\t};\n\n\tit(\"should create a presentation section\", async () => {\n\t\tconst adjunctSection = new AdjunctSectionModel(getAdjunctSectionJSON());\n\t\tconst presentationSection = PresentationSection.createFromAdjunctSection(\n\t\t\tadjunctSection,\n\t\t\t{ id: 1 }\n\t\t);\n\n\t\tconst expected = {\n\t\t\tadjunct: {\n\t\t\t\turl: \"https://staging-test.salespreso.com/api/adjuncts/7470/\",\n\t\t\t},\n\t\t\tadjunctID: 1737,\n\t\t\tadjunctSlideLimit: 0,\n\t\t\tautoAdjunctID: 545,\n\t\t\tcreatedByAutoAdjunct: true,\n\t\t\tcreatedByTemplate: false,\n\t\t\tcustom: false,\n\t\t\tdeckversion: 1,\n\t\t\teditable: false,\n\t\t\tid: 1,\n\t\t\timage:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png\",\n\t\t\timpostor: false,\n\t\t\tindex: 1,\n\t\t\tisWelcome: false,\n\t\t\tkey: \"adjunct-1737\",\n\t\t\tsequence: 1,\n\t\t\tslides: [],\n\t\t\ttags: [],\n\t\t\ttemplateID: null,\n\t\t\ttemporary: true,\n\t\t\tthumbnail:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg\",\n\t\t\ttitle: \"Five\",\n\t\t\turl: \"/api/adjunctsections/1737/\",\n\t\t\tvisible: true,\n\t\t\tcmsvalkey_set: [],\n\t\t};\n\n\t\texpect(presentationSection.toJSON()).toEqual(expected);\n\t});\n\n\tit(\"should use deckTags when available\", async () => {\n\t\tconst adjunctSection = new AdjunctSectionModel(getAdjunctSectionJSON());\n\t\tconst options = {\n\t\t\tdeckTags: { \"adjunct-1737\": [\"adjunctsection-tag\"] },\n\t\t};\n\t\tconst presentationSection = PresentationSection.createFromAdjunctSection(\n\t\t\tadjunctSection,\n\t\t\t{ id: 1 },\n\t\t\toptions\n\t\t);\n\n\t\texpect(presentationSection.tags).toEqual([\"adjunctsection-tag\"]);\n\t});\n\n\tdescribe(\"Screenshots\", () => {\n\t\tit(\"should use the default image from the model if no screenshot found\", () => {\n\t\t\tconst data = getAdjunctSectionJSON(true);\n\t\t\tconst adjunctSection = new AdjunctSectionModel(data);\n\t\t\tconst presentationSlide = PresentationSection.createFromAdjunctSection(\n\t\t\t\tadjunctSection,\n\t\t\t\t{ id: 1 }\n\t\t\t);\n\t\t\texpect(presentationSlide.thumbnail).toEqual(data.template.image_256);\n\t\t});\n\n\t\tit(\"should use the screenshot model if it matches\", () => {\n\t\t\tconst adjunctSection = new AdjunctSectionModel(\n\t\t\t\tgetAdjunctSectionJSON(true)\n\t\t\t);\n\n\t\t\tconst options = {\n\t\t\t\tscreenshots: new DeckVersionScreenshotCollection([\n\t\t\t\t\t{\n\t\t\t\t\t\tsubject: \"/api/autoadjuncts/545/\",\n\t\t\t\t\t\timage_256: \"test-screenshot.png\",\n\t\t\t\t\t},\n\t\t\t\t]),\n\t\t\t};\n\n\t\t\tconst presentationSection = PresentationSection.createFromAdjunctSection(\n\t\t\t\tadjunctSection,\n\t\t\t\t{ id: 1 },\n\t\t\t\toptions\n\t\t\t);\n\t\t\texpect(presentationSection.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t});\n\t});\n});\n\ndescribe(\"#createFromImpostorSection\", () => {\n\tconst getImpostorSectionJSON = () => {\n\t\treturn {\n\t\t\tcreated_date: \"2021-09-20T02:59:06.968285Z\",\n\t\t\tdescription: \"\",\n\t\t\tenabled: true,\n\t\t\tid: 23898,\n\t\t\timage_128:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/slide/123/456.jpg\",\n\t\t\timage_256:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/slide/123/456.jpg\",\n\t\t\timage_512:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/slide/123/456.jpg\",\n\t\t\tindex_asset: {\n\t\t\t\tcreated_date: \"2021-09-20T02:59:02.361498Z\",\n\t\t\t\tdata: \"sections/test-deck/slides/agenda/index.html\",\n\t\t\t\thash_algorithm: \"sha-256\",\n\t\t\t\thash_digest:\n\t\t\t\t\t\"b77283717f1a99bce5b8aea67e007f11aad06473f5fe26412c15e707f8758343\",\n\t\t\t\tid: 153400,\n\t\t\t\tmodified_date: \"2021-09-20T02:59:02.361528Z\",\n\t\t\t\torig_path: \"sections/test-deck/slides/agenda\",\n\t\t\t\tpack: \"https://staging-test.salespreso.com/api/packs/427/\",\n\t\t\t\turl: \"https://staging-test-cdn.salespreso.com/media/pack/427/assets/sections/test-deck/slides/agenda/index.html\",\n\t\t\t},\n\t\t\tkey: \"agenda\",\n\t\t\tmodified_date: \"2021-09-20T03:05:27.811485Z\",\n\t\t\tnamespaced_key: \"test-deck/agenda\",\n\t\t\tsection: {\n\t\t\t\tid: 2,\n\t\t\t\tdeckversion: {\n\t\t\t\t\tid: 3,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsequence: 0,\n\t\t\tsubslide_set: [],\n\t\t\ttags: [\"section-header\"],\n\t\t\ttitle: \"Agenda\",\n\t\t\turl: \"https://staging-test.salespreso.com/api/slides/23898/\",\n\t\t};\n\t};\n\n\tit(\"should create a presentation section\", async () => {\n\t\tconst impostorSection = new SlideModel(getImpostorSectionJSON());\n\t\tconst presentationSection =\n\t\t\tPresentationSection.createFromImpostorSection(impostorSection);\n\n\t\tconst expected = {\n\t\t\tadjunctID: null,\n\t\t\tadjunctSlideLimit: 0,\n\t\t\tautoAdjunctID: null,\n\t\t\tcreatedByAutoAdjunct: false,\n\t\t\tcreatedByTemplate: false,\n\t\t\tcss: \"https://staging-test-cdn.salespreso.com/media/pack/427/assets/sections/test-deck/slides/agenda/slide.css\",\n\t\t\tcustom: false,\n\t\t\tdeckversion: 3,\n\t\t\teditable: false,\n\t\t\thtml: \"https://staging-test-cdn.salespreso.com/media/pack/427/assets/sections/test-deck/slides/agenda/index.html\",\n\t\t\tid: 23898,\n\t\t\timpostor: true,\n\t\t\tindex: 0,\n\t\t\tisWelcome: false,\n\t\t\tkey: \"agenda\",\n\t\t\tselectionID: null,\n\t\t\tsequence: 0,\n\t\t\tslides: [],\n\t\t\ttags: [\"section-header\"],\n\t\t\ttemplateID: null,\n\t\t\tthumbnail:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/slide/123/456.jpg\",\n\t\t\ttitle: \"Agenda\",\n\t\t\turl: \"/api/slides/23898/\",\n\t\t\tvisible: true,\n\t\t};\n\n\t\texpect(presentationSection.toJSON()).toEqual(expected);\n\t});\n\n\tit(\"should use deckTags when available\", async () => {\n\t\tconst impostorSection = new SlideModel(getImpostorSectionJSON());\n\t\tconst options = {\n\t\t\tdeckTags: { \"test-deck/agenda\": [\"impostorsection-tag\"] },\n\t\t};\n\t\tconst presentationSection = PresentationSection.createFromImpostorSection(\n\t\t\timpostorSection,\n\t\t\tnull,\n\t\t\toptions\n\t\t);\n\n\t\texpect(presentationSection.tags).toEqual([\"impostorsection-tag\"]);\n\t});\n\n\tdescribe(\"Screenshots\", () => {\n\t\tit(\"should use the default image from the model if no screenshot found\", () => {\n\t\t\tconst data = getImpostorSectionJSON();\n\t\t\tconst impostorSection = new SlideModel(data);\n\t\t\tconst presentationSection = PresentationSection.createFromImpostorSection(\n\t\t\t\timpostorSection,\n\t\t\t\tnull\n\t\t\t);\n\t\t\texpect(presentationSection.thumbnail).toEqual(data.image_256);\n\t\t});\n\n\t\tit(\"should use the screenshot model if it matches\", () => {\n\t\t\tconst impostorSection = new SlideModel(getImpostorSectionJSON());\n\t\t\tconst options = {\n\t\t\t\tscreenshots: new DeckVersionScreenshotCollection([\n\t\t\t\t\t{ subject: impostorSection.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t]),\n\t\t\t};\n\n\t\t\tconst presentationSection = PresentationSection.createFromImpostorSection(\n\t\t\t\timpostorSection,\n\t\t\t\tnull,\n\t\t\t\toptions\n\t\t\t);\n\t\t\texpect(presentationSection.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t});\n\t});\n});\n\ndescribe(\"#createFromAutoAdjunct\", () => {\n\tconst getAutoAdjunctJSON = () => {\n\t\treturn {\n\t\t\tafter_key: \"autoadjunct-i-am-template-section\",\n\t\t\tcreated_date: \"2021-09-16T04:25:54.459641Z\",\n\t\t\tdeck: \"https://staging-test.salespreso.com/api/decks/6/\",\n\t\t\tenabled: true,\n\t\t\tid: 545,\n\t\t\timage_128:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg\",\n\t\t\timage_256:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg\",\n\t\t\timage_512:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg\",\n\t\t\timage_1024:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.png\",\n\t\t\timage_original:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png\",\n\t\t\tkey: \"autoadjunct-five\",\n\t\t\tmodified_date: \"2021-09-20T01:57:55.090828Z\",\n\t\t\tname: \"Five\",\n\t\t\tparent_key: \"\",\n\t\t\tsequence: 1,\n\t\t\ttags: [],\n\t\t\tteam: null,\n\t\t\ttemplate: null,\n\t\t\turl: \"https://staging-test.salespreso.com/api/autoadjuncts/545/\",\n\t\t};\n\t};\n\n\tit(\"should create a presentation section\", async () => {\n\t\tconst autoAdjunct = new AutoAdjunctModel(getAutoAdjunctJSON());\n\t\tconst options = {\n\t\t\tindex: 3,\n\t\t\tdeckversionID: 12,\n\t\t};\n\t\tconst presentationSection = PresentationSection.createFromAutoAdjunct(\n\t\t\tautoAdjunct,\n\t\t\toptions\n\t\t);\n\n\t\tconst expected = {\n\t\t\tadjunctID: 545,\n\t\t\tadjunctSlideLimit: 0,\n\t\t\tautoAdjunctID: 545,\n\t\t\tcreatedByAutoAdjunct: false,\n\t\t\tcreatedByTemplate: false,\n\t\t\tcss: \"\",\n\t\t\tdeckversion: 12,\n\t\t\thtml: \"\",\n\t\t\tid: 545,\n\t\t\timage:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png\",\n\t\t\timpostor: false,\n\t\t\tindex: 3,\n\t\t\tisWelcome: false,\n\t\t\tkey: \"autoadjunct-five\",\n\t\t\tsequence: 3,\n\t\t\tslides: [],\n\t\t\ttags: [],\n\t\t\ttemplateID: null,\n\t\t\ttemporary: true,\n\t\t\tthumbnail:\n\t\t\t\t\"https://staging-test-cdn.salespreso.com/media/CACHE/images/autoadjunct/123/456.jpg\",\n\t\t\ttitle: \"Five\",\n\t\t\turl: \"/api/adjunctsections/545/\",\n\t\t\tvisible: true,\n\t\t};\n\t\texpect(presentationSection.toJSON()).toEqual(expected);\n\t});\n\n\tit(\"should use deckTags when available\", async () => {\n\t\tconst autoAdjunct = new AutoAdjunctModel(getAutoAdjunctJSON());\n\t\tconst options = {\n\t\t\tindex: 3,\n\t\t\tdeckversionID: 12,\n\t\t\tdeckTags: { \"autoadjunct-five\": [\"autoadjunct-tag\"] },\n\t\t};\n\t\tconst presentationSection = PresentationSection.createFromAutoAdjunct(\n\t\t\tautoAdjunct,\n\t\t\toptions\n\t\t);\n\n\t\texpect(presentationSection.tags).toEqual([\"autoadjunct-tag\"]);\n\t});\n\n\tdescribe(\"Screenshots\", () => {\n\t\tit(\"should use the default image from the model if no screenshot found\", () => {\n\t\t\tconst data = getAutoAdjunctJSON();\n\t\t\tconst options = { index: 3, deckversionID: 12 };\n\t\t\tconst autoAdjunct = new AutoAdjunctModel(data);\n\t\t\tconst presentationSection = PresentationSection.createFromAutoAdjunct(\n\t\t\t\tautoAdjunct,\n\t\t\t\toptions\n\t\t\t);\n\t\t\texpect(presentationSection.thumbnail).toEqual(data.image_256);\n\t\t});\n\n\t\tit(\"should use the screenshot model if it matches\", () => {\n\t\t\tconst autoAdjunct = new AutoAdjunctModel(getAutoAdjunctJSON());\n\t\t\tconst options = {\n\t\t\t\tindex: 3,\n\t\t\t\tdeckversionID: 12,\n\t\t\t\tscreenshots: new DeckVersionScreenshotCollection([\n\t\t\t\t\t{ subject: autoAdjunct.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t]),\n\t\t\t};\n\n\t\t\tconst presentationSection = PresentationSection.createFromAutoAdjunct(\n\t\t\t\tautoAdjunct,\n\t\t\t\toptions\n\t\t\t);\n\t\t\texpect(presentationSection.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t});\n\t});\n});\n"],"file":"presentation-section.spec.js"}