@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
@@ -101,7 +101,7 @@ describe('App embed tests', () => {
101
101
  const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), defaultViewConfig);
102
102
  appEmbed.render();
103
103
  await (0, test_utils_1.executeAfterWait)(() => {
104
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
104
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
105
105
  });
106
106
  });
107
107
  test('should hide the primary nav bar', async () => {
@@ -111,7 +111,7 @@ describe('App embed tests', () => {
111
111
  });
112
112
  appEmbed.render();
113
113
  await (0, test_utils_1.executeAfterWait)(() => {
114
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
114
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
115
115
  });
116
116
  });
117
117
  test('should hide the help and profile buttons from nav bar', async () => {
@@ -121,7 +121,7 @@ describe('App embed tests', () => {
121
121
  });
122
122
  appEmbed.render();
123
123
  await (0, test_utils_1.executeAfterWait)(() => {
124
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
124
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
125
125
  });
126
126
  });
127
127
  test('should hide the application switcher button from nav bar', async () => {
@@ -131,7 +131,7 @@ describe('App embed tests', () => {
131
131
  });
132
132
  appEmbed.render();
133
133
  await (0, test_utils_1.executeAfterWait)(() => {
134
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
134
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
135
135
  });
136
136
  });
137
137
  test('should hide the org switcher button from nav bar', async () => {
@@ -141,7 +141,7 @@ describe('App embed tests', () => {
141
141
  });
142
142
  appEmbed.render();
143
143
  await (0, test_utils_1.executeAfterWait)(() => {
144
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
144
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
145
145
  });
146
146
  });
147
147
  describe('should render the correct routes for pages', () => {
@@ -155,6 +155,7 @@ describe('App embed tests', () => {
155
155
  [app_1.Page.SpotIQ]: 'insights/results',
156
156
  [app_1.Page.Monitor]: 'insights/monitor-alerts',
157
157
  [app_1.Page.Collections]: 'collections',
158
+ [app_1.Page.LiveboardSchedules]: 'home/liveboard-schedules',
158
159
  };
159
160
  const pageIds = Object.keys(pageRouteMap);
160
161
  for (let i = 0; i < pageIds.length; i++) {
@@ -167,7 +168,7 @@ describe('App embed tests', () => {
167
168
  });
168
169
  appEmbed.render();
169
170
  await (0, test_utils_1.executeAfterWait)(() => {
170
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
171
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
171
172
  cleanUp();
172
173
  });
173
174
  });
@@ -182,6 +183,7 @@ describe('App embed tests', () => {
182
183
  [app_1.Page.SpotIQ]: 'home/spotiq-analysis',
183
184
  [app_1.Page.Monitor]: 'home/monitor-alerts',
184
185
  [app_1.Page.Collections]: 'collections',
186
+ [app_1.Page.LiveboardSchedules]: 'home/liveboard-schedules',
185
187
  };
186
188
  const pageIdsForModularHomes = Object.keys(pageRouteMapForModularHome);
187
189
  for (let i = 0; i < pageIdsForModularHomes.length; i++) {
@@ -195,7 +197,7 @@ describe('App embed tests', () => {
195
197
  });
196
198
  appEmbed.render();
197
199
  await (0, test_utils_1.executeAfterWait)(() => {
198
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
200
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
199
201
  cleanUp();
200
202
  });
201
203
  });
@@ -208,7 +210,7 @@ describe('App embed tests', () => {
208
210
  });
209
211
  appEmbed.render();
210
212
  await (0, test_utils_1.executeAfterWait)(() => {
211
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/foo/bar`);
213
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/foo/bar`);
212
214
  });
213
215
  });
214
216
  test('should apply runtime filters', async () => {
@@ -226,7 +228,7 @@ describe('App embed tests', () => {
226
228
  });
227
229
  appEmbed.render();
228
230
  await (0, test_utils_1.executeAfterWait)(() => {
229
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
231
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
230
232
  });
231
233
  });
232
234
  test('should not append runtime filters in URL if excludeRuntimeFiltersfromURL is true', async () => {
@@ -244,7 +246,7 @@ describe('App embed tests', () => {
244
246
  });
245
247
  appEmbed.render();
246
248
  await (0, test_utils_1.executeAfterWait)(() => {
247
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
249
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
248
250
  });
249
251
  });
250
252
  test('should append runtime filters in URL if excludeRuntimeFiltersfromURL is undefined', async () => {
@@ -263,7 +265,7 @@ describe('App embed tests', () => {
263
265
  appEmbed.render();
264
266
  const runtimeFilter = 'col1=sales&op1=EQ&val1=1000';
265
267
  await (0, test_utils_1.executeAfterWait)(() => {
266
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`);
268
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`);
267
269
  });
268
270
  });
269
271
  test('should disable and hide actions', async () => {
@@ -276,7 +278,7 @@ describe('App embed tests', () => {
276
278
  });
277
279
  appEmbed.render();
278
280
  await (0, test_utils_1.executeAfterWait)(() => {
279
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&${test_utils_1.defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${types_1.Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`);
281
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${test_utils_1.defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${types_1.Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`);
280
282
  });
281
283
  });
282
284
  test('should set enable2ColumnLayout to true in url', async () => {
@@ -286,7 +288,17 @@ describe('App embed tests', () => {
286
288
  });
287
289
  appEmbed.render();
288
290
  await (0, test_utils_1.executeAfterWait)(() => {
289
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`);
291
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
292
+ });
293
+ });
294
+ test('should set isLiveboardAlwaysOn12ColLayout to true in url', async () => {
295
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
296
+ ...defaultViewConfig,
297
+ isLiveboardAlwaysOn12ColLayout: true,
298
+ });
299
+ appEmbed.render();
300
+ await (0, test_utils_1.executeAfterWait)(() => {
301
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardAlwaysOn12ColLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
290
302
  });
291
303
  });
292
304
  test('should set coverAndFilterOptionInPDF to false in url', async () => {
@@ -296,7 +308,7 @@ describe('App embed tests', () => {
296
308
  });
297
309
  appEmbed.render();
298
310
  await (0, test_utils_1.executeAfterWait)(() => {
299
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false${defaultParamsPost}#/home`);
311
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
300
312
  });
301
313
  });
302
314
  test('should set isLiveboardStylingAndGroupingEnabled to true in url (deprecated, use isLiveboardMasterpiecesEnabled)', async () => {
@@ -306,7 +318,17 @@ describe('App embed tests', () => {
306
318
  });
307
319
  appEmbed.render();
308
320
  await (0, test_utils_1.executeAfterWait)(() => {
309
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true${defaultParamsPost}#/home`);
321
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
322
+ });
323
+ });
324
+ test('should set liveboardGutter in url', async () => {
325
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
326
+ ...defaultViewConfig,
327
+ liveboardGutter: 8,
328
+ });
329
+ appEmbed.render();
330
+ await (0, test_utils_1.executeAfterWait)(() => {
331
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&liveboardGutter=8&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
310
332
  });
311
333
  });
