@thoughtspot/visual-embed-sdk 1.50.1 → 1.51.0-test

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 (238) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/config.d.ts +1 -0
  3. package/cjs/src/config.d.ts.map +1 -1
  4. package/cjs/src/config.js +2 -1
  5. package/cjs/src/config.js.map +1 -1
  6. package/cjs/src/css-variables.d.ts +63 -0
  7. package/cjs/src/css-variables.d.ts.map +1 -1
  8. package/cjs/src/embed/app.d.ts +148 -25
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +74 -37
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +571 -150
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/base.d.ts +1 -1
  15. package/cjs/src/embed/base.js +1 -1
  16. package/cjs/src/embed/conversation.d.ts +375 -2
  17. package/cjs/src/embed/conversation.d.ts.map +1 -1
  18. package/cjs/src/embed/conversation.js +21 -15
  19. package/cjs/src/embed/conversation.js.map +1 -1
  20. package/cjs/src/embed/conversation.spec.js +323 -17
  21. package/cjs/src/embed/conversation.spec.js.map +1 -1
  22. package/cjs/src/embed/events.spec.js +45 -0
  23. package/cjs/src/embed/events.spec.js.map +1 -1
  24. package/cjs/src/embed/host-events.spec.js +81 -0
  25. package/cjs/src/embed/host-events.spec.js.map +1 -1
  26. package/cjs/src/embed/hostEventClient/contracts.d.ts +15 -0
  27. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  28. package/cjs/src/embed/hostEventClient/contracts.js +1 -0
  29. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  30. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +1 -1
  31. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  32. package/cjs/src/embed/hostEventClient/host-event-client.js +1 -0
  33. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  34. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +27 -0
  35. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  36. package/cjs/src/embed/liveboard.d.ts +76 -14
  37. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  38. package/cjs/src/embed/liveboard.js +50 -9
  39. package/cjs/src/embed/liveboard.js.map +1 -1
  40. package/cjs/src/embed/liveboard.spec.js +432 -4
  41. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  42. package/cjs/src/embed/spotter-utils.d.ts +15 -1
  43. package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
  44. package/cjs/src/embed/spotter-utils.js +28 -1
  45. package/cjs/src/embed/spotter-utils.js.map +1 -1
  46. package/cjs/src/embed/spotter-utils.spec.js +129 -0
  47. package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
  48. package/cjs/src/embed/spotter-viz-utils.d.ts +9 -10
  49. package/cjs/src/embed/spotter-viz-utils.d.ts.map +1 -1
  50. package/cjs/src/embed/spotter-viz-utils.js.map +1 -1
  51. package/cjs/src/embed/ts-embed.d.ts +16 -8
  52. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  53. package/cjs/src/embed/ts-embed.js +82 -30
  54. package/cjs/src/embed/ts-embed.js.map +1 -1
  55. package/cjs/src/embed/ts-embed.spec.js +537 -3
  56. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  57. package/cjs/src/index.d.ts +3 -3
  58. package/cjs/src/index.d.ts.map +1 -1
  59. package/cjs/src/index.js +3 -2
  60. package/cjs/src/index.js.map +1 -1
  61. package/cjs/src/mixpanel-service.d.ts +4 -0
  62. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  63. package/cjs/src/mixpanel-service.js +4 -0
  64. package/cjs/src/mixpanel-service.js.map +1 -1
  65. package/cjs/src/react/all-types-export.d.ts +1 -1
  66. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  67. package/cjs/src/react/all-types-export.js +2 -1
  68. package/cjs/src/react/all-types-export.js.map +1 -1
  69. package/cjs/src/react/all-types-export.parity.spec.d.ts +2 -0
  70. package/cjs/src/react/all-types-export.parity.spec.d.ts.map +1 -0
  71. package/cjs/src/react/all-types-export.parity.spec.js +194 -0
  72. package/cjs/src/react/all-types-export.parity.spec.js.map +1 -0
  73. package/cjs/src/react/index.d.ts +66 -32
  74. package/cjs/src/react/index.d.ts.map +1 -1
  75. package/cjs/src/react/index.js +5 -3
  76. package/cjs/src/react/index.js.map +1 -1
  77. package/cjs/src/react/index.spec.js +101 -0
  78. package/cjs/src/react/index.spec.js.map +1 -1
  79. package/cjs/src/types.d.ts +789 -32
  80. package/cjs/src/types.d.ts.map +1 -1
  81. package/cjs/src/types.js +610 -20
  82. package/cjs/src/types.js.map +1 -1
  83. package/cjs/src/utils.spec.js +4 -0
  84. package/cjs/src/utils.spec.js.map +1 -1
  85. package/dist/{index-fCne7kmU.js → index-Bivg-mDx.js} +1 -1
  86. package/dist/src/config.d.ts +1 -0
  87. package/dist/src/config.d.ts.map +1 -1
  88. package/dist/src/css-variables.d.ts +63 -0
  89. package/dist/src/css-variables.d.ts.map +1 -1
  90. package/dist/src/embed/app.d.ts +148 -25
  91. package/dist/src/embed/app.d.ts.map +1 -1
  92. package/dist/src/embed/base.d.ts +1 -1
  93. package/dist/src/embed/conversation.d.ts +375 -2
  94. package/dist/src/embed/conversation.d.ts.map +1 -1
  95. package/dist/src/embed/hostEventClient/contracts.d.ts +15 -0
  96. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  97. package/dist/src/embed/hostEventClient/host-event-client.d.ts +1 -1
  98. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  99. package/dist/src/embed/liveboard.d.ts +76 -14
  100. package/dist/src/embed/liveboard.d.ts.map +1 -1
  101. package/dist/src/embed/spotter-utils.d.ts +15 -1
  102. package/dist/src/embed/spotter-utils.d.ts.map +1 -1
  103. package/dist/src/embed/spotter-viz-utils.d.ts +9 -10
  104. package/dist/src/embed/spotter-viz-utils.d.ts.map +1 -1
  105. package/dist/src/embed/ts-embed.d.ts +16 -8
  106. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  107. package/dist/src/index.d.ts +3 -3
  108. package/dist/src/index.d.ts.map +1 -1
  109. package/dist/src/mixpanel-service.d.ts +4 -0
  110. package/dist/src/mixpanel-service.d.ts.map +1 -1
  111. package/dist/src/react/all-types-export.d.ts +1 -1
  112. package/dist/src/react/all-types-export.d.ts.map +1 -1
  113. package/dist/src/react/all-types-export.parity.spec.d.ts +2 -0
  114. package/dist/src/react/all-types-export.parity.spec.d.ts.map +1 -0
  115. package/dist/src/react/index.d.ts +66 -32
  116. package/dist/src/react/index.d.ts.map +1 -1
  117. package/dist/src/types.d.ts +789 -32
  118. package/dist/src/types.d.ts.map +1 -1
  119. package/dist/tsembed-react.es.js +878 -120
  120. package/dist/tsembed-react.js +877 -119
  121. package/dist/tsembed.es.js +936 -181
  122. package/dist/tsembed.js +938 -183
  123. package/dist/visual-embed-sdk-react-full.d.ts +1553 -128
  124. package/dist/visual-embed-sdk-react.d.ts +1555 -129
  125. package/dist/visual-embed-sdk.d.ts +1499 -100
  126. package/lib/package.json +1 -1
  127. package/lib/src/config.d.ts +1 -0
  128. package/lib/src/config.d.ts.map +1 -1
  129. package/lib/src/config.js +1 -0
  130. package/lib/src/config.js.map +1 -1
  131. package/lib/src/css-variables.d.ts +63 -0
  132. package/lib/src/css-variables.d.ts.map +1 -1
  133. package/lib/src/embed/app.d.ts +148 -25
  134. package/lib/src/embed/app.d.ts.map +1 -1
  135. package/lib/src/embed/app.js +75 -38
  136. package/lib/src/embed/app.js.map +1 -1
  137. package/lib/src/embed/app.spec.js +572 -151
  138. package/lib/src/embed/app.spec.js.map +1 -1
  139. package/lib/src/embed/base.d.ts +1 -1
  140. package/lib/src/embed/base.js +1 -1
  141. package/lib/src/embed/conversation.d.ts +375 -2
  142. package/lib/src/embed/conversation.d.ts.map +1 -1
  143. package/lib/src/embed/conversation.js +23 -17
  144. package/lib/src/embed/conversation.js.map +1 -1
  145. package/lib/src/embed/conversation.spec.js +323 -17
  146. package/lib/src/embed/conversation.spec.js.map +1 -1
  147. package/lib/src/embed/events.spec.js +45 -0
  148. package/lib/src/embed/events.spec.js.map +1 -1
  149. package/lib/src/embed/host-events.spec.js +81 -0
  150. package/lib/src/embed/host-events.spec.js.map +1 -1
  151. package/lib/src/embed/hostEventClient/contracts.d.ts +15 -0
  152. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  153. package/lib/src/embed/hostEventClient/contracts.js +1 -0
  154. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  155. package/lib/src/embed/hostEventClient/host-event-client.d.ts +1 -1
  156. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  157. package/lib/src/embed/hostEventClient/host-event-client.js +1 -0
  158. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  159. package/lib/src/embed/hostEventClient/host-event-client.spec.js +27 -0
  160. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  161. package/lib/src/embed/liveboard.d.ts +76 -14
  162. package/lib/src/embed/liveboard.d.ts.map +1 -1
  163. package/lib/src/embed/liveboard.js +50 -9
  164. package/lib/src/embed/liveboard.js.map +1 -1
  165. package/lib/src/embed/liveboard.spec.js +432 -4
  166. package/lib/src/embed/liveboard.spec.js.map +1 -1
  167. package/lib/src/embed/spotter-utils.d.ts +15 -1
  168. package/lib/src/embed/spotter-utils.d.ts.map +1 -1
  169. package/lib/src/embed/spotter-utils.js +25 -0
  170. package/lib/src/embed/spotter-utils.js.map +1 -1
  171. package/lib/src/embed/spotter-utils.spec.js +130 -1
  172. package/lib/src/embed/spotter-utils.spec.js.map +1 -1
  173. package/lib/src/embed/spotter-viz-utils.d.ts +9 -10
  174. package/lib/src/embed/spotter-viz-utils.d.ts.map +1 -1
  175. package/lib/src/embed/spotter-viz-utils.js.map +1 -1
  176. package/lib/src/embed/ts-embed.d.ts +16 -8
  177. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  178. package/lib/src/embed/ts-embed.js +82 -30
  179. package/lib/src/embed/ts-embed.js.map +1 -1
  180. package/lib/src/embed/ts-embed.spec.js +537 -3
  181. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  182. package/lib/src/index.d.ts +3 -3
  183. package/lib/src/index.d.ts.map +1 -1
  184. package/lib/src/index.js +2 -2
  185. package/lib/src/index.js.map +1 -1
  186. package/lib/src/mixpanel-service.d.ts +4 -0
  187. package/lib/src/mixpanel-service.d.ts.map +1 -1
  188. package/lib/src/mixpanel-service.js +4 -0
  189. package/lib/src/mixpanel-service.js.map +1 -1
  190. package/lib/src/react/all-types-export.d.ts +1 -1
  191. package/lib/src/react/all-types-export.d.ts.map +1 -1
  192. package/lib/src/react/all-types-export.js +1 -1
  193. package/lib/src/react/all-types-export.js.map +1 -1
  194. package/lib/src/react/all-types-export.parity.spec.d.ts +2 -0
  195. package/lib/src/react/all-types-export.parity.spec.d.ts.map +1 -0
  196. package/lib/src/react/all-types-export.parity.spec.js +191 -0
  197. package/lib/src/react/all-types-export.parity.spec.js.map +1 -0
  198. package/lib/src/react/index.d.ts +66 -32
  199. package/lib/src/react/index.d.ts.map +1 -1
  200. package/lib/src/react/index.js +5 -3
  201. package/lib/src/react/index.js.map +1 -1
  202. package/lib/src/react/index.spec.js +102 -1
  203. package/lib/src/react/index.spec.js.map +1 -1
  204. package/lib/src/types.d.ts +789 -32
  205. package/lib/src/types.d.ts.map +1 -1
  206. package/lib/src/types.js +610 -20
  207. package/lib/src/types.js.map +1 -1
  208. package/lib/src/utils.spec.js +4 -0
  209. package/lib/src/utils.spec.js.map +1 -1
  210. package/lib/src/visual-embed-sdk.d.ts +1499 -100
  211. package/package.json +1 -1
  212. package/src/config.ts +1 -0
  213. package/src/css-variables.ts +77 -0
  214. package/src/embed/app.spec.ts +729 -188
  215. package/src/embed/app.ts +240 -75
  216. package/src/embed/base.ts +1 -1
  217. package/src/embed/conversation.spec.ts +379 -20
  218. package/src/embed/conversation.ts +412 -18
  219. package/src/embed/events.spec.ts +56 -0
  220. package/src/embed/host-events.spec.ts +118 -0
  221. package/src/embed/hostEventClient/contracts.ts +16 -0
  222. package/src/embed/hostEventClient/host-event-client.spec.ts +46 -0
  223. package/src/embed/hostEventClient/host-event-client.ts +3 -2
  224. package/src/embed/liveboard.spec.ts +565 -4
  225. package/src/embed/liveboard.ts +150 -29
  226. package/src/embed/spotter-utils.spec.ts +140 -1
  227. package/src/embed/spotter-utils.ts +36 -1
  228. package/src/embed/spotter-viz-utils.ts +9 -10
  229. package/src/embed/ts-embed.spec.ts +699 -3
  230. package/src/embed/ts-embed.ts +99 -35
  231. package/src/index.ts +44 -2
  232. package/src/mixpanel-service.ts +4 -0
  233. package/src/react/all-types-export.parity.spec.ts +208 -0
  234. package/src/react/all-types-export.ts +22 -0
  235. package/src/react/index.spec.tsx +158 -0
  236. package/src/react/index.tsx +70 -33
  237. package/src/types.ts +791 -30
  238. package/src/utils.spec.ts +5 -0
