@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
@@ -4,7 +4,6 @@ import {
4
4
  DataPanelCustomColumnGroupsAccordionState,
5
5
  Page,
6
6
  HomePageSearchBarMode,
7
- PrimaryNavbarVersion,
8
7
  HomePage,
9
8
  ListPage,
10
9
  } from './app';
@@ -139,7 +138,7 @@ describe('App embed tests', () => {
139
138
  await executeAfterWait(() => {
140
139
  expectUrlMatchesWithParams(
141
140
  getIFrameSrc(),
142
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
141
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
143
142
  );
144
143
  });
145
144
  });
@@ -153,7 +152,7 @@ describe('App embed tests', () => {
153
152
  await executeAfterWait(() => {
154
153
  expectUrlMatchesWithParams(
155
154
  getIFrameSrc(),
156
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
155
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
157
156
  );
158
157
  });
159
158
  });
@@ -167,7 +166,7 @@ describe('App embed tests', () => {
167
166
  await executeAfterWait(() => {
168
167
  expectUrlMatchesWithParams(
169
168
  getIFrameSrc(),
170
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true${defaultParams}${defaultParamsPost}#/home`,
169
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
171
170
  );
172
171
  });
173
172
  });
@@ -181,7 +180,7 @@ describe('App embed tests', () => {
181
180
  await executeAfterWait(() => {
182
181
  expectUrlMatchesWithParams(
183
182
  getIFrameSrc(),
184
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true${defaultParams}${defaultParamsPost}#/home`,
183
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
185
184
  );
186
185
  });
187
186
  });
@@ -195,7 +194,7 @@ describe('App embed tests', () => {
195
194
  await executeAfterWait(() => {
196
195
  expectUrlMatchesWithParams(
197
196
  getIFrameSrc(),
198
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true${defaultParams}${defaultParamsPost}#/home`,
197
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
199
198
  );
200
199
  });
201
200
  });