312
334
  test('should set isThisPeriodInDateFiltersEnabled to true in url', async () => {
@@ -316,7 +338,7 @@ describe('App embed tests', () => {
316
338
  });
317
339
  appEmbed.render();
318
340
  await (0, test_utils_1.executeAfterWait)(() => {
319
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true${defaultParamsPost}#/home`);
341
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
320
342
  });
321
343
  });
322
344
  test('should set enableHomepageAnnouncement to true in url', async () => {
@@ -326,14 +348,14 @@ describe('App embed tests', () => {
326
348
  });
327
349
  appEmbed.render();
328
350
  await (0, test_utils_1.executeAfterWait)(() => {
329
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true${defaultParamsPost}#/home`);
351
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
330
352
  });
331
353
  });
332
354
  test('should set enableHomepageAnnouncement to false in url when not provided in AppViewConfig', async () => {
333
355
  const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), defaultViewConfig);
334
356
  appEmbed.render();
335
357
  await (0, test_utils_1.executeAfterWait)(() => {
336
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false${defaultParamsPost}#/home`);
358
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
337
359
  });
338
360
  });
339
361
  test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
@@ -343,7 +365,7 @@ describe('App embed tests', () => {
343
365
  });
344
366
  appEmbed.render();
345
367
  await (0, test_utils_1.executeAfterWait)(() => {
346
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`);
368
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
347
369
  });
348
370
  });
349
371
  test('should set isWYSIWYGLiveboardPDFEnabled to true in url', async () => {
@@ -353,16 +375,16 @@ describe('App embed tests', () => {
353
375
  });
354
376
  appEmbed.render();
355
377
  await (0, test_utils_1.executeAfterWait)(() => {
356
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true${defaultParamsPost}#/home`);
378
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
357
379
  });
358
380
  });
359
- test('should disable isWYSIWYGLiveboardPDFEnabled by default in url', async () => {
381
+ test('should not set isWYSIWYGLiveboardPDFEnabled in url by default', async () => {
360
382
  const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
361
383
  ...defaultViewConfig,
362
384
  });
363
385
  appEmbed.render();
364
386
  await (0, test_utils_1.executeAfterWait)(() => {
365
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=false${defaultParamsPost}#/home`);
387
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
366
388
  });
367
389
  });
368
390
  test('should set isLinkParametersEnabled to true in url', async () => {
@@ -372,7 +394,7 @@ describe('App embed tests', () => {
372
394
  });
373
395
  appEmbed.render();
374
396
  await (0, test_utils_1.executeAfterWait)(() => {
375
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true${defaultParamsPost}#/home`);
397
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
376
398
  });
377
399
  });
378
400
  test('should set isLinkParametersEnabled to false in url', async () => {
@@ -382,7 +404,7 @@ describe('App embed tests', () => {
382
404
  });
383
405
  appEmbed.render();
384
406
  await (0, test_utils_1.executeAfterWait)(() => {
385
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false${defaultParamsPost}#/home`);
407
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
386
408
  });
387
409
  });
388
410
  test('Should add homepageVersion=v4 and updatedSpotterChatPrompt=true when homePage is Focused to the iframe src', async () => {
@@ -391,7 +413,7 @@ describe('App embed tests', () => {
391
413
  discoveryExperience: {
392
414
  homePage: app_1.HomePage.Focused,
393
415
  },
394
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
416
+ }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
395
417
  });
396
418
  test('Should respect explicit updatedSpotterChatPrompt=false even when homePage is Focused', async () => {
397
419
  await testUrlParams({
@@ -400,7 +422,7 @@ describe('App embed tests', () => {
400
422
  homePage: app_1.HomePage.Focused,
401
423
  },
402
424
  updatedSpotterChatPrompt: false,
403
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
425
+ }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
404
426
  });
405
427
  test('should set isLiveboardXLSXCSVDownloadEnabled to true in url', async () => {
406
428
  const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
@@ -409,7 +431,7 @@ describe('App embed tests', () => {
409
431
  });
410
432
  appEmbed.render();
411
433
  await (0, test_utils_1.executeAfterWait)(() => {
412
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`);
434
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
413
435
  });
414
436
  });
415
437
  test('should set updatedSpotterChatPrompt to true in url', async () => {
@@ -419,7 +441,7 @@ describe('App embed tests', () => {
419
441
  });
420
442
  appEmbed.render();
421
443
  await (0, test_utils_1.executeAfterWait)(() => {
422
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true${defaultParamsPost}#/home`);
444
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
423
445
  });
424
446
  });
425
447
  test('should set updatedSpotterChatPrompt to false in url', async () => {
@@ -429,7 +451,27 @@ describe('App embed tests', () => {
429
451
  });
430
452
  appEmbed.render();
431
453
  await (0, test_utils_1.executeAfterWait)(() => {
432
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false${defaultParamsPost}#/home`);
454
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
455
+ });
456
+ });
457
+ test('should set showSpotterRadiance to true in url', async () => {
458
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
459
+ ...defaultViewConfig,
460
+ showSpotterRadiance: true,
461
+ });
462
+ appEmbed.render();
463
+ await (0, test_utils_1.executeAfterWait)(() => {
464
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=true${defaultParamsPost}#/home`);
465
+ });
466
+ });
467
+ test('should set showSpotterRadiance to false in url', async () => {
468
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
469
+ ...defaultViewConfig,
470
+ showSpotterRadiance: false,
471
+ });
472
+ appEmbed.render();
473
+ await (0, test_utils_1.executeAfterWait)(() => {
474
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=false${defaultParamsPost}#/home`);
433
475
  });
434
476
  });
435
477
  test('should set defaultQueryMode to research in url', async () => {
@@ -460,7 +502,36 @@ describe('App embed tests', () => {
460
502
  });
461
503
  appEmbed.render();
462
504
  await (0, test_utils_1.executeAfterWait)(() => {
463
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true${defaultParamsPost}#/home`);
505
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
506
+ });
507
+ });
508
+ test('should set spotterDataSources to a list of Model GUIDs in url', async () => {
509
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
510
+ ...defaultViewConfig,
511
+ spotterDataSources: ['model-guid-123', 'model-guid-456'],
512
+ });
513
+ appEmbed.render();
514
+ await (0, test_utils_1.executeAfterWait)(() => {
515
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterDataSources=${encodeURIComponent(JSON.stringify(['model-guid-123', 'model-guid-456']))}${defaultParamsPost}#/home`);
516
+ });
517
+ });
518
+ test('should not add spotterDataSources to url when not provided', async () => {
519
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
520
+ ...defaultViewConfig,
521
+ });
522
+ appEmbed.render();
523
+ await (0, test_utils_1.executeAfterWait)(() => {
524
+ expect((0, test_utils_1.getIFrameSrc)()).not.toContain('spotterDataSources');
525
+ });
526
+ });
527
+ test('should not add spotterDataSources to url when empty array', async () => {
528
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
529
+ ...defaultViewConfig,
530
+ spotterDataSources: [],
531
+ });
532
+ appEmbed.render();
533
+ await (0, test_utils_1.executeAfterWait)(() => {
534
+ expect((0, test_utils_1.getIFrameSrc)()).not.toContain('spotterDataSources');
464
535
  });