@@ -10,6 +10,8 @@ const processTriggerInstance = tslib_1.__importStar(require("../utils/processTri
10
10
  const auth = tslib_1.__importStar(require("../auth"));
11
11
  const previewService = tslib_1.__importStar(require("../utils/graphql/preview-service"));
12
12
  const SessionInfoService = tslib_1.__importStar(require("../utils/sessionInfoService"));
13
+ const logger_1 = require("../utils/logger");
14
+ const config_1 = require("../config");
13
15
  const defaultViewConfig = {
14
16
  frameParams: {
15
17
  width: 1280,
@@ -109,6 +111,22 @@ describe('Liveboard/viz embed tests', () => {
109
111
  (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&${test_utils_1.defaultParamsWithoutHiddenActions}&hideAction=[%22${types_1.Action.ReportError}%22,%22${types_1.Action.DownloadAsCsv}%22,%22${types_1.Action.DownloadAsPdf}%22,%22${types_1.Action.DownloadAsXlsx}%22]${prefixParams}#/embed/viz/${liveboardId}`);
110
112
  });
111
113
  });
114
+ test('should hide and disable the Spotter button on the Liveboard header', async () => {
115
+ expect(types_1.Action.SpotterOnLiveboard).toBe('spotterOnLiveboard');
116
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
117
+ hiddenActions: [types_1.Action.SpotterOnLiveboard],
118
+ disabledActions: [types_1.Action.SpotterOnLiveboard],
119
+ ...defaultViewConfig,
120
+ liveboardId,
121
+ });
122
+ liveboardEmbed.render();
123
+ await (0, test_utils_1.executeAfterWait)(() => {
124
+ (0, test_utils_1.expectUrlToHaveParamsWithValues)((0, test_utils_1.getIFrameSrc)(), {
125
+ hideAction: JSON.stringify([types_1.Action.ReportError, types_1.Action.SpotterOnLiveboard]),
126
+ disableAction: JSON.stringify([types_1.Action.SpotterOnLiveboard]),
127
+ });
128
+ });
129
+ });
112
130
  test('should set visible actions', async () => {
113
131
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
114
132
  visibleActions: [types_1.Action.DownloadAsCsv, types_1.Action.DownloadAsPdf, types_1.Action.DownloadAsXlsx],
@@ -144,6 +162,17 @@ describe('Liveboard/viz embed tests', () => {
144
162
  (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&enable2ColumnLayout=true${prefixParams}#/embed/viz/${liveboardId}`);
145
163
  });
146
164
  });
165
+ test('should set isLiveboardAlwaysOn12ColLayout to true in url', async () => {
166
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
167
+ isLiveboardAlwaysOn12ColLayout: true,
168
+ ...defaultViewConfig,
169
+ liveboardId,
170
+ });
171
+ liveboardEmbed.render();
172
+ await (0, test_utils_1.executeAfterWait)(() => {
173
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&isLiveboardAlwaysOn12ColLayout=true${prefixParams}#/embed/viz/${liveboardId}`);
174
+ });
175
+ });
147
176
  test('should set isLiveboardStylingAndGroupingEnabled to true in url (deprecated, use isLiveboardMasterpiecesEnabled)', async () => {
148
177
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
149
178
  isLiveboardStylingAndGroupingEnabled: true,
@@ -155,6 +184,28 @@ describe('Liveboard/viz embed tests', () => {
155
184
  (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&isLiveboardStylingAndGroupingEnabled=true${prefixParams}#/embed/viz/${liveboardId}`);
156
185
  });
157
186
  });
187
+ test('should set liveboardGutter in url', async () => {
188
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
189
+ ...defaultViewConfig,
190
+ liveboardId,
191
+ liveboardGutter: 8,
192
+ });
193
+ liveboardEmbed.render();
194
+ await (0, test_utils_1.executeAfterWait)(() => {
195
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&liveboardGutter=8${prefixParams}#/embed/viz/${liveboardId}`);
196
+ });
197
+ });
198
+ test('should set liveboardGutter to 0 in url', async () => {
199
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
200
+ ...defaultViewConfig,
201
+ liveboardId,
202
+ liveboardGutter: 0,
203
+ });
204
+ liveboardEmbed.render();
205
+ await (0, test_utils_1.executeAfterWait)(() => {
206
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&liveboardGutter=0${prefixParams}#/embed/viz/${liveboardId}`);
207
+ });
208
+ });
158
209
  test('should set isThisPeriodInDateFiltersEnabled to true in url', async () => {
159
210
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
160
211
  ...defaultViewConfig,
@@ -199,14 +250,14 @@ describe('Liveboard/viz embed tests', () => {
199
250
  (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&isWYSIWYGLiveboardPDFEnabled=true${prefixParams}#/embed/viz/${liveboardId}`);
200
251
  });
201
252
  });
202
- test('should disable isWYSIWYGLiveboardPDFEnabled by default in url', async () => {
253
+ test('should not set isWYSIWYGLiveboardPDFEnabled in url by default', async () => {
203
254
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
204
255
  ...defaultViewConfig,
205
256
  liveboardId,
206
257
  });
207
258
  liveboardEmbed.render();
208
259
  await (0, test_utils_1.executeAfterWait)(() => {
209
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&isWYSIWYGLiveboardPDFEnabled=false${prefixParams}#/embed/viz/${liveboardId}`);
260
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}${prefixParams}#/embed/viz/${liveboardId}`);
210
261
  });
211
262
  });
