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