465
536
  });
466
537
  test('should include spotterVizConfig in APP_INIT embedParams when spotterViz is provided', async () => {
@@ -500,6 +571,33 @@ describe('App embed tests', () => {
500
571
  });
501
572
  });
502
573
  });
574
+ test('should include starterPrompts in APP_INIT embedParams', async () => {
575
+ const starterPrompts = {
576
+ enable: true,
577
+ quick: {
578
+ label: 'Quick',
579
+ questions: [
580
+ { label: 'Q1', prompt: 'P1' },
581
+ { label: 'Q2', prompt: 'P2' },
582
+ ],
583
+ },
584
+ research: { label: 'Research' },
585
+ };
586
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
587
+ ...defaultViewConfig,
588
+ spotterChatConfig: { starterPrompts },
589
+ });
590
+ (0, test_utils_1.mockMessageChannel)();
591
+ appEmbed.render();
592
+ const mockPort = { postMessage: jest.fn() };
593
+ await (0, test_utils_1.executeAfterWait)(() => {
594
+ (0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
595
+ });
596
+ await (0, test_utils_1.executeAfterWait)(() => {
597
+ expect(mockPort.postMessage.mock.calls[0][0].data.embedParams.starterPrompts)
598
+ .toEqual(starterPrompts);
599
+ });
600
+ });
503
601
  test('should pass brandHeadline through spotterVizConfig in APP_INIT', async () => {
504
602
  const spotterViz = { brandName: 'MyBrand', brandHeadline: "Hi, there! I'm" };
505
603
  const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
@@ -570,6 +668,83 @@ describe('App embed tests', () => {
570
668
  });
571
669
  });
572
670
  });
671
+ test('should forward spotterChatPinConfig nested in spotterSidebarConfig in APP_INIT', async () => {
672
+ const spotterChatPinConfig = {
673
+ enabled: true,
674
+ pinLabel: 'Pin to top',
675
+ unpinLabel: 'Unpin',
676
+ };
677
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
678
+ ...defaultViewConfig,
679
+ spotterSidebarConfig: {
680
+ enablePastConversationsSidebar: true,
681
+ spotterChatPinConfig,
682
+ },
683
+ });
684
+ (0, test_utils_1.mockMessageChannel)();
685
+ appEmbed.render();
686
+ const mockPort = { postMessage: jest.fn() };
687
+ await (0, test_utils_1.executeAfterWait)(() => {
688
+ (0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
689
+ });
690
+ await (0, test_utils_1.executeAfterWait)(() => {
691
+ expect(mockPort.postMessage).toHaveBeenCalledWith({
692
+ type: types_1.EmbedEvent.APP_INIT,
693
+ data: expect.objectContaining({
694
+ embedParams: expect.objectContaining({
695
+ spotterSidebarConfig: expect.objectContaining({
696
+ spotterChatPinConfig,
697
+ }),
698
+ }),
699
+ }),
700
+ });
701
+ });
702
+ });
703
+ test('should include spotterShareConversationConfig in APP_INIT embedParams when provided', async () => {
704
+ const spotterShareConversationConfig = {
705
+ enableShareConversation: true,
706
+ spotterShareLabel: 'Share',
707
+ spotterShareModalTitle: 'Share conversation',
708
+ };
709
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
710
+ ...defaultViewConfig,
711
+ spotterShareConversationConfig,
712
+ });
713
+ (0, test_utils_1.mockMessageChannel)();
714
+ appEmbed.render();
715
+ const mockPort = { postMessage: jest.fn() };
716
+ await (0, test_utils_1.executeAfterWait)(() => {
717
+ (0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
718
+ });
719
+ await (0, test_utils_1.executeAfterWait)(() => {
720
+ expect(mockPort.postMessage).toHaveBeenCalledWith({
721
+ type: types_1.EmbedEvent.APP_INIT,
722
+ data: expect.objectContaining({
723
+ embedParams: expect.objectContaining({
724
+ spotterShareConversationConfig,
725
+ }),
726
+ }),
727
+ });
728
+ });
729
+ });
730
+ test('should not include spotterShareConversationConfig in APP_INIT when not provided', async () => {
731
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
732
+ ...defaultViewConfig,
733
+ });
734
+ (0, test_utils_1.mockMessageChannel)();
735
+ appEmbed.render();
736
+ const mockPort = { postMessage: jest.fn() };
737
+ await (0, test_utils_1.executeAfterWait)(() => {
738
+ (0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
739
+ });
740
+ await (0, test_utils_1.executeAfterWait)(() => {
741
+ const callArgs = mockPort.postMessage.mock.calls[0][0];
742
+ expect(callArgs.type).toBe(types_1.EmbedEvent.APP_INIT);
743
+ if (callArgs.data.embedParams) {
744
+ expect(callArgs.data.embedParams.spotterShareConversationConfig).toBeUndefined();
745
+ }
746
+ });
747
+ });
573
748
  test('should set toolResponseCardBrandingLabel in url via spotterChatConfig', async () => {
574
749
  const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
575
750
  ...defaultViewConfig,
@@ -579,7 +754,7 @@ describe('App embed tests', () => {
579
754
  });
580
755
  appEmbed.render();
581
756
  await (0, test_utils_1.executeAfterWait)(() => {
582
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand${defaultParamsPost}#/home`);
757
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
583
758
  });
584
759
  });
585
760
  test('should set spotterFileUploadEnabled to true in url', async () => {
@@ -589,7 +764,7 @@ describe('App embed tests', () => {
589
764
  });
590
765
  appEmbed.render();
591
766
  await (0, test_utils_1.executeAfterWait)(() => {
592
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true${defaultParamsPost}#/home`);
767
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
593
768
  });
594
769
  });
595
770
  test('should set enableStarterPrompts to true in url', async () => {
@@ -599,7 +774,41 @@ describe('App embed tests', () => {
599
774
  });
600
775
  appEmbed.render();
601
776
  await (0, test_utils_1.executeAfterWait)(() => {
602
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true${defaultParamsPost}#/home`);
777
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
778
+ });
779
+ });
780
+ test('should set openSpotterOnLiveboardByDefault to true in url', async () => {
781
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
782
+ ...defaultViewConfig,
783
+ spotterChatConfig: { openSpotterOnLiveboardByDefault: true },
784
+ });
785
+ appEmbed.render();
786
+ await (0, test_utils_1.executeAfterWait)(() => {
787
+ (0, test_utils_1.expectUrlToHaveParamsWithValues)((0, test_utils_1.getIFrameSrc)(), {
788
+ openSpotterOnLiveboardByDefault: 'true',
789
+ });
790
+ });
791
+ });
792
+ test('should set openSpotterOnLiveboardByDefault to false when explicitly disabled', async () => {
793
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
794
+ ...defaultViewConfig,
795
+ spotterChatConfig: { openSpotterOnLiveboardByDefault: false },
796
+ });
797
+ appEmbed.render();
798
+ await (0, test_utils_1.executeAfterWait)(() => {
799
+ (0, test_utils_1.expectUrlToHaveParamsWithValues)((0, test_utils_1.getIFrameSrc)(), {
800
+ openSpotterOnLiveboardByDefault: 'false',
801
+ });
802
+ });
803
+ });
804
+ test('should not set openSpotterOnLiveboardByDefault when it is not configured', async () => {
805
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
806
+ ...defaultViewConfig,
807
+ spotterChatConfig: { enableStarterPrompts: true },
808
+ });
809
+ appEmbed.render();
810
+ await (0, test_utils_1.executeAfterWait)(() => {
811
+ expect((0, test_utils_1.getIFrameSrc)()).not.toContain('openSpotterOnLiveboardByDefault');
603
812
  });