212
263
  test('should set isLiveboardXLSXCSVDownloadEnabled to true in url', async () => {
@@ -548,6 +599,38 @@ describe('Liveboard/viz embed tests', () => {
548
599
  (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&isCentralizedLiveboardFilterUXEnabled=false${prefixParams}#/embed/viz/${liveboardId}`);
549
600
  });
550
601
  });
602
+ test('should add isScopedLiveboardFilteringEnabled flag and set value to true to the iframe src', async () => {
603
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
604
+ ...defaultViewConfig,
605
+ liveboardId,
606
+ isScopedLiveboardFilteringEnabled: true,
607
+ });
608
+ liveboardEmbed.render();
609
+ await (0, test_utils_1.executeAfterWait)(() => {
610
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&isScopedLiveboardFilteringEnabled=true${prefixParams}#/embed/viz/${liveboardId}`);
611
+ });
612
+ });
613
+ test('should add isScopedLiveboardFilteringEnabled flag and set value to false to the iframe src', async () => {
614
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
615
+ ...defaultViewConfig,
616
+ liveboardId,
617
+ isScopedLiveboardFilteringEnabled: false,
618
+ });
619
+ liveboardEmbed.render();
620
+ await (0, test_utils_1.executeAfterWait)(() => {
621
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}&isScopedLiveboardFilteringEnabled=false${prefixParams}#/embed/viz/${liveboardId}`);
622
+ });
623
+ });
624
+ test('should not add isScopedLiveboardFilteringEnabled flag to the iframe src when undefined', async () => {
625
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
626
+ ...defaultViewConfig,
627
+ liveboardId,
628
+ });
629
+ liveboardEmbed.render();
630
+ await (0, test_utils_1.executeAfterWait)(() => {
631
+ expect((0, test_utils_1.getIFrameSrc)()).not.toContain('isScopedLiveboardFilteringEnabled');
632
+ });
633
+ });
551
634
  test('should not append runtime filters in URL if excludeRuntimeFiltersfromURL is true', async () => {
552
635
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
553
636
  ...defaultViewConfig,
@@ -940,6 +1023,37 @@ describe('Liveboard/viz embed tests', () => {
940
1023
  expect(onSpy).toHaveBeenCalledWith(types_1.HostEvent.Navigate, 'embed/viz/lb1/viz1');
941
1024
  }, 1002);
942
1025
  });