@@ -212,6 +211,7 @@ describe('App embed tests', () => {
212
211
  [Page.SpotIQ]: 'insights/results',
213
212
  [Page.Monitor]: 'insights/monitor-alerts',
214
213
  [Page.Collections]: 'collections',
214
+ [Page.LiveboardSchedules]: 'home/liveboard-schedules',
215
215
  };
216
216
 
217
217
  const pageIds = Object.keys(pageRouteMap);
@@ -229,7 +229,7 @@ describe('App embed tests', () => {
229
229
  await executeAfterWait(() => {
230
230
  expectUrlMatchesWithParams(
231
231
  getIFrameSrc(),
232
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`,
232
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`,
233
233
  );
234
234
  cleanUp();
235
235
  });
@@ -246,6 +246,7 @@ describe('App embed tests', () => {
246
246
  [Page.SpotIQ]: 'home/spotiq-analysis',
247
247
  [Page.Monitor]: 'home/monitor-alerts',
248
248
  [Page.Collections]: 'collections',
249
+ [Page.LiveboardSchedules]: 'home/liveboard-schedules',
249
250
  };
250
251
 
251
252
  const pageIdsForModularHomes = Object.keys(pageRouteMapForModularHome);
@@ -264,7 +265,7 @@ describe('App embed tests', () => {
264
265
  await executeAfterWait(() => {
265
266
  expectUrlMatchesWithParams(
266
267
  getIFrameSrc(),
267
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`,
268
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`,
268
269
  );
269
270
  cleanUp();
270
271
  });
@@ -281,7 +282,7 @@ describe('App embed tests', () => {
281
282
  await executeAfterWait(() => {
282
283
  expectUrlMatchesWithParams(
283
284
  getIFrameSrc(),
284
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/foo/bar`,
285
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/foo/bar`,
285
286
  );
286
287
  });
287
288
  });
@@ -304,7 +305,7 @@ describe('App embed tests', () => {
304
305
  await executeAfterWait(() => {
305
306
  expectUrlMatchesWithParams(
306
307
  getIFrameSrc(),
307
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000${defaultParams}${defaultParamsPost}#/home`,
308
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
308
309
  );
309
310
  });
310
311
  });
@@ -327,7 +328,7 @@ describe('App embed tests', () => {
327
328
  await executeAfterWait(() => {
328
329
  expectUrlMatchesWithParams(
329
330
  getIFrameSrc(),
330
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
331
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
331
332
  );
332
333
  });
333
334
  });
@@ -351,7 +352,7 @@ describe('App embed tests', () => {
351
352
  await executeAfterWait(() => {
352
353
  expectUrlMatchesWithParams(
353
354
  getIFrameSrc(),
354
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`,
355
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`,
355
356
  );
356
357
  });
357
358
  });
@@ -369,7 +370,7 @@ describe('App embed tests', () => {
369
370
  await executeAfterWait(() => {
370
371
  expectUrlMatchesWithParams(
371
372
  getIFrameSrc(),
372
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&${defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`,
373
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`,
373
374
  );
374
375
  });
375
376
  });
@@ -384,7 +385,22 @@ describe('App embed tests', () => {
384
385
  await executeAfterWait(() => {
385
386
  expectUrlMatchesWithParams(
386
387
  getIFrameSrc(),
387
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`,
388
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
389
+ );
390
+ });
391
+ });
392
+
393
+ test('should set isLiveboardAlwaysOn12ColLayout to true in url', async () => {
394
+ const appEmbed = new AppEmbed(getRootEl(), {
395
+ ...defaultViewConfig,
396
+ isLiveboardAlwaysOn12ColLayout: true,
397
+ } as AppViewConfig);
398
+
399
+ appEmbed.render();
400
+ await executeAfterWait(() => {
401
+ expectUrlMatchesWithParams(
402
+ getIFrameSrc(),
403
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardAlwaysOn12ColLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
388
404
  );
389
405
  });
390
406
  });
@@ -398,7 +414,7 @@ describe('App embed tests', () => {
398
414
  await executeAfterWait(() => {
399
415
  expectUrlMatchesWithParams(
400
416
  getIFrameSrc(),
401
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false${defaultParamsPost}#/home`,
417
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
402
418
  );
403
419
  });
404
420
  });
@@ -412,7 +428,21 @@ describe('App embed tests', () => {
412
428
  await executeAfterWait(() => {
413
429
  expectUrlMatchesWithParams(
414
430
  getIFrameSrc(),
415
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true${defaultParamsPost}#/home`,
431
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
432
+ );
433
+ });
434
+ });
435
+
436
+ test('should set liveboardGutter in url', async () => {
437
+ const appEmbed = new AppEmbed(getRootEl(), {
438
+ ...defaultViewConfig,
439
+ liveboardGutter: 8,
440
+ } as AppViewConfig);
441
+ appEmbed.render();
442
+ await executeAfterWait(() => {
443
+ expectUrlMatchesWithParams(
444
+ getIFrameSrc(),
445
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&liveboardGutter=8&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
416
446
  );
417
447
  });
418
448
  });
@@ -426,7 +456,7 @@ describe('App embed tests', () => {
426
456
  await executeAfterWait(() => {
427
457
  expectUrlMatchesWithParams(
428
458
  getIFrameSrc(),
429
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true${defaultParamsPost}#/home`,
459
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
430
460
  );
431
461
  });
432
462
  });
@@ -440,7 +470,7 @@ describe('App embed tests', () => {
440
470
  await executeAfterWait(() => {
441
471
  expectUrlMatchesWithParams(
442
472
  getIFrameSrc(),
443
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true${defaultParamsPost}#/home`,
473
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
444
474
  );
445
475
  });
446
476
  });
@@ -451,7 +481,7 @@ describe('App embed tests', () => {
451
481
  await executeAfterWait(() => {
452
482
  expectUrlMatchesWithParams(
453
483
  getIFrameSrc(),
454
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false${defaultParamsPost}#/home`,
484
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
455
485
  );
456
486
  });
457
487
  });
@@ -465,7 +495,7 @@ describe('App embed tests', () => {
465
495
  await executeAfterWait(() => {
466
496
  expectUrlMatchesWithParams(
467
497
  getIFrameSrc(),
468
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`,
498
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
469
499
  );
470
500
  });
471
501
  });
@@ -479,12 +509,12 @@ describe('App embed tests', () => {
479
509
  await executeAfterWait(() => {
480
510
  expectUrlMatchesWithParams(
481
511
  getIFrameSrc(),
482
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true${defaultParamsPost}#/home`,
512
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
483
513
  );
484
514
  });
485
515
  });
486
516
 
487
- test('should disable isWYSIWYGLiveboardPDFEnabled by default in url', async () => {
517
+ test('should not set isWYSIWYGLiveboardPDFEnabled in url by default', async () => {
488
518
  const appEmbed = new AppEmbed(getRootEl(), {
489
519
  ...defaultViewConfig,
490
520
  } as AppViewConfig);
@@ -492,7 +522,7 @@ describe('App embed tests', () => {
492
522
  await executeAfterWait(() => {
493
523
  expectUrlMatchesWithParams(
494
524
  getIFrameSrc(),
495
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=false${defaultParamsPost}#/home`,
525
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
496
526
  );
497
527
  });
498
528
  });
@@ -506,7 +536,7 @@ describe('App embed tests', () => {
506
536
  await executeAfterWait(() => {
507
537
  expectUrlMatchesWithParams(
508
538
  getIFrameSrc(),
509
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true${defaultParamsPost}#/home`,
539
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
510
540
  );
511
541
  });
512
542
  });
@@ -520,7 +550,7 @@ describe('App embed tests', () => {
520
550
  await executeAfterWait(() => {
521
551
  expectUrlMatchesWithParams(
522
552
  getIFrameSrc(),
523
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false${defaultParamsPost}#/home`,
553
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
524
554
  );
525
555
  });
526
556
  });
@@ -533,7 +563,7 @@ describe('App embed tests', () => {
533
563
  homePage: HomePage.Focused,
534
564
  },
535
565
  } as AppViewConfig,
536
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=true${defaultParams}${defaultParamsPost}#/home`,
566
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=true${defaultParams}${defaultParamsPost}#/home`,
537
567
  );
538
568
  });
539
569
 
@@ -546,7 +576,7 @@ describe('App embed tests', () => {
546
576
  },
547
577
  updatedSpotterChatPrompt: false,
548
578
  } as AppViewConfig,
549
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=false${defaultParams}${defaultParamsPost}#/home`,
579
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=false${defaultParams}${defaultParamsPost}#/home`,
550
580
  );
551
581
  });
552
582
 
@@ -559,7 +589,7 @@ describe('App embed tests', () => {
559
589
  await executeAfterWait(() => {
560
590
  expectUrlMatchesWithParams(
561
591
  getIFrameSrc(),
562
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`,
592
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
563
593
  );
564
594
  });
565
595
  });
@@ -573,7 +603,7 @@ describe('App embed tests', () => {
573
603
  await executeAfterWait(() => {
574
604
  expectUrlMatchesWithParams(
575
605
  getIFrameSrc(),
576
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true${defaultParamsPost}#/home`,
606
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
577
607
  );
578
608
  });
579
609
  });
@@ -587,7 +617,35 @@ describe('App embed tests', () => {
587
617
  await executeAfterWait(() => {
588
618
  expectUrlMatchesWithParams(
589
619
  getIFrameSrc(),
590
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false${defaultParamsPost}#/home`,
620
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
621
+ );
622
+ });
623
+ });
624
+
625
+ test('should set showSpotterRadiance to true in url', async () => {
626
+ const appEmbed = new AppEmbed(getRootEl(), {
627
+ ...defaultViewConfig,
628
+ showSpotterRadiance: true,
629
+ } as AppViewConfig);
630
+ appEmbed.render();
631
+ await executeAfterWait(() => {
632
+ expectUrlMatchesWithParams(
633
+ getIFrameSrc(),
634
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=true${defaultParamsPost}#/home`,
635
+ );
636
+ });
637
+ });
638
+
639
+ test('should set showSpotterRadiance to false in url', async () => {
640
+ const appEmbed = new AppEmbed(getRootEl(), {
641
+ ...defaultViewConfig,
642
+ showSpotterRadiance: false,
643
+ } as AppViewConfig);
644
+ appEmbed.render();
645
+ await executeAfterWait(() => {
646
+ expectUrlMatchesWithParams(
647
+ getIFrameSrc(),
648
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=false${defaultParamsPost}#/home`,
591
649
  );
592
650
  });
593
651
  });
@@ -630,11 +688,46 @@ describe('App embed tests', () => {
630
688
  await executeAfterWait(() => {
631
689
  expectUrlMatchesWithParams(
632
690
  getIFrameSrc(),
633
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true${defaultParamsPost}#/home`,
691
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
692
+ );
693
+ });
694
+ });
695
+
696
+ test('should set spotterDataSources to a list of Model GUIDs in url', async () => {
697
+ const appEmbed = new AppEmbed(getRootEl(), {
698
+ ...defaultViewConfig,
699
+ spotterDataSources: ['model-guid-123', 'model-guid-456'],
700
+ } as AppViewConfig);
701
+ appEmbed.render();
702
+ await executeAfterWait(() => {
703
+ expectUrlMatchesWithParams(
704
+ getIFrameSrc(),
705
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterDataSources=${encodeURIComponent(JSON.stringify(['model-guid-123', 'model-guid-456']))}${defaultParamsPost}#/home`,
634
706
  );
635
707
  });
636
708
  });
637
709
 
710
+ test('should not add spotterDataSources to url when not provided', async () => {
711
+ const appEmbed = new AppEmbed(getRootEl(), {
712
+ ...defaultViewConfig,
713
+ } as AppViewConfig);
714
+ appEmbed.render();
715
+ await executeAfterWait(() => {
716
+ expect(getIFrameSrc()).not.toContain('spotterDataSources');
717
+ });
718
+ });
719
+
720
+ test('should not add spotterDataSources to url when empty array', async () => {
721
+ const appEmbed = new AppEmbed(getRootEl(), {
722
+ ...defaultViewConfig,
723
+ spotterDataSources: [],
724
+ } as AppViewConfig);
725
+ appEmbed.render();
726
+ await executeAfterWait(() => {
727
+ expect(getIFrameSrc()).not.toContain('spotterDataSources');
728
+ });
729
+ });
730
+
638
731
  test('should include spotterVizConfig in APP_INIT embedParams when spotterViz is provided', async () => {
639
732
  const spotterViz = {
640
733
  brandName: 'MyBrand',
@@ -679,6 +772,40 @@ describe('App embed tests', () => {
679
772
  });
680
773
  });
681
774
 
775
+ test('should include starterPrompts in APP_INIT embedParams', async () => {
776
+ const starterPrompts = {
777
+ enable: true,
778
+ quick: {
779
+ label: 'Quick',
780
+ questions: [
781
+ { label: 'Q1', prompt: 'P1' },
782
+ { label: 'Q2', prompt: 'P2' },
783
+ ],
784
+ },
785
+ research: { label: 'Research' },
786
+ };
787
+ const appEmbed = new AppEmbed(getRootEl(), {
788
+ ...defaultViewConfig,
789
+ spotterChatConfig: { starterPrompts },
790
+ } as AppViewConfig);
791
+
792
+ mockMessageChannel();
793
+ appEmbed.render();
794
+
795
+ const mockPort: any = { postMessage: jest.fn() };
796
+ await executeAfterWait(() => {
797
+ postMessageToParent(
798
+ getIFrameEl().contentWindow,
799
+ { type: EmbedEvent.APP_INIT, data: {} },
800
+ mockPort,
801
+ );
802
+ });
803
+ await executeAfterWait(() => {
804
+ expect(mockPort.postMessage.mock.calls[0][0].data.embedParams.starterPrompts)
805
+ .toEqual(starterPrompts);
806
+ });
807
+ });
808
+
682
809
  test('should pass brandHeadline through spotterVizConfig in APP_INIT', async () => {
683
810
  const spotterViz = { brandName: 'MyBrand', brandHeadline: "Hi, there! I'm" };
684
811
  const appEmbed = new AppEmbed(getRootEl(), {
@@ -770,6 +897,104 @@ describe('App embed tests', () => {
770
897
  });
771
898
  });
772
899
 
900
+ test('should forward spotterChatPinConfig nested in spotterSidebarConfig in APP_INIT', async () => {
901
+ const spotterChatPinConfig = {
902
+ enabled: true,
903
+ pinLabel: 'Pin to top',
904
+ unpinLabel: 'Unpin',
905
+ };
906
+ const appEmbed = new AppEmbed(getRootEl(), {
907
+ ...defaultViewConfig,
908
+ spotterSidebarConfig: {
909
+ enablePastConversationsSidebar: true,
910
+ spotterChatPinConfig,
911
+ },
912
+ } as AppViewConfig);
913
+
914
+ mockMessageChannel();
915
+ appEmbed.render();
916
+
917
+ const mockPort: any = { postMessage: jest.fn() };
918
+ await executeAfterWait(() => {
919
+ postMessageToParent(
920
+ getIFrameEl().contentWindow,
921
+ { type: EmbedEvent.APP_INIT, data: {} },
922
+ mockPort,
923
+ );
924
+ });
925
+ await executeAfterWait(() => {
926
+ expect(mockPort.postMessage).toHaveBeenCalledWith({
927
+ type: EmbedEvent.APP_INIT,
928
+ data: expect.objectContaining({
929
+ embedParams: expect.objectContaining({
930
+ spotterSidebarConfig: expect.objectContaining({
931
+ spotterChatPinConfig,
932
+ }),
933
+ }),
934
+ }),
935
+ });
936
+ });
937
+ });
938
+
939
+ test('should include spotterShareConversationConfig in APP_INIT embedParams when provided', async () => {
940
+ const spotterShareConversationConfig = {
941
+ enableShareConversation: true,
942
+ spotterShareLabel: 'Share',
943
+ spotterShareModalTitle: 'Share conversation',
944
+ };
945
+ const appEmbed = new AppEmbed(getRootEl(), {
946
+ ...defaultViewConfig,
947
+ spotterShareConversationConfig,
948
+ } as AppViewConfig);
949
+
950
+ mockMessageChannel();
951
+ appEmbed.render();
952
+
953
+ const mockPort: any = { postMessage: jest.fn() };
954
+ await executeAfterWait(() => {
955
+ postMessageToParent(
956
+ getIFrameEl().contentWindow,
957
+ { type: EmbedEvent.APP_INIT, data: {} },
958
+ mockPort,
959
+ );
960
+ });
961
+ await executeAfterWait(() => {
962
+ expect(mockPort.postMessage).toHaveBeenCalledWith({
963
+ type: EmbedEvent.APP_INIT,
964
+ data: expect.objectContaining({
965
+ embedParams: expect.objectContaining({
966
+ spotterShareConversationConfig,
967
+ }),
968
+ }),
969
+ });
970
+ });
971
+ });
972
+
973
+ test('should not include spotterShareConversationConfig in APP_INIT when not provided', async () => {
974
+ const appEmbed = new AppEmbed(getRootEl(), {
975
+ ...defaultViewConfig,
976
+ } as AppViewConfig);
977
+
978
+ mockMessageChannel();
979
+ appEmbed.render();
980
+
981
+ const mockPort: any = { postMessage: jest.fn() };
982
+ await executeAfterWait(() => {
983
+ postMessageToParent(
984
+ getIFrameEl().contentWindow,
985
+ { type: EmbedEvent.APP_INIT, data: {} },
986
+ mockPort,
987
+ );
988
+ });
989
+ await executeAfterWait(() => {
990
+ const callArgs = mockPort.postMessage.mock.calls[0][0];
991
+ expect(callArgs.type).toBe(EmbedEvent.APP_INIT);
992
+ if (callArgs.data.embedParams) {
993
+ expect(callArgs.data.embedParams.spotterShareConversationConfig).toBeUndefined();
994
+ }
995
+ });
996
+ });
997
+
773
998
  test('should set toolResponseCardBrandingLabel in url via spotterChatConfig', async () => {
774
999
  const appEmbed = new AppEmbed(getRootEl(), {
775
1000
  ...defaultViewConfig,
@@ -781,7 +1006,7 @@ describe('App embed tests', () => {
781
1006
  await executeAfterWait(() => {
782
1007
  expectUrlMatchesWithParams(
783
1008
  getIFrameSrc(),
784
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand${defaultParamsPost}#/home`,
1009
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
785
1010
  );
786
1011
  });
787
1012
  });
@@ -795,7 +1020,7 @@ describe('App embed tests', () => {
795
1020
  await executeAfterWait(() => {
796
1021
  expectUrlMatchesWithParams(
797
1022
  getIFrameSrc(),
798
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true${defaultParamsPost}#/home`,
1023
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
799
1024
  );
800
1025
  });
801
1026
  });
@@ -809,11 +1034,48 @@ describe('App embed tests', () => {
809
1034
  await executeAfterWait(() => {
810
1035
  expectUrlMatchesWithParams(
811
1036
  getIFrameSrc(),
812
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true${defaultParamsPost}#/home`,
1037
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
813
1038
  );
814
1039
  });
815
1040
  });
816
1041
 
1042
+ test('should set openSpotterOnLiveboardByDefault to true in url', async () => {
1043
+ const appEmbed = new AppEmbed(getRootEl(), {
1044
+ ...defaultViewConfig,
1045
+ spotterChatConfig: { openSpotterOnLiveboardByDefault: true },
1046
+ } as AppViewConfig);
1047
+ appEmbed.render();
1048
+ await executeAfterWait(() => {
1049
+ expectUrlToHaveParamsWithValues(getIFrameSrc(), {
1050
+ openSpotterOnLiveboardByDefault: 'true',
1051
+ });
1052
+ });
1053
+ });
1054
+
1055
+ test('should set openSpotterOnLiveboardByDefault to false when explicitly disabled', async () => {
1056
+ const appEmbed = new AppEmbed(getRootEl(), {
1057
+ ...defaultViewConfig,
1058
+ spotterChatConfig: { openSpotterOnLiveboardByDefault: false },
1059
+ } as AppViewConfig);
1060
+ appEmbed.render();
1061
+ await executeAfterWait(() => {
1062
+ expectUrlToHaveParamsWithValues(getIFrameSrc(), {
1063
+ openSpotterOnLiveboardByDefault: 'false',
1064
+ });
1065
+ });
1066
+ });
1067
+
1068
+ test('should not set openSpotterOnLiveboardByDefault when it is not configured', async () => {
1069
+ const appEmbed = new AppEmbed(getRootEl(), {
1070
+ ...defaultViewConfig,
1071
+ spotterChatConfig: { enableStarterPrompts: true },
1072
+ } as AppViewConfig);
1073
+ appEmbed.render();
1074
+ await executeAfterWait(() => {
1075
+ expect(getIFrameSrc()).not.toContain('openSpotterOnLiveboardByDefault');
1076
+ });
1077
+ });
1078
+
817
1079
  test('should set spotterFileUploadFileTypes in url', async () => {
818
1080
  const appEmbed = new AppEmbed(getRootEl(), {
819
1081
  ...defaultViewConfig,
@@ -836,7 +1098,7 @@ describe('App embed tests', () => {
836
1098
  await executeAfterWait(() => {
837
1099
  expectUrlMatchesWithParams(
838
1100
  getIFrameSrc(),
839
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false${defaultParamsPost}#/home`,
1101
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
840
1102
  );
841
1103
  });
842
1104
  });
@@ -850,7 +1112,7 @@ describe('App embed tests', () => {
850
1112
  await executeAfterWait(() => {
851
1113
  expectUrlMatchesWithParams(
852
1114
  getIFrameSrc(),
853
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true${defaultParamsPost}#/home`,
1115
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
854
1116
  );
855
1117
  });
856
1118
  });
@@ -864,7 +1126,7 @@ describe('App embed tests', () => {
864
1126
  await executeAfterWait(() => {
865
1127
  expectUrlMatchesWithParams(
866
1128
  getIFrameSrc(),
867
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false${defaultParamsPost}#/home`,
1129
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
868
1130
  );
869
1131
  });
870
1132
  });
@@ -878,7 +1140,7 @@ describe('App embed tests', () => {
878
1140
  await executeAfterWait(() => {
879
1141
  expectUrlMatchesWithParams(
880
1142
  getIFrameSrc(),
881
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true${defaultParamsPost}#/home`,
1143
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
882
1144
  );
883
1145
  });
884
1146
  });
@@ -892,11 +1154,49 @@ describe('App embed tests', () => {
892
1154
  await executeAfterWait(() => {
893
1155
  expectUrlMatchesWithParams(
894
1156
  getIFrameSrc(),
895
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false${defaultParamsPost}#/home`,
1157
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
1158
+ );
1159
+ });
1160
+ });
1161
+
1162
+ test('should set isScopedLiveboardFilteringEnabled to true in url', async () => {
1163
+ const appEmbed = new AppEmbed(getRootEl(), {
1164
+ ...defaultViewConfig,
1165
+ isScopedLiveboardFilteringEnabled: true,
1166
+ } as AppViewConfig);
1167
+ appEmbed.render();
1168
+ await executeAfterWait(() => {
1169
+ expectUrlMatchesWithParams(
1170
+ getIFrameSrc(),
1171
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=true${defaultParamsPost}#/home`,
1172
+ );
1173
+ });
1174
+ });
1175
+
1176
+ test('should set isScopedLiveboardFilteringEnabled to false in url', async () => {
1177
+ const appEmbed = new AppEmbed(getRootEl(), {
1178
+ ...defaultViewConfig,
1179
+ isScopedLiveboardFilteringEnabled: false,
1180
+ } as AppViewConfig);
1181
+ appEmbed.render();
1182
+ await executeAfterWait(() => {
1183
+ expectUrlMatchesWithParams(
1184
+ getIFrameSrc(),
1185
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=false${defaultParamsPost}#/home`,
896
1186
  );
897
1187
  });
898
1188
  });
899
1189
 
1190
+ test('should not set isScopedLiveboardFilteringEnabled in url when undefined', async () => {
1191
+ const appEmbed = new AppEmbed(getRootEl(), {
1192
+ ...defaultViewConfig,
1193
+ } as AppViewConfig);
1194
+ appEmbed.render();
1195
+ await executeAfterWait(() => {
1196
+ expect(getIFrameSrc()).not.toContain('isScopedLiveboardFilteringEnabled');
1197
+ });
1198
+ });
1199
+
900
1200
  test('Should add the tag to the iframe src', async () => {
901
1201
  const appEmbed = new AppEmbed(getRootEl(), {
902
1202
  ...defaultViewConfig,
@@ -908,7 +1208,7 @@ describe('App embed tests', () => {
908
1208
  await executeAfterWait(() => {
909
1209
  expectUrlMatchesWithParams(
910
1210
  getIFrameSrc(),
911
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&tag=Finance${defaultParamsPost}#/home`,
1211
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&tag=Finance${defaultParamsPost}#/home`,
912
1212
  );
913
1213
  });
914
1214
  });
@@ -924,7 +1224,7 @@ describe('App embed tests', () => {
924
1224
  await executeAfterWait(() => {
925
1225
  expectUrlMatchesWithParams(
926
1226
  getIFrameSrc(),
927
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`,
1227
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`,
928
1228
  );
929
1229
  });
930
1230
  });
@@ -939,7 +1239,7 @@ describe('App embed tests', () => {
939
1239
  await executeAfterWait(() => {
940
1240
  expectUrlMatchesWithParams(
941
1241
  getIFrameSrc(),
942
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`,
1242
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`,
943
1243
  );
944
1244
  });
945
1245
  });
@@ -953,7 +1253,7 @@ describe('App embed tests', () => {
953
1253
  await executeAfterWait(() => {
954
1254
  expectUrlMatchesWithParams(
955
1255
  getIFrameSrc(),
956
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
1256
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
957
1257
  );
958
1258
  });
959
1259
  });
@@ -969,7 +1269,7 @@ describe('App embed tests', () => {
969
1269
  await executeAfterWait(() => {
970
1270
  expectUrlMatchesWithParams(
971
1271
  getIFrameSrc(),
972
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true${defaultParams}${defaultParamsPost}#/home`,
1272
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
973
1273
  );
974
1274
  });
975
1275
  });
@@ -985,7 +1285,7 @@ describe('App embed tests', () => {
985
1285
  await executeAfterWait(() => {
986
1286
  expectUrlMatchesWithParams(
987
1287
  getIFrameSrc(),
988
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${defaultParams}${defaultParamsPost}#/home`,
1288
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
989
1289
  );
990
1290
  });
991
1291
  });
@@ -1000,7 +1300,7 @@ describe('App embed tests', () => {
1000
1300
  await executeAfterWait(() => {
1001
1301
  expectUrlMatchesWithParams(
1002
1302
  getIFrameSrc(),
1003
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${defaultParams}${defaultParamsPost}#/home`,
1303
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1004
1304
  );
1005
1305
  });
1006
1306
  });
@@ -1016,7 +1316,7 @@ describe('App embed tests', () => {
1016
1316
  await executeAfterWait(() => {
1017
1317
  expectUrlMatchesWithParams(
1018
1318
  getIFrameSrc(),
1019
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true${defaultParams}${defaultParamsPost}#/home`,
1319
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1020
1320
  );
1021
1321
  });
1022
1322
  });
@@ -1032,22 +1332,7 @@ describe('App embed tests', () => {
1032
1332
  await executeAfterWait(() => {
1033
1333
  expectUrlMatchesWithParams(
1034
1334
  getIFrameSrc(),
1035
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${defaultParams}${defaultParamsPost}#/home`,
1036
- );
1037
- });
1038
- });
1039
-
1040
- test('Should add default isLiveboardMasterpiecesEnabled false when not specified', async () => {
1041
- const appEmbed = new AppEmbed(getRootEl(), {
1042
- ...defaultViewConfig,
1043
- showPrimaryNavbar: false,
1044
- } as AppViewConfig);
1045
-
1046
- appEmbed.render();
1047
- await executeAfterWait(() => {
1048
- expectUrlMatchesWithParams(
1049
- getIFrameSrc(),
1050
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${defaultParams}${defaultParamsPost}#/home`,
1335
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1051
1336
  );
1052
1337
  });
1053
1338
  });
@@ -1063,7 +1348,7 @@ describe('App embed tests', () => {
1063
1348
  await executeAfterWait(() => {
1064
1349
  expectUrlMatchesWithParams(
1065
1350
  getIFrameSrc(),
1066
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true${defaultParams}${defaultParamsPost}#/home`,
1351
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1067
1352
  );
1068
1353
  });
1069
1354
  });
@@ -1079,7 +1364,7 @@ describe('App embed tests', () => {
1079
1364
  await executeAfterWait(() => {
1080
1365
  expectUrlMatchesWithParams(
1081
1366
  getIFrameSrc(),
1082
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false${defaultParams}${defaultParamsPost}#/home`,
1367
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1083
1368
  );
1084
1369
  });
1085
1370
  });
@@ -1094,7 +1379,7 @@ describe('App embed tests', () => {
1094
1379
  await executeAfterWait(() => {
1095
1380
  expectUrlMatchesWithParams(
1096
1381
  getIFrameSrc(),
1097
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
1382
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1098
1383
  );
1099
1384
  });
1100
1385
  });
@@ -1109,7 +1394,7 @@ describe('App embed tests', () => {
1109
1394
  await executeAfterWait(() => {
1110
1395
  expectUrlMatchesWithParams(
1111
1396
  getIFrameSrc(),
1112
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true${defaultParams}${defaultParamsPost}#/home`,
1397
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1113
1398
  );
1114
1399
  });
1115
1400
  });
@@ -1124,7 +1409,7 @@ describe('App embed tests', () => {
1124
1409
  await executeAfterWait(() => {
1125
1410
  expectUrlMatchesWithParams(
1126
1411
  getIFrameSrc(),
1127
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true${defaultParams}${defaultParamsPost}#/home`,
1412
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1128
1413
  );
1129
1414
  });
1130
1415
  });
@@ -1139,7 +1424,7 @@ describe('App embed tests', () => {
1139
1424
  await executeAfterWait(() => {
1140
1425
  expectUrlMatchesWithParams(
1141
1426
  getIFrameSrc(),
1142
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false${defaultParams}${defaultParamsPost}#/home`,
1427
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1143
1428
  );
1144
1429
  });
1145
1430
  });
@@ -1154,7 +1439,7 @@ describe('App embed tests', () => {
1154
1439
  await executeAfterWait(() => {
1155
1440
  expectUrlMatchesWithParams(
1156
1441
  getIFrameSrc(),
1157
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false${defaultParams}${defaultParamsPost}#/home`,
1442
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1158
1443
  );
1159
1444
  });
1160
1445
  });
@@ -1169,7 +1454,7 @@ describe('App embed tests', () => {
1169
1454
  await executeAfterWait(() => {
1170
1455
  expectUrlMatchesWithParams(
1171
1456
  getIFrameSrc(),
1172
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false${defaultParams}${defaultParamsPost}#/home`,
1457
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1173
1458
  );
1174
1459
  });
1175
1460
  });
@@ -1185,7 +1470,7 @@ describe('App embed tests', () => {
1185
1470
  await executeAfterWait(() => {
1186
1471
  expectUrlMatchesWithParams(
1187
1472
  getIFrameSrc(),
1188
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`,
1473
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1189
1474
  );
1190
1475
  });
1191
1476
  appEmbedTrue.destroy();
@@ -1200,7 +1485,7 @@ describe('App embed tests', () => {
1200
1485
  await executeAfterWait(() => {
1201
1486
  expectUrlMatchesWithParams(
1202
1487
  getIFrameSrc(),
1203
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${defaultParams}${defaultParamsPost}#/home`,
1488
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1204
1489
  );
1205
1490
  });
1206
1491
  appEmbedFalse.destroy();
@@ -1214,7 +1499,7 @@ describe('App embed tests', () => {
1214
1499
  await executeAfterWait(() => {
1215
1500
  expectUrlMatchesWithParams(
1216
1501
  getIFrameSrc(),
1217
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`,
1502
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1218
1503
  );
1219
1504
  });
1220
1505
  });
@@ -1270,7 +1555,7 @@ describe('App embed tests', () => {
1270
1555
  await executeAfterWait(() => {
1271
1556
  expectUrlMatchesWithParams(
1272
1557
  getIFrameSrc(),
1273
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false${defaultParams}${defaultParamsPost}#/home`,
1558
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1274
1559
  );
1275
1560
  });
1276
1561
  });
@@ -1285,7 +1570,7 @@ describe('App embed tests', () => {
1285
1570
  await executeAfterWait(() => {
1286
1571
  expectUrlMatchesWithParams(
1287
1572
  getIFrameSrc(),
1288
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false${defaultParams}${defaultParamsPost}#/home`,
1573
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1289
1574
  );
1290
1575
  });
1291
1576
  });
@@ -1299,7 +1584,7 @@ describe('App embed tests', () => {
1299
1584
  await executeAfterWait(() => {
1300
1585
  expectUrlMatchesWithParams(
1301
1586
  getIFrameSrc(),
1302
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false${defaultParams}${defaultParamsPost}#/home`,
1587
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1303
1588
  );
1304
1589
  });
1305
1590
  });
@@ -1313,7 +1598,7 @@ describe('App embed tests', () => {
1313
1598
  await executeAfterWait(() => {
1314
1599
  expectUrlMatchesWithParams(
1315
1600
  getIFrameSrc(),
1316
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true${defaultParams}${defaultParamsPost}#/home`,
1601
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1317
1602
  );
1318
1603
  });
1319
1604
  });
@@ -1328,7 +1613,7 @@ describe('App embed tests', () => {
1328
1613
  await executeAfterWait(() => {
1329
1614
  expectUrlMatchesWithParams(
1330
1615
  getIFrameSrc(),
1331
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`,
1616
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1332
1617
  );
1333
1618
  });
1334
1619
  });
@@ -1343,7 +1628,7 @@ describe('App embed tests', () => {
1343
1628
  await executeAfterWait(() => {
1344
1629
  expectUrlMatchesWithParams(
1345
1630
  getIFrameSrc(),
1346
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&hideHomepageLeftNav=false${defaultParams}${defaultParamsPost}#/home`,
1631
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHomepageLeftNav=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1347
1632
  );
1348
1633
  });
1349
1634
  });
@@ -1360,7 +1645,7 @@ describe('App embed tests', () => {
1360
1645
  await executeAfterWait(() => {
1361
1646
  expectUrlMatchesWithParams(
1362
1647
  getIFrameSrc(),
1363
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true${defaultParams}${defaultParamsPost}#/home`,
1648
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1364
1649
  );
1365
1650
  });
1366
1651
  });
@@ -1377,128 +1662,51 @@ describe('App embed tests', () => {
1377
1662
  await executeAfterWait(() => {
1378
1663
  expectUrlMatchesWithParams(
1379
1664
  getIFrameSrc(),
1380
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`,
1665
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1381
1666
  );
1382
1667
  });
1383
1668
  });
1384
1669
 
1385
- test('Should add navigationVersion=v3 when primaryNavbarVersion is Sliding to the iframe src', async () => {
1670
+ test('Should add enableAskSage flag to the iframe src', async () => {
1386
1671
  await testUrlParams(
1387
1672
  {
1388
1673
  ...defaultViewConfig,
1389
- discoveryExperience: {
1390
- primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
1391
- homePage: HomePage.Modular,
1392
- },
1674
+ enableAskSage: true,
1393
1675
  } as AppViewConfig,
1394
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`
1676
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableAskSage=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
1395
1677
  );
1396
1678
  });
1397
1679
 
1398
- test('Should not add navigationVersion=v3 when primaryNavbarVersion is not added to the iframe src', async () => {
1680
+ test('Should add listpageVersion=v3 when listPageVersion is ListWithUXChanges to the iframe src', async () => {
1399
1681
  await testUrlParams(
1400
1682
  {
1401
1683
  ...defaultViewConfig,
1402
1684
  discoveryExperience: {
1403
- homePage: HomePage.Modular,
1685
+ listPageVersion: ListPage.ListWithUXChanges,
1404
1686
  },
1405
1687
  } as AppViewConfig,
1406
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`
1688
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&listpageVersion=v3&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
1407
1689
  );
1408
1690
  });
1409
1691
 
1410
- test('Should add navigationVersion=v3 & modularHomeExperience=true when primaryNavbarVersion is Sliding to the iframe src', async () => {
1692
+ test('Should send navigationVersion=v3 & homepageVersion=v3 by default when no discoveryExperience is provided', async () => {
1411
1693
  await testUrlParams(
1412
1694
  {
1413
1695
  ...defaultViewConfig,
1414
- // homePage v2 config not included under discoveryExperience
1415
- discoveryExperience: {
1416
- primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
1417
- },
1418
- } as AppViewConfig,
1419
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`
1420
- );
1421
- });
1422
-
1423
- test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when Sliding and ModularWithStylingChanges configured in the iframe src', async () => {
1424
- await testUrlParams(
1425
- {
1426
- ...defaultViewConfig,
1427
- discoveryExperience: {
1428
- primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
1429
- homePage: HomePage.ModularWithStylingChanges,
1430
- },
1431
- } as AppViewConfig,
1432
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
1433
- );
1434
- });
1435
-
1436
- test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when homePage is ModularWithStylingChanges to the iframe src', async () => {
1437
- await testUrlParams(
1438
- {
1439
- ...defaultViewConfig,
1440
- // primaryNavbarVersion is not included under
1441
- // discoveryExperience, then it set navigationVersion=v2 and
1442
- // modularHomeExperience=false.
1443
- discoveryExperience: {
1444
- homePage: HomePage.ModularWithStylingChanges,
1445
- },
1446
- } as AppViewConfig,
1447
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
1448
- );
1449
- });
1450
-
1451
- test('Should add navigationVersion=v2 when primaryNavbarVersion is not added to the iframe src', async () => {
1452
- await testUrlParams(
1453
- {
1454
- ...defaultViewConfig,
1455
- } as AppViewConfig,
1456
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2${defaultParams}${defaultParamsPost}#/home`
1457
- );
1458
- });
1459
-
1460
- test('Should add enableAskSage flag to the iframe src', async () => {
1461
- await testUrlParams(
1462
- {
1463
- ...defaultViewConfig,
1464
- enableAskSage: true,
1465
- } as AppViewConfig,
1466
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&enableAskSage=true${defaultParams}${defaultParamsPost}#/home`
1467
- );
1468
- });
1469
-
1470
- test('Should add listpageVersion=v3 when listPageVersion is ListWithUXChanges to the iframe src', async () => {
1471
- await testUrlParams(
1472
- {
1473
- ...defaultViewConfig,
1474
- discoveryExperience: {
1475
- listPageVersion: ListPage.ListWithUXChanges,
1476
- },
1477
1696
  } as AppViewConfig,
1478
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`
1697
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
1479
1698
  );
1480
1699
  });
1481
1700
 
1482
- test('Should add listpageVersion=v2 by default when no discoveryExperience is provided', async () => {
1483
- await testUrlParams(
1484
- {
1485
- ...defaultViewConfig,
1486
- } as AppViewConfig,
1487
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2${defaultParams}${defaultParamsPost}#/home`
1488
- );
1489
- });
1490
-
1491
- test('Should add listpageVersion=v2 by default when discoveryExperience is provided but listPageVersion is not specified', async () => {
1492
- await testUrlParams(
1493
- {
1494
- ...defaultViewConfig,
1495
- discoveryExperience: {
1496
- primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
1497
- homePage: HomePage.Modular,
1498
- },
1499
- } as AppViewConfig,
1500
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`
1501
- );
1701
+ test('Should not send modularHomeExperience param by default when not specified', async () => {
1702
+ const appEmbed = new AppEmbed(getRootEl(), {
1703
+ ...defaultViewConfig,
1704
+ } as AppViewConfig);
1705
+ appEmbed.render();
1706
+ await executeAfterWait(() => {
1707
+ const url = new URL(getIFrameSrc());
1708
+ expect(url.searchParams.has('modularHomeExperience')).toBe(false);
1709
+ });
1502
1710
  });
1503
1711
 
1504
1712
 
@@ -1507,12 +1715,10 @@ describe('App embed tests', () => {
1507
1715
  {
1508
1716
  ...defaultViewConfig,
1509
1717
  discoveryExperience: {
1510
- primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
1511
- homePage: HomePage.Modular,
1512
1718
  listPageVersion: ListPage.ListWithUXChanges,
1513
1719
  },
1514
1720
  } as AppViewConfig,
1515
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`
1721
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`
1516
1722
  );
1517
1723
  });
1518
1724
 
@@ -1525,7 +1731,7 @@ describe('App embed tests', () => {
1525
1731
  await executeAfterWait(() => {
1526
1732
  expectUrlMatchesWithParams(
1527
1733
  getIFrameSrc(),
1528
- `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`,
1734
+ `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1529
1735
  );
1530
1736
  });
1531
1737
 
@@ -1538,7 +1744,7 @@ describe('App embed tests', () => {
1538
1744
  await executeAfterWait(() => {
1539
1745
  expectUrlMatchesWithParams(
1540
1746
  getIFrameSrc(),
1541
- `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`,
1747
+ `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1542
1748
  );
1543
1749
  });
1544
1750
  });
@@ -1552,7 +1758,7 @@ describe('App embed tests', () => {
1552
1758
  await executeAfterWait(() => {
1553
1759
  expectUrlMatchesWithParams(
1554
1760
  getIFrameSrc(),
1555
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true${defaultParamsPost}#/home`,
1761
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
1556
1762
  );
1557
1763
  });
1558
1764
  });
@@ -1566,7 +1772,7 @@ describe('App embed tests', () => {
1566
1772
  await executeAfterWait(() => {
1567
1773
  expectUrlMatchesWithParams(
1568
1774
  getIFrameSrc(),
1569
- `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false${defaultParamsPost}#/home`,
1775
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
1570
1776
  );
1571
1777
  });
1572
1778
  });
@@ -1591,7 +1797,7 @@ describe('App embed tests', () => {
1591
1797
  await executeAfterWait(() => {
1592
1798
  expectUrlMatchesWithParams(
1593
1799
  getIFrameSrc(),
1594
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=objectSearch${defaultParams}${defaultParamsPost}#/home`,
1800
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=objectSearch&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1595
1801
  );
1596
1802
  });
1597
1803
  });
@@ -1606,7 +1812,7 @@ describe('App embed tests', () => {
1606
1812
  await executeAfterWait(() => {
1607
1813
  expectUrlMatchesWithParams(
1608
1814
  getIFrameSrc(),
1609
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=aiAnswer${defaultParams}${defaultParamsPost}#/home`,
1815
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=aiAnswer&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1610
1816
  );
1611
1817
  });
1612
1818
  });
@@ -1621,7 +1827,7 @@ describe('App embed tests', () => {
1621
1827
  await executeAfterWait(() => {
1622
1828
  expectUrlMatchesWithParams(
1623
1829
  getIFrameSrc(),
1624
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=none${defaultParams}${defaultParamsPost}#/home`,
1830
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=none&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1625
1831
  );
1626
1832
  });
1627
1833
  });
@@ -1638,7 +1844,7 @@ describe('App embed tests', () => {
1638
1844
  await executeAfterWait(() => {
1639
1845
  expectUrlMatchesWithParams(
1640
1846
  getIFrameSrc(),
1641
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST${defaultParams}${defaultParamsPost}#/home`,
1847
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
1642
1848
  );
1643
1849
  });
1644
1850
  });
@@ -1699,7 +1905,7 @@ describe('App embed tests', () => {
1699
1905
  appEmbed.navigateToPage(path);
1700
1906
  expectUrlMatchesWithParams(
1701
1907
  getIFrameSrc(),
1702
- `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
1908
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
1703
1909
  );
1704
1910
  });
1705
1911
 
@@ -1953,6 +2159,238 @@ describe('App embed tests', () => {
1953
2159
  }, 100);
1954
2160
  });
1955
2161
 
2162
+ test('should default lazy loading flags to true when fullHeight is enabled', async () => {
2163
+ const appEmbed = new AppEmbed(getRootEl(), {
2164
+ ...defaultViewConfig,
2165
+ fullHeight: true,
2166
+ } as AppViewConfig);
2167
+
2168
+ expect((appEmbed as any).viewConfig.lazyLoadingForFullHeight).toBe(true);
2169
+ expect((appEmbed as any).viewConfig.enableScrollableContainerLazyLoading).toBe(true);
2170
+ expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBe('500px 0px');
2171
+
2172
+ await appEmbed.render();
2173
+
2174
+ await executeAfterWait(() => {
2175
+ const iframeSrc = getIFrameSrc();
2176
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
2177
+ expect(iframeSrc).toContain('isFullHeightPinboard=true');
2178
+ expect(iframeSrc).toContain('rootMarginForLazyLoad=500px%200px');
2179
+ }, 100);
2180
+ });
2181
+
2182
+ test('should not default lazy loading flags when fullHeight is not enabled', async () => {
2183
+ const appEmbed = new AppEmbed(getRootEl(), {
2184
+ ...defaultViewConfig,
2185
+ } as AppViewConfig);
2186
+
2187
+ expect((appEmbed as any).viewConfig.lazyLoadingForFullHeight).toBeUndefined();
2188
+ expect(
2189
+ (appEmbed as any).viewConfig.enableScrollableContainerLazyLoading,
2190
+ ).toBeUndefined();
2191
+ expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBeUndefined();
2192
+ });
2193
+
2194
+ test('should not write the defaults back onto the caller view config', async () => {
2195
+ const callerViewConfig = {
2196
+ ...defaultViewConfig,
2197
+ fullHeight: true,
2198
+ } as AppViewConfig;
2199
+
2200
+ new AppEmbed(getRootEl(), callerViewConfig);
2201
+
2202
+ expect(callerViewConfig.lazyLoadingForFullHeight).toBeUndefined();
2203
+ expect(callerViewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
2204
+ expect(callerViewConfig.lazyLoadingMargin).toBeUndefined();
2205
+ });
2206
+
2207
+ test('should not default lazy loading flags when fullHeight is explicitly false', async () => {
2208
+ const appEmbed = new AppEmbed(getRootEl(), {
2209
+ ...defaultViewConfig,
2210
+ fullHeight: false,
2211
+ } as AppViewConfig);
2212
+
2213
+ expect((appEmbed as any).viewConfig.lazyLoadingForFullHeight).toBeUndefined();
2214
+ expect(
2215
+ (appEmbed as any).viewConfig.enableScrollableContainerLazyLoading,
2216
+ ).toBeUndefined();
2217
+ expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBeUndefined();
2218
+ });
2219
+
2220
+ test('should default lazyLoadingMargin when lazyLoadingForFullHeight is set explicitly', async () => {
2221
+ const appEmbed = new AppEmbed(getRootEl(), {
2222
+ ...defaultViewConfig,
2223
+ fullHeight: true,
2224
+ lazyLoadingForFullHeight: true,
2225
+ } as AppViewConfig);
2226
+
2227
+ expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBe(
2228
+ config.DEFAULT_LAZY_LOADING_MARGIN,
2229
+ );
2230
+
2231
+ await appEmbed.render();
2232
+
2233
+ await executeAfterWait(() => {
2234
+ expect(getIFrameSrc()).toContain('rootMarginForLazyLoad=500px%200px');
2235
+ }, 100);
2236
+ });
2237
+
2238
+ test('should let an explicit lazyLoadingMargin win over the default', async () => {
2239
+ const appEmbed = new AppEmbed(getRootEl(), {
2240
+ ...defaultViewConfig,
2241
+ fullHeight: true,
2242
+ lazyLoadingMargin: '250px',
2243
+ } as AppViewConfig);
2244
+
2245
+ await appEmbed.render();
2246
+
2247
+ await executeAfterWait(() => {
2248
+ const iframeSrc = getIFrameSrc();
2249
+ expect(iframeSrc).toContain('rootMarginForLazyLoad=250px');
2250
+ expect(iframeSrc).not.toContain('rootMarginForLazyLoad=500px%200px');
2251
+ }, 100);
2252
+ });
2253
+
2254
+ test('should drop an invalid lazyLoadingMargin and log an error', async () => {
2255
+ const loggerErrorSpy = jest.spyOn(logger, 'error').mockImplementation(() => undefined);
2256
+
2257
+ const appEmbed = new AppEmbed(getRootEl(), {
2258
+ ...defaultViewConfig,
2259
+ fullHeight: true,
2260
+ lazyLoadingMargin: 'not-a-margin',
2261
+ } as AppViewConfig);
2262
+
2263
+ await appEmbed.render();
2264
+
2265
+ await executeAfterWait(() => {
2266
+ const iframeSrc = getIFrameSrc();
2267
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
2268
+ expect(iframeSrc).not.toContain('rootMarginForLazyLoad');
2269
+ expect(loggerErrorSpy).toHaveBeenCalledWith(
2270
+ 'Please provide a valid lazyLoadingMargin value (e.g., "10px")',
2271
+ );
2272
+ }, 100);
2273
+ });
2274
+
2275
+ test('should track scrollable ancestors by default when only fullHeight is set', async () => {
2276
+ const scrollContainer = getRootEl();
2277
+ scrollContainer.style.overflow = 'auto';
2278
+
2279
+ const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
2280
+ const resizeObserveSpy = jest.fn();
2281
+ const resizeDisconnectSpy = jest.fn();
2282
+ (window as any).ResizeObserver = jest.fn().mockImplementation(() => ({
2283
+ observe: resizeObserveSpy,
2284
+ disconnect: resizeDisconnectSpy,
2285
+ }));
2286
+
2287
+ const appEmbed = new AppEmbed(getRootEl(), {
2288
+ ...defaultViewConfig,
2289
+ fullHeight: true,
2290
+ } as AppViewConfig);
2291
+
2292
+ await appEmbed.render();
2293
+
2294
+ await executeAfterWait(() => {
2295
+ expect(scrollContainerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
2296
+ expect(resizeObserveSpy).toHaveBeenCalledWith(scrollContainer);
2297
+ }, 100);
2298
+
2299
+ appEmbed.destroy();
2300
+ expect(resizeDisconnectSpy).toHaveBeenCalled();
2301
+
2302
+ scrollContainer.style.overflow = '';
2303
+ (window as any).ResizeObserver = originalResizeObserver;
2304
+ });
2305
+
2306
+ test('should skip ancestor tracking when enableScrollableContainerLazyLoading is false', async () => {
2307
+ const scrollContainer = getRootEl();
2308
+ scrollContainer.style.overflow = 'auto';
2309
+
2310
+ const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
2311
+ const windowSpy = jest.spyOn(window, 'addEventListener');
2312
+
2313
+ const appEmbed = new AppEmbed(getRootEl(), {
2314
+ ...defaultViewConfig,
2315
+ fullHeight: true,
2316
+ enableScrollableContainerLazyLoading: false,
2317
+ } as AppViewConfig);
2318
+
2319
+ await appEmbed.render();
2320
+
2321
+ await executeAfterWait(() => {
2322
+ expect(windowSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
2323
+ expect(scrollContainerSpy).not.toHaveBeenCalledWith('scroll', expect.any(Function));
2324
+ }, 100);
2325
+
2326
+ appEmbed.destroy();
2327
+ scrollContainer.style.overflow = '';
2328
+ });
2329
+
2330
+ test('should wire the window scroll listener to the coordinates sender by default', async () => {
2331
+ const addEventListenerSpy = jest.spyOn(window, 'addEventListener');
2332
+
2333
+ const appEmbed = new AppEmbed(getRootEl(), {
2334
+ ...defaultViewConfig,
2335
+ fullHeight: true,
2336
+ } as AppViewConfig);
2337
+
2338
+ const mockTrigger = jest
2339
+ .spyOn(appEmbed, 'trigger')
2340
+ .mockImplementation(() => Promise.resolve(undefined as any));
2341
+
2342
+ await appEmbed.render();
2343
+
2344
+ await executeAfterWait(() => {
2345
+ const scrollCall = addEventListenerSpy.mock.calls.find(
2346
+ ([eventName, , capture]) => eventName === 'scroll' && capture === true,
2347
+ );
2348
+ expect(scrollCall).toBeDefined();
2349
+
2350
+ // Call the handler the way a real scroll event would.
2351
+ (scrollCall as any)[1]();
2352
+
2353
+ expect(mockTrigger).toHaveBeenCalledWith(
2354
+ HostEvent.VisibleEmbedCoordinates,
2355
+ expect.objectContaining({ top: expect.any(Number) }),
2356
+ );
2357
+ }, 100);
2358
+
2359
+ appEmbed.destroy();
2360
+ addEventListenerSpy.mockRestore();
2361
+ });
2362
+
2363
+ test('should remove listeners on destroy when the flags come from defaults', async () => {
2364
+ const removeEventListenerSpy = jest.spyOn(window, 'removeEventListener');
2365
+
2366
+ const appEmbed = new AppEmbed(getRootEl(), {
2367
+ ...defaultViewConfig,
2368
+ fullHeight: true,
2369
+ } as AppViewConfig);
2370
+
2371
+ await appEmbed.render();
2372
+ appEmbed.destroy();
2373
+
2374
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('resize', expect.anything());
2375
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
2376
+
2377
+ removeEventListenerSpy.mockRestore();
2378
+ });
2379
+
2380
+ test('should keep an explicit false for the lazy loading flags', async () => {
2381
+ const appEmbed = new AppEmbed(getRootEl(), {
2382
+ ...defaultViewConfig,
2383
+ fullHeight: true,
2384
+ lazyLoadingForFullHeight: false,
2385
+ enableScrollableContainerLazyLoading: false,
2386
+ lazyLoadingMargin: '0px',
2387
+ } as AppViewConfig);
2388
+
2389
+ expect((appEmbed as any).viewConfig.lazyLoadingForFullHeight).toBe(false);
2390
+ expect((appEmbed as any).viewConfig.enableScrollableContainerLazyLoading).toBe(false);
2391
+ expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBe('0px');
2392
+ });
2393
+
1956
2394
  test('should not set lazyLoadingForEmbed when lazyLoadingForFullHeight is enabled but fullHeight is false', async () => {
1957
2395
  const appEmbed = new AppEmbed(getRootEl(), {
1958
2396
  ...defaultViewConfig,
@@ -2473,3 +2911,106 @@ describe('AppEmbed visualOverrides tests', () => {
2473
2911
  await testVisualOverridesInEmbed(appEmbed, visualOverrides);
2474
2912
  });
2475
2913
  });
2914
+
2915
+ describe('AppEmbed getEmbedParamsObject', () => {
2916
+ beforeEach(() => {
2917
+ cleanUp();
2918
+ jest.spyOn(TsEmbed.prototype as any, 'getAppInitData').mockResolvedValue({});
2919
+ });
2920
+
2921
+ afterEach(() => {
2922
+ jest.restoreAllMocks();
2923
+ });
2924
+
2925
+ test('getEmbedParams should use getEmbedParamsObject internally', async () => {
2926
+ const appEmbed = new AppEmbed(getRootEl(), {
2927
+ ...defaultViewConfig,
2928
+ fullHeight: true,
2929
+ } as AppViewConfig);
2930
+
2931
+ const getEmbedParamsObjectSpy = jest.spyOn(appEmbed as any, 'getEmbedParamsObject');
2932
+
2933
+ await appEmbed.render();
2934
+
2935
+ expect(getEmbedParamsObjectSpy).toHaveBeenCalled();
2936
+ });
2937
+
2938
+ test('getEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', () => {
2939
+ const appEmbed = new AppEmbed(getRootEl(), {
2940
+ ...defaultViewConfig,
2941
+ fullHeight: true,
2942
+ } as AppViewConfig);
2943
+
2944
+ const params = (appEmbed as any).getEmbedParamsObject();
2945
+
2946
+ expect(params.isFullHeightPinboard).toBe(true);
2947
+ expect(params.fullHeight).toBeUndefined();
2948
+ });
2949
+
2950
+ test('getEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', () => {
2951
+ const appEmbed = new AppEmbed(getRootEl(), {
2952
+ ...defaultViewConfig,
2953
+ fullHeight: false,
2954
+ } as AppViewConfig);
2955
+
2956
+ const params = (appEmbed as any).getEmbedParamsObject();
2957
+
2958
+ expect(params.isFullHeightPinboard).toBeUndefined();
2959
+ });
2960
+
2961
+ test('getUpdateEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', async () => {
2962
+ const appEmbed = new AppEmbed(getRootEl(), {
2963
+ ...defaultViewConfig,
2964
+ fullHeight: true,
2965
+ } as AppViewConfig);
2966
+
2967
+ const params = await (appEmbed as any).getUpdateEmbedParamsObject();
2968
+
2969
+ expect(params.isFullHeightPinboard).toBe(true);
2970
+ });
2971
+
2972
+ test('getUpdateEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', async () => {
2973
+ const appEmbed = new AppEmbed(getRootEl(), {
2974
+ ...defaultViewConfig,
2975
+ fullHeight: false,
2976
+ } as AppViewConfig);
2977
+
2978
+ const params = await (appEmbed as any).getUpdateEmbedParamsObject();
2979
+
2980
+ expect(params.isFullHeightPinboard).toBeUndefined();
2981
+ });
2982
+ });
2983
+
2984
+ describe('AppEmbed updatedSpotterExperience tests', () => {
2985
+ beforeEach(() => {
2986
+ cleanUp();
2987
+ });
2988
+
2989
+ test('should set updatedSpotterExperience to true in url', async () => {
2990
+ const appEmbed = new AppEmbed(getRootEl(), {
2991
+ ...defaultViewConfig,
2992
+ updatedSpotterExperience: true,
2993
+ } as AppViewConfig);
2994
+ appEmbed.render();
2995
+ await executeAfterWait(() => {
2996
+ expectUrlMatchesWithParams(
2997
+ getIFrameSrc(),
2998
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
2999
+ );
3000
+ });
3001
+ });
3002
+
3003
+ test('should set updatedSpotterExperience to false in url', async () => {
3004
+ const appEmbed = new AppEmbed(getRootEl(), {
3005
+ ...defaultViewConfig,
3006
+ updatedSpotterExperience: false,
3007
+ } as AppViewConfig);
3008
+ appEmbed.render();
3009
+ await executeAfterWait(() => {
3010
+ expectUrlMatchesWithParams(
3011
+ getIFrameSrc(),
3012
+ `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
3013
+ );
3014
+ });
3015
+ });
3016
+ });