604
813
  });
605
814
  test('should set spotterFileUploadFileTypes in url', async () => {
@@ -621,7 +830,7 @@ describe('App embed tests', () => {
621
830
  });
622
831
  appEmbed.render();
623
832
  await (0, test_utils_1.executeAfterWait)(() => {
624
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false${defaultParamsPost}#/home`);
833
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
625
834
  });
626
835
  });
627
836
  test('should set isGranularXLSXCSVSchedulesEnabled to true in url', async () => {
@@ -631,7 +840,7 @@ describe('App embed tests', () => {
631
840
  });
632
841
  appEmbed.render();
633
842
  await (0, test_utils_1.executeAfterWait)(() => {
634
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true${defaultParamsPost}#/home`);
843
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
635
844
  });
636
845
  });
637
846
  test('should set isGranularXLSXCSVSchedulesEnabled to false in url', async () => {
@@ -641,7 +850,7 @@ describe('App embed tests', () => {
641
850
  });
642
851
  appEmbed.render();
643
852
  await (0, test_utils_1.executeAfterWait)(() => {
644
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false${defaultParamsPost}#/home`);
853
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
645
854
  });
646
855
  });
647
856
  test('should set isCentralizedLiveboardFilterUXEnabled to true in url', async () => {
@@ -651,7 +860,7 @@ describe('App embed tests', () => {
651
860
  });
652
861
  appEmbed.render();
653
862
  await (0, test_utils_1.executeAfterWait)(() => {
654
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true${defaultParamsPost}#/home`);
863
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
655
864
  });
656
865
  });
657
866
  test('should set isCentralizedLiveboardFilterUXEnabled to false in url', async () => {
@@ -661,7 +870,36 @@ describe('App embed tests', () => {
661
870
  });
662
871
  appEmbed.render();
663
872
  await (0, test_utils_1.executeAfterWait)(() => {
664
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false${defaultParamsPost}#/home`);
873
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
874
+ });
875
+ });
876
+ test('should set isScopedLiveboardFilteringEnabled to true in url', async () => {
877
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
878
+ ...defaultViewConfig,
879
+ isScopedLiveboardFilteringEnabled: true,
880
+ });
881
+ appEmbed.render();
882
+ await (0, test_utils_1.executeAfterWait)(() => {
883
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=true${defaultParamsPost}#/home`);
884
+ });
885
+ });
886
+ test('should set isScopedLiveboardFilteringEnabled to false in url', async () => {
887
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
888
+ ...defaultViewConfig,
889
+ isScopedLiveboardFilteringEnabled: false,
890
+ });
891
+ appEmbed.render();
892
+ await (0, test_utils_1.executeAfterWait)(() => {
893
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=false${defaultParamsPost}#/home`);
894
+ });
895
+ });
896
+ test('should not set isScopedLiveboardFilteringEnabled in url when undefined', async () => {
897
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
898
+ ...defaultViewConfig,
899
+ });
900
+ appEmbed.render();
901
+ await (0, test_utils_1.executeAfterWait)(() => {
902
+ expect((0, test_utils_1.getIFrameSrc)()).not.toContain('isScopedLiveboardFilteringEnabled');
665
903
  });
666
904
  });
667
905
  test('Should add the tag to the iframe src', async () => {
@@ -672,7 +910,7 @@ describe('App embed tests', () => {
672
910
  });
673
911
  appEmbed.render();
674
912
  await (0, test_utils_1.executeAfterWait)(() => {
675
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}&tag=Finance${defaultParamsPost}#/home`);
913
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}&tag=Finance${defaultParamsPost}#/home`);
676
914
  });
677
915
  });
678
916
  test('Should add the hideTagFilterChips true to the iframe src', async () => {
@@ -683,7 +921,7 @@ describe('App embed tests', () => {
683
921
  });
684
922
  appEmbed.render();
685
923
  await (0, test_utils_1.executeAfterWait)(() => {
686
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`);
924
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`);
687
925
  });
688
926
  });
689
927
  test('Should add the hideTagFilterChips false to the iframe src', async () => {
@@ -694,7 +932,7 @@ describe('App embed tests', () => {
694
932
  });
695
933
  appEmbed.render();
696
934
  await (0, test_utils_1.executeAfterWait)(() => {
697
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`);
935
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`);
698
936
  });
699
937
  });
700
938
  test('Should not add hideTagFilterChips if it is undefined', async () => {
@@ -704,7 +942,7 @@ describe('App embed tests', () => {
704
942
  });
705
943
  appEmbed.render();
706
944
  await (0, test_utils_1.executeAfterWait)(() => {
707
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
945
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
708
946
  });
709
947
  });
710
948
  test('Should add showMaskedFilterChip true to the iframe src', async () => {
@@ -715,7 +953,7 @@ describe('App embed tests', () => {
715
953
  });
716
954
  appEmbed.render();
717
955
  await (0, test_utils_1.executeAfterWait)(() => {
718
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
956
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
719
957
  });
720
958
  });
721
959
  test('Should add showMaskedFilterChip false to the iframe src', async () => {
@@ -726,7 +964,7 @@ describe('App embed tests', () => {
726
964
  });
727
965
  appEmbed.render();
728
966
  await (0, test_utils_1.executeAfterWait)(() => {
729
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
967
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
730
968
  });
731
969
  });
732
970
  test('Should add default showMaskedFilterChip false when not specified', async () => {
@@ -736,7 +974,7 @@ describe('App embed tests', () => {
736
974
  });
737
975
  appEmbed.render();
738
976
  await (0, test_utils_1.executeAfterWait)(() => {
739
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
977
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
740
978
  });
741
979
  });
742
980
  test('Should add isLiveboardMasterpiecesEnabled true to the iframe src', async () => {
@@ -747,7 +985,7 @@ describe('App embed tests', () => {
747
985
  });
748
986
  appEmbed.render();
749
987
  await (0, test_utils_1.executeAfterWait)(() => {
750
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
988
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
751
989
  });
752
990
  });