1026
+ test('navigateToLiveboard should call preRender when preRenderConfig.preRenderId is set', () => {
1027
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1028
+ ...defaultViewConfig,
1029
+ liveboardId,
1030
+ preRenderConfig: {
1031
+ preRenderId: 'config-pre-render-id',
1032
+ },
1033
+ });
1034
+ const preRenderSpy = jest
1035
+ .spyOn(liveboardEmbed, 'preRender')
1036
+ .mockResolvedValue(liveboardEmbed);
1037
+ liveboardEmbed.navigateToLiveboard('lb1');
1038
+ expect(preRenderSpy).toHaveBeenCalledTimes(1);
1039
+ expect(preRenderSpy).toHaveBeenCalledWith(true);
1040
+ });
1041
+ test('navigateToLiveboard should prefer preRenderConfig.preRenderId over top-level preRenderId', () => {
1042
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1043
+ ...defaultViewConfig,
1044
+ liveboardId,
1045
+ preRenderId: 'top-level-id',
1046
+ preRenderConfig: {
1047
+ preRenderId: 'config-level-id',
1048
+ },
1049
+ });
1050
+ const preRenderSpy = jest
1051
+ .spyOn(liveboardEmbed, 'preRender')
1052
+ .mockResolvedValue(liveboardEmbed);
1053
+ liveboardEmbed.navigateToLiveboard('lb1');
1054
+ expect(preRenderSpy).toHaveBeenCalledTimes(1);
1055
+ expect(preRenderSpy).toHaveBeenCalledWith(true);
1056
+ });
943
1057
  test('should set runtime parametere values in url params', async () => {
944
1058
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
945
1059
  ...defaultViewConfig,
@@ -990,6 +1104,43 @@ describe('Liveboard/viz embed tests', () => {
990
1104
  (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}${prefixParams}&enableStarterPrompts=true#/embed/viz/${liveboardId}`);
991
1105
  });
992
1106
  });
1107
+ test('should set openSpotterOnLiveboardByDefault parameter in url params', async () => {
1108
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1109
+ ...defaultViewConfig,
1110
+ liveboardId,
1111
+ spotterChatConfig: { openSpotterOnLiveboardByDefault: true },
1112
+ });
1113
+ await liveboardEmbed.render();
1114
+ await (0, test_utils_1.executeAfterWait)(() => {
1115
+ (0, test_utils_1.expectUrlToHaveParamsWithValues)((0, test_utils_1.getIFrameSrc)(), {
1116
+ openSpotterOnLiveboardByDefault: 'true',
1117
+ });
1118
+ });
1119
+ });
1120
+ test('should set openSpotterOnLiveboardByDefault to false when explicitly disabled', async () => {
1121
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1122
+ ...defaultViewConfig,
1123
+ liveboardId,
1124
+ spotterChatConfig: { openSpotterOnLiveboardByDefault: false },
1125
+ });
1126
+ await liveboardEmbed.render();
1127
+ await (0, test_utils_1.executeAfterWait)(() => {
1128
+ (0, test_utils_1.expectUrlToHaveParamsWithValues)((0, test_utils_1.getIFrameSrc)(), {
1129
+ openSpotterOnLiveboardByDefault: 'false',
1130
+ });
1131
+ });
1132
+ });
1133
+ test('should not set openSpotterOnLiveboardByDefault when it is not configured', async () => {
1134
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1135
+ ...defaultViewConfig,
1136
+ liveboardId,
1137
+ spotterChatConfig: { enableStarterPrompts: true },
1138
+ });
1139
+ await liveboardEmbed.render();
1140
+ await (0, test_utils_1.executeAfterWait)(() => {
1141
+ expect((0, test_utils_1.getIFrameSrc)()).not.toContain('openSpotterOnLiveboardByDefault');
1142
+ });
1143
+ });
993
1144
  test('should set spotterFileUploadFileTypes parameter in url params', async () => {
994
1145
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
995
1146
  ...defaultViewConfig,
@@ -1025,6 +1176,28 @@ describe('Liveboard/viz embed tests', () => {
1025
1176
  (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}${prefixParams}&updatedSpotterChatPrompt=false#/embed/viz/${liveboardId}`);
1026
1177
  });
1027
1178
  });