753
991
  test('Should add isLiveboardMasterpiecesEnabled false to the iframe src', async () => {
@@ -758,17 +996,7 @@ describe('App embed tests', () => {
758
996
  });
759
997
  appEmbed.render();
760
998
  await (0, test_utils_1.executeAfterWait)(() => {
761
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
762
- });
763
- });
764
- test('Should add default isLiveboardMasterpiecesEnabled false when not specified', async () => {
765
- const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
766
- ...defaultViewConfig,
767
- showPrimaryNavbar: false,
768
- });
769
- appEmbed.render();
770
- await (0, test_utils_1.executeAfterWait)(() => {
771
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
999
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
772
1000
  });
773
1001
  });
774
1002
  test('Should add newChartsLibrary true to the iframe src', async () => {
@@ -779,7 +1007,7 @@ describe('App embed tests', () => {
779
1007
  });
780
1008
  appEmbed.render();
781
1009
  await (0, test_utils_1.executeAfterWait)(() => {
782
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1010
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
783
1011
  });
784
1012
  });
785
1013
  test('Should add newChartsLibrary false to the iframe src', async () => {
@@ -790,7 +1018,7 @@ describe('App embed tests', () => {
790
1018
  });
791
1019
  appEmbed.render();
792
1020
  await (0, test_utils_1.executeAfterWait)(() => {
793
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1021
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
794
1022
  });
795
1023
  });
796
1024
  test('Should not add newChartsLibrary to the iframe src when not specified', async () => {
@@ -800,7 +1028,7 @@ describe('App embed tests', () => {
800
1028
  });
801
1029
  appEmbed.render();
802
1030
  await (0, test_utils_1.executeAfterWait)(() => {
803
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1031
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
804
1032
  });
805
1033
  });
806
1034
  test('Should add enableSearchAssist flagto the iframe src', async () => {
@@ -810,7 +1038,7 @@ describe('App embed tests', () => {
810
1038
  });
811
1039
  appEmbed.render();
812
1040
  await (0, test_utils_1.executeAfterWait)(() => {
813
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1041
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
814
1042
  });
815
1043
  });
816
1044
  test('Should add enableDataPanelV2 flag to the iframe src', async () => {
@@ -820,7 +1048,7 @@ describe('App embed tests', () => {
820
1048
  });
821
1049
  appEmbed.render();
822
1050
  await (0, test_utils_1.executeAfterWait)(() => {
823
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1051
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
824
1052
  });
825
1053
  });
826
1054
  test('Should add isLiveboardHeaderSticky flag to the iframe src', async () => {
@@ -830,7 +1058,7 @@ describe('App embed tests', () => {
830
1058
  });
831
1059
  appEmbed.render();
832
1060
  await (0, test_utils_1.executeAfterWait)(() => {
833
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1061
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
834
1062
  });
835
1063
  });
836
1064
  test('Should add isLiveboardCompactHeaderEnabled flag to the iframe src', async () => {
@@ -840,7 +1068,7 @@ describe('App embed tests', () => {
840
1068
  });
841
1069
  appEmbed.render();
842
1070
  await (0, test_utils_1.executeAfterWait)(() => {
843
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1071
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
844
1072
  });
845
1073
  });
846
1074
  test('Should add showLiveboardReverifyBanner flag to the iframe src', async () => {
@@ -850,7 +1078,7 @@ describe('App embed tests', () => {
850
1078
  });
851
1079
  appEmbed.render();
852
1080
  await (0, test_utils_1.executeAfterWait)(() => {
853
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1081
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
854
1082
  });
855
1083
  });
856
1084
  test('Should add isUnifiedSearchExperienceEnabled flag to the iframe src', async () => {
@@ -861,7 +1089,7 @@ describe('App embed tests', () => {
861
1089
  });
862
1090
  appEmbedTrue.render();
863
1091
  await (0, test_utils_1.executeAfterWait)(() => {
864
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1092
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
865
1093
  });
866
1094
  appEmbedTrue.destroy();
867
1095
  // Case 2: explicitly false
@@ -871,7 +1099,7 @@ describe('App embed tests', () => {
871
1099
  });
872
1100
  appEmbedFalse.render();
873
1101
  await (0, test_utils_1.executeAfterWait)(() => {
874
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1102
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
875
1103
  });
876
1104
  appEmbedFalse.destroy();
877
1105
  // Case 3: not provided — defaults to false
@@ -880,7 +1108,7 @@ describe('App embed tests', () => {
880
1108
  });
881
1109
  appEmbedDefault.render();
882
1110
  await (0, test_utils_1.executeAfterWait)(() => {
883
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1111
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
884
1112
  });
885
1113
  });
886
1114
  test('should set newConnectionsExperience to true in url', async () => {
@@ -919,7 +1147,7 @@ describe('App embed tests', () => {
919
1147
  });
920
1148
  appEmbed.render();
921
1149
  await (0, test_utils_1.executeAfterWait)(() => {
922
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1150
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
923
1151
  });
924
1152
  });
925
1153
  test('Should add showLiveboardVerifiedBadge flag to the iframe src', async () => {
@@ -929,7 +1157,7 @@ describe('App embed tests', () => {
929
1157
  });
930
1158
  appEmbed.render();
931
1159
  await (0, test_utils_1.executeAfterWait)(() => {
932
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1160
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
933
1161
  });
934
1162
  });
935
1163
  test('Should add isLiveboardPermissionV2Enabled flag to the iframe src', async () => {
@@ -939,7 +1167,7 @@ describe('App embed tests', () => {
939
1167
  });
940
1168
  appEmbed.render();
941
1169
  await (0, test_utils_1.executeAfterWait)(() => {
942
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1170
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
943
1171
  });
944
1172
  });
945
1173
  test('Should add default values of flags to the iframe src', async () => {
@@ -948,7 +1176,7 @@ describe('App embed tests', () => {
948
1176
  });
949
1177
  appEmbed.render();
950
1178
  await (0, test_utils_1.executeAfterWait)(() => {
951
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1179
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
952
1180
  });
953
1181
  });
954
1182
  test('Should add modularHomeExperience flag to the iframe src', async () => {
@@ -958,7 +1186,7 @@ describe('App embed tests', () => {
958
1186
  });
959
1187
  appEmbed.render();
960
1188
  await (0, test_utils_1.executeAfterWait)(() => {
961
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1189
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
962
1190
  });
963
1191
  });
964
1192
  test('Should add hideHomepageLeftNav flag to the iframe src', async () => {
@@ -968,7 +1196,7 @@ describe('App embed tests', () => {
968
1196
  });
969
1197
  appEmbed.render();
970
1198
  await (0, test_utils_1.executeAfterWait)(() => {
971
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&hideHomepageLeftNav=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1199
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHomepageLeftNav=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
972
1200
  });
973
1201
  });
974
1202
  test('Should add hideHamburger, hideObjectSearch, hideNotification flags to the iframe src', async () => {
@@ -980,7 +1208,7 @@ describe('App embed tests', () => {
980
1208
  });
981
1209
  appEmbed.render();
982
1210
  await (0, test_utils_1.executeAfterWait)(() => {
983
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1211
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
984
1212
  });
985
1213
  });