1179
+ test('should render the liveboard embed with showSpotterRadiance', async () => {
1180
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1181
+ ...defaultViewConfig,
1182
+ liveboardId,
1183
+ showSpotterRadiance: true,
1184
+ });
1185
+ await liveboardEmbed.render();
1186
+ await (0, test_utils_1.executeAfterWait)(() => {
1187
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}${prefixParams}&showSpotterRadiance=true#/embed/viz/${liveboardId}`);
1188
+ });
1189
+ });
1190
+ test('should render the liveboard embed with showSpotterRadiance disabled', async () => {
1191
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1192
+ ...defaultViewConfig,
1193
+ liveboardId,
1194
+ showSpotterRadiance: false,
1195
+ });
1196
+ await liveboardEmbed.render();
1197
+ await (0, test_utils_1.executeAfterWait)(() => {
1198
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}${prefixParams}&showSpotterRadiance=false#/embed/viz/${liveboardId}`);
1199
+ });
1200
+ });
1028
1201
  test('should set hideToolResponseCardBranding parameter in url params via spotterChatConfig', async () => {
1029
1202
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1030
1203
  ...defaultViewConfig,
@@ -1085,6 +1258,34 @@ describe('Liveboard/viz embed tests', () => {
1085
1258
  });
1086
1259
  });
1087
1260
  });
1261
+ test('should include starterPrompts in APP_INIT embedParams', async () => {
1262
+ const starterPrompts = {
1263
+ enable: true,
1264
+ quick: {
1265
+ label: 'Quick',
1266
+ questions: [
1267
+ { label: 'Q1', prompt: 'P1' },
1268
+ { label: 'Q2', prompt: 'P2' },
1269
+ ],
1270
+ },
1271
+ research: { label: 'Research' },
1272
+ };
1273
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1274
+ ...defaultViewConfig,
1275
+ liveboardId,
1276
+ spotterChatConfig: { starterPrompts },
1277
+ });
1278
+ (0, test_utils_1.mockMessageChannel)();
1279
+ await liveboardEmbed.render();
1280
+ const mockPort = { postMessage: jest.fn() };
1281
+ await (0, test_utils_1.executeAfterWait)(() => {
1282
+ (0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
1283
+ });
1284
+ await (0, test_utils_1.executeAfterWait)(() => {
1285
+ expect(mockPort.postMessage.mock.calls[0][0].data.embedParams.starterPrompts)
1286
+ .toEqual(starterPrompts);
1287
+ });
1288
+ });
1088
1289
  test('should pass brandHeadline through spotterVizConfig in APP_INIT', async () => {
1089
1290
  const spotterViz = { brandName: 'MyBrand', brandHeadline: "Hi, there! I'm" };
1090
1291
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
@@ -1407,6 +1608,188 @@ describe('Liveboard/viz embed tests', () => {
1407
1608
  expect(iframeSrc).toContain('isFullHeightPinboard=true');
1408
1609
  }, 100);
1409
1610
  });
1611
+ test('should default lazy loading flags to true when fullHeight is enabled', async () => {
1612
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1613
+ ...defaultViewConfig,
1614
+ liveboardId,
1615
+ fullHeight: true,
1616
+ });
1617
+ expect(liveboardEmbed.viewConfig.lazyLoadingForFullHeight).toBe(true);
1618
+ expect(liveboardEmbed.viewConfig.enableScrollableContainerLazyLoading).toBe(true);
1619
+ expect(liveboardEmbed.viewConfig.lazyLoadingMargin).toBe('500px 0px');
1620
+ await liveboardEmbed.render();
1621
+ await (0, test_utils_1.executeAfterWait)(() => {
1622
+ const iframeSrc = (0, test_utils_1.getIFrameSrc)();
1623
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
1624
+ expect(iframeSrc).toContain('isFullHeightPinboard=true');
1625
+ expect(iframeSrc).toContain('rootMarginForLazyLoad=500px%200px');
1626
+ }, 100);
1627
+ });
1628
+ test('should not default lazy loading flags when fullHeight is not enabled', async () => {
1629
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1630
+ ...defaultViewConfig,
1631
+ liveboardId,
1632
+ });
1633
+ expect(liveboardEmbed.viewConfig.lazyLoadingForFullHeight).toBeUndefined();
1634
+ expect(liveboardEmbed.viewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
1635
+ expect(liveboardEmbed.viewConfig.lazyLoadingMargin).toBeUndefined();
1636
+ });
1637
+ test('should not write the defaults back onto the caller view config', async () => {
1638
+ const callerViewConfig = {
1639
+ ...defaultViewConfig,
1640
+ liveboardId,
1641
+ fullHeight: true,
1642
+ };
1643
+ new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), callerViewConfig);
1644
+ expect(callerViewConfig.lazyLoadingForFullHeight).toBeUndefined();
1645
+ expect(callerViewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
1646
+ expect(callerViewConfig.lazyLoadingMargin).toBeUndefined();
1647
+ });
1648
+ test('should not default lazy loading flags when fullHeight is explicitly false', async () => {
1649
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1650
+ ...defaultViewConfig,
1651
+ liveboardId,
1652
+ fullHeight: false,
1653
+ });
1654
+ expect(liveboardEmbed.viewConfig.lazyLoadingForFullHeight).toBeUndefined();
1655
+ expect(liveboardEmbed.viewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
1656
+ expect(liveboardEmbed.viewConfig.lazyLoadingMargin).toBeUndefined();
1657
+ });
1658
+ test('should default lazyLoadingMargin when lazyLoadingForFullHeight is set explicitly', async () => {
1659
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1660
+ ...defaultViewConfig,
1661
+ liveboardId,
1662
+ fullHeight: true,
1663
+ lazyLoadingForFullHeight: true,
1664
+ });
1665
+ expect(liveboardEmbed.viewConfig.lazyLoadingMargin).toBe(config_1.DEFAULT_LAZY_LOADING_MARGIN);
1666
+ await liveboardEmbed.render();
1667
+ await (0, test_utils_1.executeAfterWait)(() => {
1668
+ expect((0, test_utils_1.getIFrameSrc)()).toContain('rootMarginForLazyLoad=500px%200px');
1669
+ }, 100);
1670
+ });
1671
+ test('should let an explicit lazyLoadingMargin win over the default', async () => {
1672
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1673
+ ...defaultViewConfig,
1674
+ liveboardId,
1675
+ fullHeight: true,
1676
+ lazyLoadingMargin: '250px',
1677
+ });
1678
+ await liveboardEmbed.render();
1679
+ await (0, test_utils_1.executeAfterWait)(() => {
1680
+ const iframeSrc = (0, test_utils_1.getIFrameSrc)();
1681
+ expect(iframeSrc).toContain('rootMarginForLazyLoad=250px');
1682
+ expect(iframeSrc).not.toContain('rootMarginForLazyLoad=500px%200px');
1683
+ }, 100);
1684
+ });
1685
+ test('should drop an invalid lazyLoadingMargin and log an error', async () => {
1686
+ const loggerErrorSpy = jest.spyOn(logger_1.logger, 'error').mockImplementation(() => undefined);
1687
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1688
+ ...defaultViewConfig,
1689
+ liveboardId,
1690
+ fullHeight: true,
1691
+ lazyLoadingMargin: 'not-a-margin',
1692
+ });
1693
+ await liveboardEmbed.render();
1694
+ await (0, test_utils_1.executeAfterWait)(() => {
1695
+ const iframeSrc = (0, test_utils_1.getIFrameSrc)();
1696
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
1697
+ expect(iframeSrc).not.toContain('rootMarginForLazyLoad');
1698
+ expect(loggerErrorSpy).toHaveBeenCalledWith('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
1699
+ }, 100);
1700
+ });
1701
+ test('should track scrollable ancestors by default when only fullHeight is set', async () => {
1702
+ const scrollContainer = (0, test_utils_1.getRootEl)();
1703
+ scrollContainer.style.overflow = 'auto';
1704
+ const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
1705
+ const resizeObserveSpy = jest.fn();
1706
+ const resizeDisconnectSpy = jest.fn();
1707
+ const originalResizeObserver = window.ResizeObserver;
1708
+ window.ResizeObserver = jest.fn().mockImplementation(() => ({
1709
+ observe: resizeObserveSpy,
1710
+ disconnect: resizeDisconnectSpy,
1711
+ }));
1712
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1713
+ ...defaultViewConfig,
1714
+ liveboardId,
1715
+ fullHeight: true,
1716
+ });
1717
+ await liveboardEmbed.render();
1718
+ await (0, test_utils_1.executeAfterWait)(() => {
1719
+ expect(scrollContainerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
1720
+ expect(resizeObserveSpy).toHaveBeenCalledWith(scrollContainer);
1721
+ }, 100);
1722
+ liveboardEmbed.destroy();
1723
+ expect(resizeDisconnectSpy).toHaveBeenCalled();
1724
+ scrollContainer.style.overflow = '';
1725
+ window.ResizeObserver = originalResizeObserver;
1726
+ });
1727
+ test('should skip ancestor tracking when enableScrollableContainerLazyLoading is false', async () => {
1728
+ const scrollContainer = (0, test_utils_1.getRootEl)();
1729
+ scrollContainer.style.overflow = 'auto';
1730
+ const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
1731
+ const windowSpy = jest.spyOn(window, 'addEventListener');
1732
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1733
+ ...defaultViewConfig,
1734
+ liveboardId,
1735
+ fullHeight: true,
1736
+ enableScrollableContainerLazyLoading: false,
1737
+ });
1738
+ await liveboardEmbed.render();
1739
+ await (0, test_utils_1.executeAfterWait)(() => {
1740
+ expect(windowSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
1741
+ expect(scrollContainerSpy).not.toHaveBeenCalledWith('scroll', expect.any(Function));
1742
+ }, 100);
1743
+ liveboardEmbed.destroy();
1744
+ scrollContainer.style.overflow = '';
1745
+ });
1746
+ test('should wire the window scroll listener to the coordinates sender by default', async () => {
1747
+ const addEventListenerSpy = jest.spyOn(window, 'addEventListener');
1748
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1749
+ ...defaultViewConfig,
1750
+ liveboardId,
1751
+ fullHeight: true,
1752
+ });
1753
+ const mockTrigger = jest
1754
+ .spyOn(liveboardEmbed, 'trigger')
1755
+ .mockImplementation(() => Promise.resolve(undefined));
1756
+ await liveboardEmbed.render();
1757
+ await (0, test_utils_1.executeAfterWait)(() => {
1758
+ const scrollCall = addEventListenerSpy.mock.calls.find(([eventName, , capture]) => eventName === 'scroll' && capture === true);
1759
+ expect(scrollCall).toBeDefined();
1760
+ // Call the handler the way a real scroll event would.
1761
+ scrollCall[1]();
1762
+ expect(mockTrigger).toHaveBeenCalledWith(types_1.HostEvent.VisibleEmbedCoordinates, expect.objectContaining({ top: expect.any(Number) }));
1763
+ }, 100);
1764
+ liveboardEmbed.destroy();
1765
+ addEventListenerSpy.mockRestore();
1766
+ });
1767
+ test('should remove listeners on destroy when the flags come from defaults', async () => {
1768
+ const removeEventListenerSpy = jest.spyOn(window, 'removeEventListener');
1769
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1770
+ ...defaultViewConfig,
1771
+ liveboardId,
1772
+ fullHeight: true,
1773
+ });
1774
+ await liveboardEmbed.render();
1775
+ liveboardEmbed.destroy();
1776
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('resize', expect.anything());
1777
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
1778
+ removeEventListenerSpy.mockRestore();
1779
+ });
1780
+ test('should keep an explicit false for the lazy loading flags', async () => {
1781
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1782
+ ...defaultViewConfig,
1783
+ liveboardId,
1784
+ fullHeight: true,
1785
+ lazyLoadingForFullHeight: false,
1786
+ enableScrollableContainerLazyLoading: false,
1787
+ lazyLoadingMargin: '0px',
1788
+ });
1789
+ expect(liveboardEmbed.viewConfig.lazyLoadingForFullHeight).toBe(false);
1790
+ expect(liveboardEmbed.viewConfig.enableScrollableContainerLazyLoading).toBe(false);
1791
+ expect(liveboardEmbed.viewConfig.lazyLoadingMargin).toBe('0px');
1792
+ });
1410
1793
  test('should not set lazyLoadingForEmbed when lazyLoadingForFullHeight is enabled but fullHeight is false', async () => {
1411
1794
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1412
1795
  ...defaultViewConfig,
@@ -1471,7 +1854,7 @@ describe('Liveboard/viz embed tests', () => {
1471
1854
  width: 650,
1472
1855
  });
1473
1856
  });