986
1214
  test('Should not add when hideHamburger, hideObjectSearch, hideNotification values are not true to the iframe src', async () => {
@@ -992,65 +1220,14 @@ describe('App embed tests', () => {
992
1220
  });
993
1221
  appEmbed.render();
994
1222
  await (0, test_utils_1.executeAfterWait)(() => {
995
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1223
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
996
1224
  });
997
1225
  });
998
- test('Should add navigationVersion=v3 when primaryNavbarVersion is Sliding to the iframe src', async () => {
999
- await testUrlParams({
1000
- ...defaultViewConfig,
1001
- discoveryExperience: {
1002
- primaryNavbarVersion: app_1.PrimaryNavbarVersion.Sliding,
1003
- homePage: app_1.HomePage.Modular,
1004
- },
1005
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1006
- });
1007
- test('Should not add navigationVersion=v3 when primaryNavbarVersion is not added to the iframe src', async () => {
1008
- await testUrlParams({
1009
- ...defaultViewConfig,
1010
- discoveryExperience: {
1011
- homePage: app_1.HomePage.Modular,
1012
- },
1013
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1014
- });
1015
- test('Should add navigationVersion=v3 & modularHomeExperience=true when primaryNavbarVersion is Sliding to the iframe src', async () => {
1016
- await testUrlParams({
1017
- ...defaultViewConfig,
1018
- // homePage v2 config not included under discoveryExperience
1019
- discoveryExperience: {
1020
- primaryNavbarVersion: app_1.PrimaryNavbarVersion.Sliding,
1021
- },
1022
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1023
- });
1024
- test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when Sliding and ModularWithStylingChanges configured in the iframe src', async () => {
1025
- await testUrlParams({
1026
- ...defaultViewConfig,
1027
- discoveryExperience: {
1028
- primaryNavbarVersion: app_1.PrimaryNavbarVersion.Sliding,
1029
- homePage: app_1.HomePage.ModularWithStylingChanges,
1030
- },
1031
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1032
- });
1033
- test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when homePage is ModularWithStylingChanges to the iframe src', async () => {
1034
- await testUrlParams({
1035
- ...defaultViewConfig,
1036
- // primaryNavbarVersion is not included under
1037
- // discoveryExperience, then it set navigationVersion=v2 and
1038
- // modularHomeExperience=false.
1039
- discoveryExperience: {
1040
- homePage: app_1.HomePage.ModularWithStylingChanges,
1041
- },
1042
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1043
- });
1044
- test('Should add navigationVersion=v2 when primaryNavbarVersion is not added to the iframe src', async () => {
1045
- await testUrlParams({
1046
- ...defaultViewConfig,
1047
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1048
- });
1049
1226
  test('Should add enableAskSage flag to the iframe src', async () => {
1050
1227
  await testUrlParams({
1051
1228
  ...defaultViewConfig,
1052
1229
  enableAskSage: true,
1053
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&enableAskSage=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1230
+ }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableAskSage=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1054
1231
  });
1055
1232
  test('Should add listpageVersion=v3 when listPageVersion is ListWithUXChanges to the iframe src', async () => {
1056
1233
  await testUrlParams({
@@ -1058,31 +1235,30 @@ describe('App embed tests', () => {
1058
1235
  discoveryExperience: {
1059
1236
  listPageVersion: app_1.ListPage.ListWithUXChanges,
1060
1237
  },
1061
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&listpageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1238
+ }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&listpageVersion=v3&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1062
1239
  });
1063
- test('Should add listpageVersion=v2 by default when no discoveryExperience is provided', async () => {
1240
+ test('Should send navigationVersion=v3 & homepageVersion=v3 by default when no discoveryExperience is provided', async () => {
1064
1241
  await testUrlParams({
1065
1242
  ...defaultViewConfig,
1066
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1243
+ }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1067
1244
  });
1068
- test('Should add listpageVersion=v2 by default when discoveryExperience is provided but listPageVersion is not specified', async () => {
1069
- await testUrlParams({
1245
+ test('Should not send modularHomeExperience param by default when not specified', async () => {
1246
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1070
1247
  ...defaultViewConfig,
1071
- discoveryExperience: {
1072
- primaryNavbarVersion: app_1.PrimaryNavbarVersion.Sliding,
1073
- homePage: app_1.HomePage.Modular,
1074
- },
1075
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1248
+ });
1249
+ appEmbed.render();
1250
+ await (0, test_utils_1.executeAfterWait)(() => {
1251
+ const url = new URL((0, test_utils_1.getIFrameSrc)());
1252
+ expect(url.searchParams.has('modularHomeExperience')).toBe(false);
1253
+ });
1076
1254
  });
1077
1255
  test('Should add listpageVersion=v3 combined with other discoveryExperience options to the iframe src', async () => {
1078
1256
  await testUrlParams({
1079
1257
  ...defaultViewConfig,
1080
1258
  discoveryExperience: {
1081
- primaryNavbarVersion: app_1.PrimaryNavbarVersion.Sliding,
1082
- homePage: app_1.HomePage.Modular,
1083
1259
  listPageVersion: app_1.ListPage.ListWithUXChanges,
1084
1260
  },
1085
- }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&listpageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1261
+ }, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&listpageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1086
1262
  });
1087
1263
  test('Should add enablePendoHelp flag to the iframe src conditional on navbar', async () => {
1088
1264
  const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
@@ -1090,7 +1266,7 @@ describe('App embed tests', () => {
1090
1266
  });
1091
1267
  appEmbed.render();
1092
1268
  await (0, test_utils_1.executeAfterWait)(() => {
1093
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1269
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1094
1270
  });
1095
1271
  const noNavEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1096
1272
  ...defaultViewConfig,
@@ -1098,7 +1274,7 @@ describe('App embed tests', () => {
1098
1274
  });
1099
1275
  noNavEmbed.render();
1100
1276
  await (0, test_utils_1.executeAfterWait)(() => {
1101
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1277
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1102
1278
  });
1103
1279
  });
1104
1280
  test('should set enableLiveboardDataCache to true in url', async () => {
@@ -1108,7 +1284,7 @@ describe('App embed tests', () => {
1108
1284
  });
1109
1285
  appEmbed.render();
1110
1286
  await (0, test_utils_1.executeAfterWait)(() => {
1111
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true${defaultParamsPost}#/home`);
1287
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
1112
1288
  });
1113
1289
  });
1114
1290
  test('should set enableLiveboardDataCache to false in url', async () => {
@@ -1118,7 +1294,7 @@ describe('App embed tests', () => {
1118
1294
  });
1119
1295
  appEmbed.render();
1120
1296
  await (0, test_utils_1.executeAfterWait)(() => {
1121
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false${defaultParamsPost}#/home`);
1297
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
1122
1298
  });
1123
1299
  });
1124
1300
  test('should not set enableLiveboardDataCache in url when not provided', async () => {
@@ -1137,7 +1313,7 @@ describe('App embed tests', () => {
1137
1313
  });
1138
1314
  await appEmbed.render();
1139
1315
  await (0, test_utils_1.executeAfterWait)(() => {
1140
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=objectSearch${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1316
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=objectSearch&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1141
1317
  });
1142
1318
  });
1143
1319
  test('Should add HomePageSearchBarMode flag with ai answer to the iframe src', async () => {
@@ -1147,7 +1323,7 @@ describe('App embed tests', () => {
1147
1323
  });
1148
1324
  await appEmbed.render();
1149
1325
  await (0, test_utils_1.executeAfterWait)(() => {
1150
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=aiAnswer${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1326
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=aiAnswer&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1151
1327
  });
1152
1328
  });
1153
1329
  test('Should add HomePageSearchBarMode flag with none to the iframe src', async () => {
@@ -1157,7 +1333,7 @@ describe('App embed tests', () => {
1157
1333
  });
1158
1334
  await appEmbed.render();
1159
1335
  await (0, test_utils_1.executeAfterWait)(() => {
1160
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=none${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1336
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=none&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1161
1337
  });
1162
1338
  });
1163
1339
  test('Should add dataPanelCustomGroupsAccordionInitialState flag to the iframe src', async () => {
@@ -1167,7 +1343,7 @@ describe('App embed tests', () => {
1167
1343
  });
1168
1344
  appEmbed.render();
1169
1345
  await (0, test_utils_1.executeAfterWait)(() => {
1170
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1346
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
1171
1347
  });
1172
1348
  });
1173
1349
  test('should register event handlers to adjust iframe height', async () => {
@@ -1219,7 +1395,7 @@ describe('App embed tests', () => {
1219
1395
  });
1220
1396
  await appEmbed.render();
1221
1397
  appEmbed.navigateToPage(path);
1222
- (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${test_utils_1.defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
1398
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${test_utils_1.defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
1223
1399
  });
1224
1400
  test('navigateToPage with noReload should trigger the appropriate event', async () => {
1225
1401
  (0, test_utils_1.mockMessageChannel)();
@@ -1409,6 +1585,175 @@ describe('App embed tests', () => {
1409
1585
  expect(iframeSrc).toContain('isFullHeightPinboard=true');
1410
1586
  }, 100);
1411
1587
  });
1588
+ test('should default lazy loading flags to true when fullHeight is enabled', async () => {
1589
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1590
+ ...defaultViewConfig,
1591
+ fullHeight: true,
1592
+ });
1593
+ expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBe(true);
1594
+ expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBe(true);
1595
+ expect(appEmbed.viewConfig.lazyLoadingMargin).toBe('500px 0px');
1596
+ await appEmbed.render();
1597
+ await (0, test_utils_1.executeAfterWait)(() => {
1598
+ const iframeSrc = (0, test_utils_1.getIFrameSrc)();
1599
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
1600
+ expect(iframeSrc).toContain('isFullHeightPinboard=true');
1601
+ expect(iframeSrc).toContain('rootMarginForLazyLoad=500px%200px');
1602
+ }, 100);
1603
+ });
1604
+ test('should not default lazy loading flags when fullHeight is not enabled', async () => {
1605
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1606
+ ...defaultViewConfig,
1607
+ });
1608
+ expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBeUndefined();
1609
+ expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
1610
+ expect(appEmbed.viewConfig.lazyLoadingMargin).toBeUndefined();
1611
+ });
1612
+ test('should not write the defaults back onto the caller view config', async () => {
1613
+ const callerViewConfig = {
1614
+ ...defaultViewConfig,
1615
+ fullHeight: true,
1616
+ };
1617
+ new app_1.AppEmbed((0, test_utils_1.getRootEl)(), callerViewConfig);
1618
+ expect(callerViewConfig.lazyLoadingForFullHeight).toBeUndefined();
1619
+ expect(callerViewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
1620
+ expect(callerViewConfig.lazyLoadingMargin).toBeUndefined();
1621
+ });
1622
+ test('should not default lazy loading flags when fullHeight is explicitly false', async () => {
1623
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1624
+ ...defaultViewConfig,
1625
+ fullHeight: false,
1626
+ });
1627
+ expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBeUndefined();
1628
+ expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
1629
+ expect(appEmbed.viewConfig.lazyLoadingMargin).toBeUndefined();
1630
+ });
1631
+ test('should default lazyLoadingMargin when lazyLoadingForFullHeight is set explicitly', async () => {
1632
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1633
+ ...defaultViewConfig,
1634
+ fullHeight: true,
1635
+ lazyLoadingForFullHeight: true,
1636
+ });
1637
+ expect(appEmbed.viewConfig.lazyLoadingMargin).toBe(config.DEFAULT_LAZY_LOADING_MARGIN);
1638
+ await appEmbed.render();
1639
+ await (0, test_utils_1.executeAfterWait)(() => {
1640
+ expect((0, test_utils_1.getIFrameSrc)()).toContain('rootMarginForLazyLoad=500px%200px');
1641
+ }, 100);
1642
+ });
1643
+ test('should let an explicit lazyLoadingMargin win over the default', async () => {
1644
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1645
+ ...defaultViewConfig,
1646
+ fullHeight: true,
1647
+ lazyLoadingMargin: '250px',
1648
+ });
1649
+ await appEmbed.render();
1650
+ await (0, test_utils_1.executeAfterWait)(() => {
1651
+ const iframeSrc = (0, test_utils_1.getIFrameSrc)();
1652
+ expect(iframeSrc).toContain('rootMarginForLazyLoad=250px');
1653
+ expect(iframeSrc).not.toContain('rootMarginForLazyLoad=500px%200px');
1654
+ }, 100);
1655
+ });
1656
+ test('should drop an invalid lazyLoadingMargin and log an error', async () => {
1657
+ const loggerErrorSpy = jest.spyOn(logger_1.logger, 'error').mockImplementation(() => undefined);
1658
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1659
+ ...defaultViewConfig,
1660
+ fullHeight: true,
1661
+ lazyLoadingMargin: 'not-a-margin',
1662
+ });
1663
+ await appEmbed.render();
1664
+ await (0, test_utils_1.executeAfterWait)(() => {
1665
+ const iframeSrc = (0, test_utils_1.getIFrameSrc)();
1666
+ expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
1667
+ expect(iframeSrc).not.toContain('rootMarginForLazyLoad');
1668
+ expect(loggerErrorSpy).toHaveBeenCalledWith('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
1669
+ }, 100);
1670
+ });
1671
+ test('should track scrollable ancestors by default when only fullHeight is set', async () => {
1672
+ const scrollContainer = (0, test_utils_1.getRootEl)();
1673
+ scrollContainer.style.overflow = 'auto';
1674
+ const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
1675
+ const resizeObserveSpy = jest.fn();
1676
+ const resizeDisconnectSpy = jest.fn();
1677
+ window.ResizeObserver = jest.fn().mockImplementation(() => ({
1678
+ observe: resizeObserveSpy,
1679
+ disconnect: resizeDisconnectSpy,
1680
+ }));
1681
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1682
+ ...defaultViewConfig,
1683
+ fullHeight: true,
1684
+ });
1685
+ await appEmbed.render();
1686
+ await (0, test_utils_1.executeAfterWait)(() => {
1687
+ expect(scrollContainerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
1688
+ expect(resizeObserveSpy).toHaveBeenCalledWith(scrollContainer);
1689
+ }, 100);
1690
+ appEmbed.destroy();
1691
+ expect(resizeDisconnectSpy).toHaveBeenCalled();
1692
+ scrollContainer.style.overflow = '';
1693
+ window.ResizeObserver = originalResizeObserver;
1694
+ });
1695
+ test('should skip ancestor tracking when enableScrollableContainerLazyLoading is false', async () => {
1696
+ const scrollContainer = (0, test_utils_1.getRootEl)();
1697
+ scrollContainer.style.overflow = 'auto';
1698
+ const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
1699
+ const windowSpy = jest.spyOn(window, 'addEventListener');
1700
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1701
+ ...defaultViewConfig,
1702
+ fullHeight: true,
1703
+ enableScrollableContainerLazyLoading: false,
1704
+ });
1705
+ await appEmbed.render();
1706
+ await (0, test_utils_1.executeAfterWait)(() => {
1707
+ expect(windowSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
1708
+ expect(scrollContainerSpy).not.toHaveBeenCalledWith('scroll', expect.any(Function));
1709
+ }, 100);
1710
+ appEmbed.destroy();
1711
+ scrollContainer.style.overflow = '';
1712
+ });
1713
+ test('should wire the window scroll listener to the coordinates sender by default', async () => {
1714
+ const addEventListenerSpy = jest.spyOn(window, 'addEventListener');
1715
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1716
+ ...defaultViewConfig,
1717
+ fullHeight: true,
1718
+ });
1719
+ const mockTrigger = jest
1720
+ .spyOn(appEmbed, 'trigger')
1721
+ .mockImplementation(() => Promise.resolve(undefined));
1722
+ await appEmbed.render();
1723
+ await (0, test_utils_1.executeAfterWait)(() => {
1724
+ const scrollCall = addEventListenerSpy.mock.calls.find(([eventName, , capture]) => eventName === 'scroll' && capture === true);
1725
+ expect(scrollCall).toBeDefined();
1726
+ // Call the handler the way a real scroll event would.
1727
+ scrollCall[1]();
1728
+ expect(mockTrigger).toHaveBeenCalledWith(types_1.HostEvent.VisibleEmbedCoordinates, expect.objectContaining({ top: expect.any(Number) }));
1729
+ }, 100);
1730
+ appEmbed.destroy();
1731
+ addEventListenerSpy.mockRestore();
1732
+ });
1733
+ test('should remove listeners on destroy when the flags come from defaults', async () => {
1734
+ const removeEventListenerSpy = jest.spyOn(window, 'removeEventListener');
1735
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1736
+ ...defaultViewConfig,
1737
+ fullHeight: true,
1738
+ });
1739
+ await appEmbed.render();
1740
+ appEmbed.destroy();
1741
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('resize', expect.anything());
1742
+ expect(removeEventListenerSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
1743
+ removeEventListenerSpy.mockRestore();
1744
+ });
1745
+ test('should keep an explicit false for the lazy loading flags', async () => {
1746
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1747
+ ...defaultViewConfig,
1748
+ fullHeight: true,
1749
+ lazyLoadingForFullHeight: false,
1750
+ enableScrollableContainerLazyLoading: false,
1751
+ lazyLoadingMargin: '0px',
1752
+ });
1753
+ expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBe(false);
1754
+ expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBe(false);
1755
+ expect(appEmbed.viewConfig.lazyLoadingMargin).toBe('0px');
1756
+ });
1412
1757
  test('should not set lazyLoadingForEmbed when lazyLoadingForFullHeight is enabled but fullHeight is false', async () => {
1413
1758
  const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
1414
1759
  ...defaultViewConfig,
@@ -1847,4 +2192,80 @@ describe('AppEmbed visualOverrides tests', () => {
1847
2192
  await (0, test_utils_1.testVisualOverridesInEmbed)(appEmbed, visualOverrides);
1848
2193
  });
1849
2194
  });
2195
+ describe('AppEmbed getEmbedParamsObject', () => {
2196
+ beforeEach(() => {
2197
+ cleanUp();
2198
+ jest.spyOn(ts_embed_1.TsEmbed.prototype, 'getAppInitData').mockResolvedValue({});
2199
+ });
2200
+ afterEach(() => {
2201
+ jest.restoreAllMocks();
2202
+ });
2203
+ test('getEmbedParams should use getEmbedParamsObject internally', async () => {
2204
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
2205
+ ...defaultViewConfig,
2206
+ fullHeight: true,
2207
+ });
2208
+ const getEmbedParamsObjectSpy = jest.spyOn(appEmbed, 'getEmbedParamsObject');
2209
+ await appEmbed.render();
2210
+ expect(getEmbedParamsObjectSpy).toHaveBeenCalled();
2211
+ });
2212
+ test('getEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', () => {
2213
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
2214
+ ...defaultViewConfig,
2215
+ fullHeight: true,
2216
+ });
2217
+ const params = appEmbed.getEmbedParamsObject();
2218
+ expect(params.isFullHeightPinboard).toBe(true);
2219
+ expect(params.fullHeight).toBeUndefined();
2220
+ });
2221
+ test('getEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', () => {
2222
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
2223
+ ...defaultViewConfig,
2224
+ fullHeight: false,
2225
+ });
2226
+ const params = appEmbed.getEmbedParamsObject();
2227
+ expect(params.isFullHeightPinboard).toBeUndefined();
2228
+ });
2229
+ test('getUpdateEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', async () => {
2230
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
2231
+ ...defaultViewConfig,
2232
+ fullHeight: true,
2233
+ });
2234
+ const params = await appEmbed.getUpdateEmbedParamsObject();
2235
+ expect(params.isFullHeightPinboard).toBe(true);
2236
+ });
2237
+ test('getUpdateEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', async () => {
2238
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
2239
+ ...defaultViewConfig,
2240
+ fullHeight: false,
2241
+ });
2242
+ const params = await appEmbed.getUpdateEmbedParamsObject();
2243
+ expect(params.isFullHeightPinboard).toBeUndefined();
2244
+ });
2245
+ });
2246
+ describe('AppEmbed updatedSpotterExperience tests', () => {
2247
+ beforeEach(() => {
2248
+ cleanUp();
2249
+ });
2250
+ test('should set updatedSpotterExperience to true in url', async () => {
2251
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
2252
+ ...defaultViewConfig,
2253
+ updatedSpotterExperience: true,
2254
+ });
2255
+ appEmbed.render();
2256
+ await (0, test_utils_1.executeAfterWait)(() => {
2257
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
2258
+ });
2259
+ });
2260
+ test('should set updatedSpotterExperience to false in url', async () => {
2261
+ const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
2262
+ ...defaultViewConfig,
2263
+ updatedSpotterExperience: false,
2264
+ });
2265
+ appEmbed.render();
2266
+ await (0, test_utils_1.executeAfterWait)(() => {
2267
+ (0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
2268
+ });
2269
+ });
2270
+ });
1850
2271
  //# sourceMappingURL=app.spec.js.map