1474
- test('should send correct visible data when RequestVisibleEmbedCoordinates is triggered', async () => {
1857
+ test('should send visible data when fullHeight is enabled and lazyLoadingForFullHeight is omitted', async () => {
1475
1858
  const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
1476
1859
  ...defaultViewConfig,
1477
1860
  liveboardId,
@@ -1482,7 +1865,7 @@ describe('Liveboard/viz embed tests', () => {
1482
1865
  await liveboardEmbed.render();
1483
1866
  // Trigger the lazy load data calculation
1484
1867
  liveboardEmbed.sendFullHeightLazyLoadData();
1485
- expect(mockTrigger).not.toHaveBeenCalledWith(types_1.HostEvent.VisibleEmbedCoordinates, {
1868
+ expect(mockTrigger).toHaveBeenCalledWith(types_1.HostEvent.VisibleEmbedCoordinates, {
1486
1869
  top: 0,
1487
1870
  height: 500,
1488
1871
  left: 0,
@@ -1787,4 +2170,49 @@ describe('Liveboard/viz embed tests', () => {
1787
2170
  });
1788
2171
  });
1789
2172
  });
2173
+ describe('LiveboardEmbed updatedSpotterExperience tests', () => {
2174
+ beforeEach(() => {
2175
+ document.body.innerHTML = (0, test_utils_1.getDocumentBody)();
2176
+ });
2177
+ test('should render the liveboard embed with updatedSpotterExperience', async () => {
2178
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
2179
+ ...defaultViewConfig,
2180
+ liveboardId,
2181
+ updatedSpotterExperience: true,
2182
+ });
2183
+ await liveboardEmbed.render();
2184
+ await (0, test_utils_1.executeAfterWait)(() => {
2185
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}${prefixParams}&updatedSpotterExperience=true#/embed/viz/${liveboardId}`);
2186
+ });
2187
+ });
2188
+ test('should render the liveboard embed with updatedSpotterExperience disabled', async () => {
2189
+ const liveboardEmbed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
2190
+ ...defaultViewConfig,
2191
+ liveboardId,
2192
+ updatedSpotterExperience: false,
2193
+ });
2194
+ await liveboardEmbed.render();
2195
+ await (0, test_utils_1.executeAfterWait)(() => {
2196
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true${test_utils_1.defaultParams}${prefixParams}&updatedSpotterExperience=false#/embed/viz/${liveboardId}`);
2197
+ });
2198
+ });
2199
+ describe('trigger typing contracts (compile-time)', () => {
2200
+ it('infers typed response for no-payload calls through the LiveboardEmbed override', () => {
2201
+ const embed = new liveboard_1.LiveboardEmbed((0, test_utils_1.getRootEl)(), {
2202
+ liveboardId: 'test-liveboard-id',
2203
+ });
2204
+ const getTabs = () => embed.trigger(types_1.HostEvent.GetTabs);
2205
+ const tabsIsTyped = false;
2206
+ const tabsHasContractFields = true;
2207
+ const probeUnknownField = (r) =>
2208
+ // @ts-expect-error — field not on the GetTabs contract (was silent when `any`)
2209
+ r.tabCount;
2210
+ void probeUnknownField;
2211
+ const reload = () => embed.trigger(types_1.HostEvent.Reload);
2212
+ const reloadStaysAny = true;
2213
+ expect([tabsIsTyped, tabsHasContractFields, reloadStaysAny])
2214
+ .toEqual([false, true, true]);
2215
+ });
2216
+ });
2217
+ });
1790
2218
  //# sourceMappingURL=liveboard.spec.js.map