@thoughtspot/visual-embed-sdk 1.50.0 → 1.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/css-variables.d.ts +95 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +136 -15
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +59 -37
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +419 -149
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +230 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +30 -16
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +221 -17
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +635 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/host-events.spec.js +151 -0
- package/cjs/src/embed/host-events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +51 -14
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +11 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +9 -0
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +218 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.js +32 -2
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.spec.js +178 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +42 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +26 -6
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +83 -2
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +8 -1
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-utils.js +14 -1
- package/cjs/src/embed/spotter-utils.js.map +1 -1
- package/cjs/src/embed/spotter-utils.spec.js +61 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.d.ts +34 -0
- package/cjs/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.js.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.spec.js +17 -0
- package/cjs/src/embed/spotter-viz-utils.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +29 -7
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +146 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -2
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts +4 -0
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +4 -0
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/react/util.spec.js +251 -0
- package/cjs/src/react/util.spec.js.map +1 -1
- package/cjs/src/types.d.ts +573 -11
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +519 -2
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +93 -0
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/cjs/src/utils/processTrigger.spec.js +61 -0
- package/cjs/src/utils/processTrigger.spec.js.map +1 -1
- package/dist/{index-B5xoN6Cp.js → index-aBzH5ZwF.js} +1 -1
- package/dist/src/css-variables.d.ts +95 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +136 -15
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +230 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +51 -14
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +1 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +2 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +42 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +8 -1
- package/dist/src/embed/spotter-utils.d.ts.map +1 -1
- package/dist/src/embed/spotter-viz-utils.d.ts +34 -0
- package/dist/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +4 -0
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/types.d.ts +573 -11
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +936 -142
- package/dist/tsembed-react.js +935 -141
- package/dist/tsembed.es.js +935 -142
- package/dist/tsembed.js +933 -140
- package/dist/visual-embed-sdk-react-full.d.ts +1147 -44
- package/dist/visual-embed-sdk-react.d.ts +1153 -46
- package/dist/visual-embed-sdk.d.ts +1161 -46
- package/lib/package.json +1 -1
- package/lib/src/css-variables.d.ts +95 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +136 -15
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +60 -38
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +420 -150
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +230 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +31 -17
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +222 -18
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +635 -0
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/host-events.spec.js +152 -1
- package/lib/src/embed/host-events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +51 -14
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +10 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +10 -1
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +218 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +2 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/utils.js +28 -1
- package/lib/src/embed/hostEventClient/utils.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.spec.js +179 -1
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +42 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +26 -6
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +83 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +8 -1
- package/lib/src/embed/spotter-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-utils.js +12 -0
- package/lib/src/embed/spotter-utils.js.map +1 -1
- package/lib/src/embed/spotter-utils.spec.js +62 -1
- package/lib/src/embed/spotter-utils.spec.js.map +1 -1
- package/lib/src/embed/spotter-viz-utils.d.ts +34 -0
- package/lib/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-viz-utils.js.map +1 -1
- package/lib/src/embed/spotter-viz-utils.spec.js +17 -0
- package/lib/src/embed/spotter-viz-utils.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +29 -7
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +146 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +4 -0
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +4 -0
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/react/util.spec.js +251 -0
- package/lib/src/react/util.spec.js.map +1 -1
- package/lib/src/types.d.ts +573 -11
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +519 -2
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.spec.js +93 -0
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/utils/processTrigger.spec.js +61 -0
- package/lib/src/utils/processTrigger.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1161 -46
- package/package.json +1 -1
- package/src/css-variables.ts +118 -0
- package/src/embed/app.spec.ts +530 -183
- package/src/embed/app.ts +209 -66
- package/src/embed/conversation.spec.ts +275 -21
- package/src/embed/conversation.ts +262 -17
- package/src/embed/events.spec.ts +757 -1
- package/src/embed/host-events.spec.ts +194 -0
- package/src/embed/hostEventClient/contracts.ts +57 -14
- package/src/embed/hostEventClient/host-event-client.spec.ts +338 -0
- package/src/embed/hostEventClient/host-event-client.ts +16 -0
- package/src/embed/hostEventClient/utils.spec.ts +204 -0
- package/src/embed/hostEventClient/utils.ts +37 -10
- package/src/embed/liveboard.spec.ts +108 -2
- package/src/embed/liveboard.ts +82 -14
- package/src/embed/spotter-utils.spec.ts +68 -1
- package/src/embed/spotter-utils.ts +16 -1
- package/src/embed/spotter-viz-utils.spec.ts +17 -0
- package/src/embed/spotter-viz-utils.ts +34 -0
- package/src/embed/ts-embed.spec.ts +186 -0
- package/src/embed/ts-embed.ts +30 -4
- package/src/errors.ts +1 -0
- package/src/index.ts +3 -1
- package/src/mixpanel-service.ts +4 -0
- package/src/react/util.spec.tsx +255 -0
- package/src/types.ts +575 -8
- package/src/utils/processData.spec.ts +97 -0
- package/src/utils/processTrigger.spec.ts +91 -0
package/src/embed/app.spec.ts
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
DataPanelCustomColumnGroupsAccordionState,
|
|
5
5
|
Page,
|
|
6
6
|
HomePageSearchBarMode,
|
|
7
|
-
PrimaryNavbarVersion,
|
|
8
7
|
HomePage,
|
|
9
8
|
ListPage,
|
|
10
9
|
} from './app';
|
|
10
|
+
import { SpotterQueryMode } from './conversation';
|
|
11
11
|
import { init } from '../index';
|
|
12
12
|
import { Action, AuthType, EmbedEvent, HostEvent, RuntimeFilterOp } from '../types';
|
|
13
13
|
import {
|
|
@@ -138,7 +138,7 @@ describe('App embed tests', () => {
|
|
|
138
138
|
await executeAfterWait(() => {
|
|
139
139
|
expectUrlMatchesWithParams(
|
|
140
140
|
getIFrameSrc(),
|
|
141
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
141
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
142
142
|
);
|
|
143
143
|
});
|
|
144
144
|
});
|
|
@@ -152,7 +152,7 @@ describe('App embed tests', () => {
|
|
|
152
152
|
await executeAfterWait(() => {
|
|
153
153
|
expectUrlMatchesWithParams(
|
|
154
154
|
getIFrameSrc(),
|
|
155
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
155
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
156
156
|
);
|
|
157
157
|
});
|
|
158
158
|
});
|
|
@@ -166,7 +166,7 @@ describe('App embed tests', () => {
|
|
|
166
166
|
await executeAfterWait(() => {
|
|
167
167
|
expectUrlMatchesWithParams(
|
|
168
168
|
getIFrameSrc(),
|
|
169
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true${defaultParams}${defaultParamsPost}#/home`,
|
|
169
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
170
170
|
);
|
|
171
171
|
});
|
|
172
172
|
});
|
|
@@ -180,7 +180,7 @@ describe('App embed tests', () => {
|
|
|
180
180
|
await executeAfterWait(() => {
|
|
181
181
|
expectUrlMatchesWithParams(
|
|
182
182
|
getIFrameSrc(),
|
|
183
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true${defaultParams}${defaultParamsPost}#/home`,
|
|
183
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
184
184
|
);
|
|
185
185
|
});
|
|
186
186
|
});
|
|
@@ -194,7 +194,7 @@ describe('App embed tests', () => {
|
|
|
194
194
|
await executeAfterWait(() => {
|
|
195
195
|
expectUrlMatchesWithParams(
|
|
196
196
|
getIFrameSrc(),
|
|
197
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true${defaultParams}${defaultParamsPost}#/home`,
|
|
197
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
198
198
|
);
|
|
199
199
|
});
|
|
200
200
|
});
|
|
@@ -210,6 +210,7 @@ describe('App embed tests', () => {
|
|
|
210
210
|
[Page.Home]: 'home',
|
|
211
211
|
[Page.SpotIQ]: 'insights/results',
|
|
212
212
|
[Page.Monitor]: 'insights/monitor-alerts',
|
|
213
|
+
[Page.Collections]: 'collections',
|
|
213
214
|
};
|
|
214
215
|
|
|
215
216
|
const pageIds = Object.keys(pageRouteMap);
|
|
@@ -227,7 +228,7 @@ describe('App embed tests', () => {
|
|
|
227
228
|
await executeAfterWait(() => {
|
|
228
229
|
expectUrlMatchesWithParams(
|
|
229
230
|
getIFrameSrc(),
|
|
230
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`,
|
|
231
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`,
|
|
231
232
|
);
|
|
232
233
|
cleanUp();
|
|
233
234
|
});
|
|
@@ -243,6 +244,7 @@ describe('App embed tests', () => {
|
|
|
243
244
|
[Page.Home]: 'home',
|
|
244
245
|
[Page.SpotIQ]: 'home/spotiq-analysis',
|
|
245
246
|
[Page.Monitor]: 'home/monitor-alerts',
|
|
247
|
+
[Page.Collections]: 'collections',
|
|
246
248
|
};
|
|
247
249
|
|
|
248
250
|
const pageIdsForModularHomes = Object.keys(pageRouteMapForModularHome);
|
|
@@ -261,7 +263,7 @@ describe('App embed tests', () => {
|
|
|
261
263
|
await executeAfterWait(() => {
|
|
262
264
|
expectUrlMatchesWithParams(
|
|
263
265
|
getIFrameSrc(),
|
|
264
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`,
|
|
266
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`,
|
|
265
267
|
);
|
|
266
268
|
cleanUp();
|
|
267
269
|
});
|
|
@@ -278,7 +280,7 @@ describe('App embed tests', () => {
|
|
|
278
280
|
await executeAfterWait(() => {
|
|
279
281
|
expectUrlMatchesWithParams(
|
|
280
282
|
getIFrameSrc(),
|
|
281
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/foo/bar`,
|
|
283
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/foo/bar`,
|
|
282
284
|
);
|
|
283
285
|
});
|
|
284
286
|
});
|
|
@@ -301,7 +303,7 @@ describe('App embed tests', () => {
|
|
|
301
303
|
await executeAfterWait(() => {
|
|
302
304
|
expectUrlMatchesWithParams(
|
|
303
305
|
getIFrameSrc(),
|
|
304
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000${defaultParams}${defaultParamsPost}#/home`,
|
|
306
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
305
307
|
);
|
|
306
308
|
});
|
|
307
309
|
});
|
|
@@ -324,7 +326,7 @@ describe('App embed tests', () => {
|
|
|
324
326
|
await executeAfterWait(() => {
|
|
325
327
|
expectUrlMatchesWithParams(
|
|
326
328
|
getIFrameSrc(),
|
|
327
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
329
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
328
330
|
);
|
|
329
331
|
});
|
|
330
332
|
});
|
|
@@ -348,7 +350,7 @@ describe('App embed tests', () => {
|
|
|
348
350
|
await executeAfterWait(() => {
|
|
349
351
|
expectUrlMatchesWithParams(
|
|
350
352
|
getIFrameSrc(),
|
|
351
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`,
|
|
353
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`,
|
|
352
354
|
);
|
|
353
355
|
});
|
|
354
356
|
});
|
|
@@ -366,7 +368,7 @@ describe('App embed tests', () => {
|
|
|
366
368
|
await executeAfterWait(() => {
|
|
367
369
|
expectUrlMatchesWithParams(
|
|
368
370
|
getIFrameSrc(),
|
|
369
|
-
`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`,
|
|
371
|
+
`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`,
|
|
370
372
|
);
|
|
371
373
|
});
|
|
372
374
|
});
|
|
@@ -381,7 +383,7 @@ describe('App embed tests', () => {
|
|
|
381
383
|
await executeAfterWait(() => {
|
|
382
384
|
expectUrlMatchesWithParams(
|
|
383
385
|
getIFrameSrc(),
|
|
384
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`,
|
|
386
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
385
387
|
);
|
|
386
388
|
});
|
|
387
389
|
});
|
|
@@ -395,7 +397,7 @@ describe('App embed tests', () => {
|
|
|
395
397
|
await executeAfterWait(() => {
|
|
396
398
|
expectUrlMatchesWithParams(
|
|
397
399
|
getIFrameSrc(),
|
|
398
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false${defaultParamsPost}#/home`,
|
|
400
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
399
401
|
);
|
|
400
402
|
});
|
|
401
403
|
});
|
|
@@ -409,7 +411,7 @@ describe('App embed tests', () => {
|
|
|
409
411
|
await executeAfterWait(() => {
|
|
410
412
|
expectUrlMatchesWithParams(
|
|
411
413
|
getIFrameSrc(),
|
|
412
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true${defaultParamsPost}#/home`,
|
|
414
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
413
415
|
);
|
|
414
416
|
});
|
|
415
417
|
});
|
|
@@ -423,7 +425,7 @@ describe('App embed tests', () => {
|
|
|
423
425
|
await executeAfterWait(() => {
|
|
424
426
|
expectUrlMatchesWithParams(
|
|
425
427
|
getIFrameSrc(),
|
|
426
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true${defaultParamsPost}#/home`,
|
|
428
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
427
429
|
);
|
|
428
430
|
});
|
|
429
431
|
});
|
|
@@ -437,7 +439,7 @@ describe('App embed tests', () => {
|
|
|
437
439
|
await executeAfterWait(() => {
|
|
438
440
|
expectUrlMatchesWithParams(
|
|
439
441
|
getIFrameSrc(),
|
|
440
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true${defaultParamsPost}#/home`,
|
|
442
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
441
443
|
);
|
|
442
444
|
});
|
|
443
445
|
});
|
|
@@ -448,7 +450,7 @@ describe('App embed tests', () => {
|
|
|
448
450
|
await executeAfterWait(() => {
|
|
449
451
|
expectUrlMatchesWithParams(
|
|
450
452
|
getIFrameSrc(),
|
|
451
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false${defaultParamsPost}#/home`,
|
|
453
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
452
454
|
);
|
|
453
455
|
});
|
|
454
456
|
});
|
|
@@ -462,7 +464,7 @@ describe('App embed tests', () => {
|
|
|
462
464
|
await executeAfterWait(() => {
|
|
463
465
|
expectUrlMatchesWithParams(
|
|
464
466
|
getIFrameSrc(),
|
|
465
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`,
|
|
467
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
466
468
|
);
|
|
467
469
|
});
|
|
468
470
|
});
|
|
@@ -476,12 +478,12 @@ describe('App embed tests', () => {
|
|
|
476
478
|
await executeAfterWait(() => {
|
|
477
479
|
expectUrlMatchesWithParams(
|
|
478
480
|
getIFrameSrc(),
|
|
479
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true${defaultParamsPost}#/home`,
|
|
481
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
480
482
|
);
|
|
481
483
|
});
|
|
482
484
|
});
|
|
483
485
|
|
|
484
|
-
test('should
|
|
486
|
+
test('should not set isWYSIWYGLiveboardPDFEnabled in url by default', async () => {
|
|
485
487
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
486
488
|
...defaultViewConfig,
|
|
487
489
|
} as AppViewConfig);
|
|
@@ -489,7 +491,7 @@ describe('App embed tests', () => {
|
|
|
489
491
|
await executeAfterWait(() => {
|
|
490
492
|
expectUrlMatchesWithParams(
|
|
491
493
|
getIFrameSrc(),
|
|
492
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
494
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
493
495
|
);
|
|
494
496
|
});
|
|
495
497
|
});
|
|
@@ -503,7 +505,7 @@ describe('App embed tests', () => {
|
|
|
503
505
|
await executeAfterWait(() => {
|
|
504
506
|
expectUrlMatchesWithParams(
|
|
505
507
|
getIFrameSrc(),
|
|
506
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true${defaultParamsPost}#/home`,
|
|
508
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
507
509
|
);
|
|
508
510
|
});
|
|
509
511
|
});
|
|
@@ -517,7 +519,7 @@ describe('App embed tests', () => {
|
|
|
517
519
|
await executeAfterWait(() => {
|
|
518
520
|
expectUrlMatchesWithParams(
|
|
519
521
|
getIFrameSrc(),
|
|
520
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false${defaultParamsPost}#/home`,
|
|
522
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
521
523
|
);
|
|
522
524
|
});
|
|
523
525
|
});
|
|
@@ -530,7 +532,7 @@ describe('App embed tests', () => {
|
|
|
530
532
|
homePage: HomePage.Focused,
|
|
531
533
|
},
|
|
532
534
|
} as AppViewConfig,
|
|
533
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
535
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=true${defaultParams}${defaultParamsPost}#/home`,
|
|
534
536
|
);
|
|
535
537
|
});
|
|
536
538
|
|
|
@@ -543,7 +545,7 @@ describe('App embed tests', () => {
|
|
|
543
545
|
},
|
|
544
546
|
updatedSpotterChatPrompt: false,
|
|
545
547
|
} as AppViewConfig,
|
|
546
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
548
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=false${defaultParams}${defaultParamsPost}#/home`,
|
|
547
549
|
);
|
|
548
550
|
});
|
|
549
551
|
|
|
@@ -556,7 +558,7 @@ describe('App embed tests', () => {
|
|
|
556
558
|
await executeAfterWait(() => {
|
|
557
559
|
expectUrlMatchesWithParams(
|
|
558
560
|
getIFrameSrc(),
|
|
559
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`,
|
|
561
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
560
562
|
);
|
|
561
563
|
});
|
|
562
564
|
});
|
|
@@ -570,7 +572,7 @@ describe('App embed tests', () => {
|
|
|
570
572
|
await executeAfterWait(() => {
|
|
571
573
|
expectUrlMatchesWithParams(
|
|
572
574
|
getIFrameSrc(),
|
|
573
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true${defaultParamsPost}#/home`,
|
|
575
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
574
576
|
);
|
|
575
577
|
});
|
|
576
578
|
});
|
|
@@ -584,7 +586,62 @@ describe('App embed tests', () => {
|
|
|
584
586
|
await executeAfterWait(() => {
|
|
585
587
|
expectUrlMatchesWithParams(
|
|
586
588
|
getIFrameSrc(),
|
|
587
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false${defaultParamsPost}#/home`,
|
|
589
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
590
|
+
);
|
|
591
|
+
});
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
test('should set showSpotterRadiance to true in url', async () => {
|
|
595
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
596
|
+
...defaultViewConfig,
|
|
597
|
+
showSpotterRadiance: true,
|
|
598
|
+
} as AppViewConfig);
|
|
599
|
+
appEmbed.render();
|
|
600
|
+
await executeAfterWait(() => {
|
|
601
|
+
expectUrlMatchesWithParams(
|
|
602
|
+
getIFrameSrc(),
|
|
603
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=true${defaultParamsPost}#/home`,
|
|
604
|
+
);
|
|
605
|
+
});
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
test('should set showSpotterRadiance to false in url', async () => {
|
|
609
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
610
|
+
...defaultViewConfig,
|
|
611
|
+
showSpotterRadiance: false,
|
|
612
|
+
} as AppViewConfig);
|
|
613
|
+
appEmbed.render();
|
|
614
|
+
await executeAfterWait(() => {
|
|
615
|
+
expectUrlMatchesWithParams(
|
|
616
|
+
getIFrameSrc(),
|
|
617
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=false${defaultParamsPost}#/home`,
|
|
618
|
+
);
|
|
619
|
+
});
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
test('should set defaultQueryMode to research in url', async () => {
|
|
623
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
624
|
+
...defaultViewConfig,
|
|
625
|
+
defaultQueryMode: SpotterQueryMode.RESEARCH,
|
|
626
|
+
} as AppViewConfig);
|
|
627
|
+
appEmbed.render();
|
|
628
|
+
await executeAfterWait(() => {
|
|
629
|
+
expectUrlMatchesWithParams(
|
|
630
|
+
getIFrameSrc(),
|
|
631
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&defaultQueryMode=research${defaultParamsPost}#/home`,
|
|
632
|
+
);
|
|
633
|
+
});
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
test('should not set defaultQueryMode in url when unset', async () => {
|
|
637
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
638
|
+
...defaultViewConfig,
|
|
639
|
+
} as AppViewConfig);
|
|
640
|
+
appEmbed.render();
|
|
641
|
+
await executeAfterWait(() => {
|
|
642
|
+
expectUrlMatchesWithParams(
|
|
643
|
+
getIFrameSrc(),
|
|
644
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false${defaultParamsPost}#/home`,
|
|
588
645
|
);
|
|
589
646
|
});
|
|
590
647
|
});
|
|
@@ -600,11 +657,46 @@ describe('App embed tests', () => {
|
|
|
600
657
|
await executeAfterWait(() => {
|
|
601
658
|
expectUrlMatchesWithParams(
|
|
602
659
|
getIFrameSrc(),
|
|
603
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true${defaultParamsPost}#/home`,
|
|
660
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
604
661
|
);
|
|
605
662
|
});
|
|
606
663
|
});
|
|
607
664
|
|
|
665
|
+
test('should set spotterDataSources to a list of Model GUIDs in url', async () => {
|
|
666
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
667
|
+
...defaultViewConfig,
|
|
668
|
+
spotterDataSources: ['model-guid-123', 'model-guid-456'],
|
|
669
|
+
} as AppViewConfig);
|
|
670
|
+
appEmbed.render();
|
|
671
|
+
await executeAfterWait(() => {
|
|
672
|
+
expectUrlMatchesWithParams(
|
|
673
|
+
getIFrameSrc(),
|
|
674
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterDataSources=${encodeURIComponent(JSON.stringify(['model-guid-123', 'model-guid-456']))}${defaultParamsPost}#/home`,
|
|
675
|
+
);
|
|
676
|
+
});
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
test('should not add spotterDataSources to url when not provided', async () => {
|
|
680
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
681
|
+
...defaultViewConfig,
|
|
682
|
+
} as AppViewConfig);
|
|
683
|
+
appEmbed.render();
|
|
684
|
+
await executeAfterWait(() => {
|
|
685
|
+
expect(getIFrameSrc()).not.toContain('spotterDataSources');
|
|
686
|
+
});
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
test('should not add spotterDataSources to url when empty array', async () => {
|
|
690
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
691
|
+
...defaultViewConfig,
|
|
692
|
+
spotterDataSources: [],
|
|
693
|
+
} as AppViewConfig);
|
|
694
|
+
appEmbed.render();
|
|
695
|
+
await executeAfterWait(() => {
|
|
696
|
+
expect(getIFrameSrc()).not.toContain('spotterDataSources');
|
|
697
|
+
});
|
|
698
|
+
});
|
|
699
|
+
|
|
608
700
|
test('should include spotterVizConfig in APP_INIT embedParams when spotterViz is provided', async () => {
|
|
609
701
|
const spotterViz = {
|
|
610
702
|
brandName: 'MyBrand',
|
|
@@ -740,6 +832,104 @@ describe('App embed tests', () => {
|
|
|
740
832
|
});
|
|
741
833
|
});
|
|
742
834
|
|
|
835
|
+
test('should forward spotterChatPinConfig nested in spotterSidebarConfig in APP_INIT', async () => {
|
|
836
|
+
const spotterChatPinConfig = {
|
|
837
|
+
enabled: true,
|
|
838
|
+
pinLabel: 'Pin to top',
|
|
839
|
+
unpinLabel: 'Unpin',
|
|
840
|
+
};
|
|
841
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
842
|
+
...defaultViewConfig,
|
|
843
|
+
spotterSidebarConfig: {
|
|
844
|
+
enablePastConversationsSidebar: true,
|
|
845
|
+
spotterChatPinConfig,
|
|
846
|
+
},
|
|
847
|
+
} as AppViewConfig);
|
|
848
|
+
|
|
849
|
+
mockMessageChannel();
|
|
850
|
+
appEmbed.render();
|
|
851
|
+
|
|
852
|
+
const mockPort: any = { postMessage: jest.fn() };
|
|
853
|
+
await executeAfterWait(() => {
|
|
854
|
+
postMessageToParent(
|
|
855
|
+
getIFrameEl().contentWindow,
|
|
856
|
+
{ type: EmbedEvent.APP_INIT, data: {} },
|
|
857
|
+
mockPort,
|
|
858
|
+
);
|
|
859
|
+
});
|
|
860
|
+
await executeAfterWait(() => {
|
|
861
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
862
|
+
type: EmbedEvent.APP_INIT,
|
|
863
|
+
data: expect.objectContaining({
|
|
864
|
+
embedParams: expect.objectContaining({
|
|
865
|
+
spotterSidebarConfig: expect.objectContaining({
|
|
866
|
+
spotterChatPinConfig,
|
|
867
|
+
}),
|
|
868
|
+
}),
|
|
869
|
+
}),
|
|
870
|
+
});
|
|
871
|
+
});
|
|
872
|
+
});
|
|
873
|
+
|
|
874
|
+
test('should include spotterShareConversationConfig in APP_INIT embedParams when provided', async () => {
|
|
875
|
+
const spotterShareConversationConfig = {
|
|
876
|
+
enableShareConversation: true,
|
|
877
|
+
spotterShareLabel: 'Share',
|
|
878
|
+
spotterShareModalTitle: 'Share conversation',
|
|
879
|
+
};
|
|
880
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
881
|
+
...defaultViewConfig,
|
|
882
|
+
spotterShareConversationConfig,
|
|
883
|
+
} as AppViewConfig);
|
|
884
|
+
|
|
885
|
+
mockMessageChannel();
|
|
886
|
+
appEmbed.render();
|
|
887
|
+
|
|
888
|
+
const mockPort: any = { postMessage: jest.fn() };
|
|
889
|
+
await executeAfterWait(() => {
|
|
890
|
+
postMessageToParent(
|
|
891
|
+
getIFrameEl().contentWindow,
|
|
892
|
+
{ type: EmbedEvent.APP_INIT, data: {} },
|
|
893
|
+
mockPort,
|
|
894
|
+
);
|
|
895
|
+
});
|
|
896
|
+
await executeAfterWait(() => {
|
|
897
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
898
|
+
type: EmbedEvent.APP_INIT,
|
|
899
|
+
data: expect.objectContaining({
|
|
900
|
+
embedParams: expect.objectContaining({
|
|
901
|
+
spotterShareConversationConfig,
|
|
902
|
+
}),
|
|
903
|
+
}),
|
|
904
|
+
});
|
|
905
|
+
});
|
|
906
|
+
});
|
|
907
|
+
|
|
908
|
+
test('should not include spotterShareConversationConfig in APP_INIT when not provided', async () => {
|
|
909
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
910
|
+
...defaultViewConfig,
|
|
911
|
+
} as AppViewConfig);
|
|
912
|
+
|
|
913
|
+
mockMessageChannel();
|
|
914
|
+
appEmbed.render();
|
|
915
|
+
|
|
916
|
+
const mockPort: any = { postMessage: jest.fn() };
|
|
917
|
+
await executeAfterWait(() => {
|
|
918
|
+
postMessageToParent(
|
|
919
|
+
getIFrameEl().contentWindow,
|
|
920
|
+
{ type: EmbedEvent.APP_INIT, data: {} },
|
|
921
|
+
mockPort,
|
|
922
|
+
);
|
|
923
|
+
});
|
|
924
|
+
await executeAfterWait(() => {
|
|
925
|
+
const callArgs = mockPort.postMessage.mock.calls[0][0];
|
|
926
|
+
expect(callArgs.type).toBe(EmbedEvent.APP_INIT);
|
|
927
|
+
if (callArgs.data.embedParams) {
|
|
928
|
+
expect(callArgs.data.embedParams.spotterShareConversationConfig).toBeUndefined();
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
});
|
|
932
|
+
|
|
743
933
|
test('should set toolResponseCardBrandingLabel in url via spotterChatConfig', async () => {
|
|
744
934
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
745
935
|
...defaultViewConfig,
|
|
@@ -751,7 +941,7 @@ describe('App embed tests', () => {
|
|
|
751
941
|
await executeAfterWait(() => {
|
|
752
942
|
expectUrlMatchesWithParams(
|
|
753
943
|
getIFrameSrc(),
|
|
754
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand${defaultParamsPost}#/home`,
|
|
944
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
755
945
|
);
|
|
756
946
|
});
|
|
757
947
|
});
|
|
@@ -765,7 +955,7 @@ describe('App embed tests', () => {
|
|
|
765
955
|
await executeAfterWait(() => {
|
|
766
956
|
expectUrlMatchesWithParams(
|
|
767
957
|
getIFrameSrc(),
|
|
768
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true${defaultParamsPost}#/home`,
|
|
958
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
769
959
|
);
|
|
770
960
|
});
|
|
771
961
|
});
|
|
@@ -806,7 +996,7 @@ describe('App embed tests', () => {
|
|
|
806
996
|
await executeAfterWait(() => {
|
|
807
997
|
expectUrlMatchesWithParams(
|
|
808
998
|
getIFrameSrc(),
|
|
809
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false${defaultParamsPost}#/home`,
|
|
999
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
810
1000
|
);
|
|
811
1001
|
});
|
|
812
1002
|
});
|
|
@@ -820,7 +1010,7 @@ describe('App embed tests', () => {
|
|
|
820
1010
|
await executeAfterWait(() => {
|
|
821
1011
|
expectUrlMatchesWithParams(
|
|
822
1012
|
getIFrameSrc(),
|
|
823
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true${defaultParamsPost}#/home`,
|
|
1013
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
824
1014
|
);
|
|
825
1015
|
});
|
|
826
1016
|
});
|
|
@@ -834,7 +1024,7 @@ describe('App embed tests', () => {
|
|
|
834
1024
|
await executeAfterWait(() => {
|
|
835
1025
|
expectUrlMatchesWithParams(
|
|
836
1026
|
getIFrameSrc(),
|
|
837
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false${defaultParamsPost}#/home`,
|
|
1027
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
838
1028
|
);
|
|
839
1029
|
});
|
|
840
1030
|
});
|
|
@@ -848,7 +1038,7 @@ describe('App embed tests', () => {
|
|
|
848
1038
|
await executeAfterWait(() => {
|
|
849
1039
|
expectUrlMatchesWithParams(
|
|
850
1040
|
getIFrameSrc(),
|
|
851
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true${defaultParamsPost}#/home`,
|
|
1041
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
852
1042
|
);
|
|
853
1043
|
});
|
|
854
1044
|
});
|
|
@@ -862,11 +1052,49 @@ describe('App embed tests', () => {
|
|
|
862
1052
|
await executeAfterWait(() => {
|
|
863
1053
|
expectUrlMatchesWithParams(
|
|
864
1054
|
getIFrameSrc(),
|
|
865
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false${defaultParamsPost}#/home`,
|
|
1055
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
1056
|
+
);
|
|
1057
|
+
});
|
|
1058
|
+
});
|
|
1059
|
+
|
|
1060
|
+
test('should set isScopedLiveboardFilteringEnabled to true in url', async () => {
|
|
1061
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1062
|
+
...defaultViewConfig,
|
|
1063
|
+
isScopedLiveboardFilteringEnabled: true,
|
|
1064
|
+
} as AppViewConfig);
|
|
1065
|
+
appEmbed.render();
|
|
1066
|
+
await executeAfterWait(() => {
|
|
1067
|
+
expectUrlMatchesWithParams(
|
|
1068
|
+
getIFrameSrc(),
|
|
1069
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=true${defaultParamsPost}#/home`,
|
|
866
1070
|
);
|
|
867
1071
|
});
|
|
868
1072
|
});
|
|
869
1073
|
|
|
1074
|
+
test('should set isScopedLiveboardFilteringEnabled to false in url', async () => {
|
|
1075
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1076
|
+
...defaultViewConfig,
|
|
1077
|
+
isScopedLiveboardFilteringEnabled: false,
|
|
1078
|
+
} as AppViewConfig);
|
|
1079
|
+
appEmbed.render();
|
|
1080
|
+
await executeAfterWait(() => {
|
|
1081
|
+
expectUrlMatchesWithParams(
|
|
1082
|
+
getIFrameSrc(),
|
|
1083
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=false${defaultParamsPost}#/home`,
|
|
1084
|
+
);
|
|
1085
|
+
});
|
|
1086
|
+
});
|
|
1087
|
+
|
|
1088
|
+
test('should not set isScopedLiveboardFilteringEnabled in url when undefined', async () => {
|
|
1089
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1090
|
+
...defaultViewConfig,
|
|
1091
|
+
} as AppViewConfig);
|
|
1092
|
+
appEmbed.render();
|
|
1093
|
+
await executeAfterWait(() => {
|
|
1094
|
+
expect(getIFrameSrc()).not.toContain('isScopedLiveboardFilteringEnabled');
|
|
1095
|
+
});
|
|
1096
|
+
});
|
|
1097
|
+
|
|
870
1098
|
test('Should add the tag to the iframe src', async () => {
|
|
871
1099
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
872
1100
|
...defaultViewConfig,
|
|
@@ -878,7 +1106,7 @@ describe('App embed tests', () => {
|
|
|
878
1106
|
await executeAfterWait(() => {
|
|
879
1107
|
expectUrlMatchesWithParams(
|
|
880
1108
|
getIFrameSrc(),
|
|
881
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&tag=Finance${defaultParamsPost}#/home`,
|
|
1109
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&tag=Finance${defaultParamsPost}#/home`,
|
|
882
1110
|
);
|
|
883
1111
|
});
|
|
884
1112
|
});
|
|
@@ -894,7 +1122,7 @@ describe('App embed tests', () => {
|
|
|
894
1122
|
await executeAfterWait(() => {
|
|
895
1123
|
expectUrlMatchesWithParams(
|
|
896
1124
|
getIFrameSrc(),
|
|
897
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`,
|
|
1125
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`,
|
|
898
1126
|
);
|
|
899
1127
|
});
|
|
900
1128
|
});
|
|
@@ -909,7 +1137,7 @@ describe('App embed tests', () => {
|
|
|
909
1137
|
await executeAfterWait(() => {
|
|
910
1138
|
expectUrlMatchesWithParams(
|
|
911
1139
|
getIFrameSrc(),
|
|
912
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`,
|
|
1140
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`,
|
|
913
1141
|
);
|
|
914
1142
|
});
|
|
915
1143
|
});
|
|
@@ -923,7 +1151,7 @@ describe('App embed tests', () => {
|
|
|
923
1151
|
await executeAfterWait(() => {
|
|
924
1152
|
expectUrlMatchesWithParams(
|
|
925
1153
|
getIFrameSrc(),
|
|
926
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1154
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
927
1155
|
);
|
|
928
1156
|
});
|
|
929
1157
|
});
|
|
@@ -939,7 +1167,7 @@ describe('App embed tests', () => {
|
|
|
939
1167
|
await executeAfterWait(() => {
|
|
940
1168
|
expectUrlMatchesWithParams(
|
|
941
1169
|
getIFrameSrc(),
|
|
942
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1170
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
943
1171
|
);
|
|
944
1172
|
});
|
|
945
1173
|
});
|
|
@@ -955,7 +1183,7 @@ describe('App embed tests', () => {
|
|
|
955
1183
|
await executeAfterWait(() => {
|
|
956
1184
|
expectUrlMatchesWithParams(
|
|
957
1185
|
getIFrameSrc(),
|
|
958
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1186
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
959
1187
|
);
|
|
960
1188
|
});
|
|
961
1189
|
});
|
|
@@ -970,7 +1198,7 @@ describe('App embed tests', () => {
|
|
|
970
1198
|
await executeAfterWait(() => {
|
|
971
1199
|
expectUrlMatchesWithParams(
|
|
972
1200
|
getIFrameSrc(),
|
|
973
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1201
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
974
1202
|
);
|
|
975
1203
|
});
|
|
976
1204
|
});
|
|
@@ -986,7 +1214,7 @@ describe('App embed tests', () => {
|
|
|
986
1214
|
await executeAfterWait(() => {
|
|
987
1215
|
expectUrlMatchesWithParams(
|
|
988
1216
|
getIFrameSrc(),
|
|
989
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1217
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
990
1218
|
);
|
|
991
1219
|
});
|
|
992
1220
|
});
|
|
@@ -1002,22 +1230,7 @@ describe('App embed tests', () => {
|
|
|
1002
1230
|
await executeAfterWait(() => {
|
|
1003
1231
|
expectUrlMatchesWithParams(
|
|
1004
1232
|
getIFrameSrc(),
|
|
1005
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1006
|
-
);
|
|
1007
|
-
});
|
|
1008
|
-
});
|
|
1009
|
-
|
|
1010
|
-
test('Should add default isLiveboardMasterpiecesEnabled false when not specified', async () => {
|
|
1011
|
-
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1012
|
-
...defaultViewConfig,
|
|
1013
|
-
showPrimaryNavbar: false,
|
|
1014
|
-
} as AppViewConfig);
|
|
1015
|
-
|
|
1016
|
-
appEmbed.render();
|
|
1017
|
-
await executeAfterWait(() => {
|
|
1018
|
-
expectUrlMatchesWithParams(
|
|
1019
|
-
getIFrameSrc(),
|
|
1020
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1233
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1021
1234
|
);
|
|
1022
1235
|
});
|
|
1023
1236
|
});
|
|
@@ -1033,7 +1246,7 @@ describe('App embed tests', () => {
|
|
|
1033
1246
|
await executeAfterWait(() => {
|
|
1034
1247
|
expectUrlMatchesWithParams(
|
|
1035
1248
|
getIFrameSrc(),
|
|
1036
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1249
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1037
1250
|
);
|
|
1038
1251
|
});
|
|
1039
1252
|
});
|
|
@@ -1049,7 +1262,7 @@ describe('App embed tests', () => {
|
|
|
1049
1262
|
await executeAfterWait(() => {
|
|
1050
1263
|
expectUrlMatchesWithParams(
|
|
1051
1264
|
getIFrameSrc(),
|
|
1052
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1265
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1053
1266
|
);
|
|
1054
1267
|
});
|
|
1055
1268
|
});
|
|
@@ -1064,7 +1277,7 @@ describe('App embed tests', () => {
|
|
|
1064
1277
|
await executeAfterWait(() => {
|
|
1065
1278
|
expectUrlMatchesWithParams(
|
|
1066
1279
|
getIFrameSrc(),
|
|
1067
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1280
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1068
1281
|
);
|
|
1069
1282
|
});
|
|
1070
1283
|
});
|
|
@@ -1079,7 +1292,7 @@ describe('App embed tests', () => {
|
|
|
1079
1292
|
await executeAfterWait(() => {
|
|
1080
1293
|
expectUrlMatchesWithParams(
|
|
1081
1294
|
getIFrameSrc(),
|
|
1082
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1295
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1083
1296
|
);
|
|
1084
1297
|
});
|
|
1085
1298
|
});
|
|
@@ -1094,7 +1307,7 @@ describe('App embed tests', () => {
|
|
|
1094
1307
|
await executeAfterWait(() => {
|
|
1095
1308
|
expectUrlMatchesWithParams(
|
|
1096
1309
|
getIFrameSrc(),
|
|
1097
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1310
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1098
1311
|
);
|
|
1099
1312
|
});
|
|
1100
1313
|
});
|
|
@@ -1109,7 +1322,7 @@ describe('App embed tests', () => {
|
|
|
1109
1322
|
await executeAfterWait(() => {
|
|
1110
1323
|
expectUrlMatchesWithParams(
|
|
1111
1324
|
getIFrameSrc(),
|
|
1112
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1325
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1113
1326
|
);
|
|
1114
1327
|
});
|
|
1115
1328
|
});
|
|
@@ -1124,7 +1337,7 @@ describe('App embed tests', () => {
|
|
|
1124
1337
|
await executeAfterWait(() => {
|
|
1125
1338
|
expectUrlMatchesWithParams(
|
|
1126
1339
|
getIFrameSrc(),
|
|
1127
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1340
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1128
1341
|
);
|
|
1129
1342
|
});
|
|
1130
1343
|
});
|
|
@@ -1139,7 +1352,7 @@ describe('App embed tests', () => {
|
|
|
1139
1352
|
await executeAfterWait(() => {
|
|
1140
1353
|
expectUrlMatchesWithParams(
|
|
1141
1354
|
getIFrameSrc(),
|
|
1142
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1355
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1143
1356
|
);
|
|
1144
1357
|
});
|
|
1145
1358
|
});
|
|
@@ -1155,7 +1368,7 @@ describe('App embed tests', () => {
|
|
|
1155
1368
|
await executeAfterWait(() => {
|
|
1156
1369
|
expectUrlMatchesWithParams(
|
|
1157
1370
|
getIFrameSrc(),
|
|
1158
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1371
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1159
1372
|
);
|
|
1160
1373
|
});
|
|
1161
1374
|
appEmbedTrue.destroy();
|
|
@@ -1170,7 +1383,7 @@ describe('App embed tests', () => {
|
|
|
1170
1383
|
await executeAfterWait(() => {
|
|
1171
1384
|
expectUrlMatchesWithParams(
|
|
1172
1385
|
getIFrameSrc(),
|
|
1173
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1386
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1174
1387
|
);
|
|
1175
1388
|
});
|
|
1176
1389
|
appEmbedFalse.destroy();
|
|
@@ -1184,7 +1397,7 @@ describe('App embed tests', () => {
|
|
|
1184
1397
|
await executeAfterWait(() => {
|
|
1185
1398
|
expectUrlMatchesWithParams(
|
|
1186
1399
|
getIFrameSrc(),
|
|
1187
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1400
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1188
1401
|
);
|
|
1189
1402
|
});
|
|
1190
1403
|
});
|
|
@@ -1240,7 +1453,7 @@ describe('App embed tests', () => {
|
|
|
1240
1453
|
await executeAfterWait(() => {
|
|
1241
1454
|
expectUrlMatchesWithParams(
|
|
1242
1455
|
getIFrameSrc(),
|
|
1243
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1456
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1244
1457
|
);
|
|
1245
1458
|
});
|
|
1246
1459
|
});
|
|
@@ -1255,7 +1468,7 @@ describe('App embed tests', () => {
|
|
|
1255
1468
|
await executeAfterWait(() => {
|
|
1256
1469
|
expectUrlMatchesWithParams(
|
|
1257
1470
|
getIFrameSrc(),
|
|
1258
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1471
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1259
1472
|
);
|
|
1260
1473
|
});
|
|
1261
1474
|
});
|
|
@@ -1269,7 +1482,7 @@ describe('App embed tests', () => {
|
|
|
1269
1482
|
await executeAfterWait(() => {
|
|
1270
1483
|
expectUrlMatchesWithParams(
|
|
1271
1484
|
getIFrameSrc(),
|
|
1272
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1485
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1273
1486
|
);
|
|
1274
1487
|
});
|
|
1275
1488
|
});
|
|
@@ -1283,7 +1496,7 @@ describe('App embed tests', () => {
|
|
|
1283
1496
|
await executeAfterWait(() => {
|
|
1284
1497
|
expectUrlMatchesWithParams(
|
|
1285
1498
|
getIFrameSrc(),
|
|
1286
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1499
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1287
1500
|
);
|
|
1288
1501
|
});
|
|
1289
1502
|
});
|
|
@@ -1298,7 +1511,7 @@ describe('App embed tests', () => {
|
|
|
1298
1511
|
await executeAfterWait(() => {
|
|
1299
1512
|
expectUrlMatchesWithParams(
|
|
1300
1513
|
getIFrameSrc(),
|
|
1301
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1514
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1302
1515
|
);
|
|
1303
1516
|
});
|
|
1304
1517
|
});
|
|
@@ -1313,7 +1526,7 @@ describe('App embed tests', () => {
|
|
|
1313
1526
|
await executeAfterWait(() => {
|
|
1314
1527
|
expectUrlMatchesWithParams(
|
|
1315
1528
|
getIFrameSrc(),
|
|
1316
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1529
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHomepageLeftNav=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1317
1530
|
);
|
|
1318
1531
|
});
|
|
1319
1532
|
});
|
|
@@ -1330,7 +1543,7 @@ describe('App embed tests', () => {
|
|
|
1330
1543
|
await executeAfterWait(() => {
|
|
1331
1544
|
expectUrlMatchesWithParams(
|
|
1332
1545
|
getIFrameSrc(),
|
|
1333
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1546
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1334
1547
|
);
|
|
1335
1548
|
});
|
|
1336
1549
|
});
|
|
@@ -1347,93 +1560,18 @@ describe('App embed tests', () => {
|
|
|
1347
1560
|
await executeAfterWait(() => {
|
|
1348
1561
|
expectUrlMatchesWithParams(
|
|
1349
1562
|
getIFrameSrc(),
|
|
1350
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1563
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1351
1564
|
);
|
|
1352
1565
|
});
|
|
1353
1566
|
});
|
|
1354
1567
|
|
|
1355
|
-
test('Should add navigationVersion=v3 when primaryNavbarVersion is Sliding to the iframe src', async () => {
|
|
1356
|
-
await testUrlParams(
|
|
1357
|
-
{
|
|
1358
|
-
...defaultViewConfig,
|
|
1359
|
-
discoveryExperience: {
|
|
1360
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
1361
|
-
homePage: HomePage.Modular,
|
|
1362
|
-
},
|
|
1363
|
-
} as AppViewConfig,
|
|
1364
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1365
|
-
);
|
|
1366
|
-
});
|
|
1367
|
-
|
|
1368
|
-
test('Should not add navigationVersion=v3 when primaryNavbarVersion is not added to the iframe src', async () => {
|
|
1369
|
-
await testUrlParams(
|
|
1370
|
-
{
|
|
1371
|
-
...defaultViewConfig,
|
|
1372
|
-
discoveryExperience: {
|
|
1373
|
-
homePage: HomePage.Modular,
|
|
1374
|
-
},
|
|
1375
|
-
} as AppViewConfig,
|
|
1376
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`
|
|
1377
|
-
);
|
|
1378
|
-
});
|
|
1379
|
-
|
|
1380
|
-
test('Should add navigationVersion=v3 & modularHomeExperience=true when primaryNavbarVersion is Sliding to the iframe src', async () => {
|
|
1381
|
-
await testUrlParams(
|
|
1382
|
-
{
|
|
1383
|
-
...defaultViewConfig,
|
|
1384
|
-
// homePage v2 config not included under discoveryExperience
|
|
1385
|
-
discoveryExperience: {
|
|
1386
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
1387
|
-
},
|
|
1388
|
-
} as AppViewConfig,
|
|
1389
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1390
|
-
);
|
|
1391
|
-
});
|
|
1392
|
-
|
|
1393
|
-
test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when Sliding and ModularWithStylingChanges configured in the iframe src', async () => {
|
|
1394
|
-
await testUrlParams(
|
|
1395
|
-
{
|
|
1396
|
-
...defaultViewConfig,
|
|
1397
|
-
discoveryExperience: {
|
|
1398
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
1399
|
-
homePage: HomePage.ModularWithStylingChanges,
|
|
1400
|
-
},
|
|
1401
|
-
} as AppViewConfig,
|
|
1402
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1403
|
-
);
|
|
1404
|
-
});
|
|
1405
|
-
|
|
1406
|
-
test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when homePage is ModularWithStylingChanges to the iframe src', async () => {
|
|
1407
|
-
await testUrlParams(
|
|
1408
|
-
{
|
|
1409
|
-
...defaultViewConfig,
|
|
1410
|
-
// primaryNavbarVersion is not included under
|
|
1411
|
-
// discoveryExperience, then it set navigationVersion=v2 and
|
|
1412
|
-
// modularHomeExperience=false.
|
|
1413
|
-
discoveryExperience: {
|
|
1414
|
-
homePage: HomePage.ModularWithStylingChanges,
|
|
1415
|
-
},
|
|
1416
|
-
} as AppViewConfig,
|
|
1417
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1418
|
-
);
|
|
1419
|
-
});
|
|
1420
|
-
|
|
1421
|
-
test('Should add navigationVersion=v2 when primaryNavbarVersion is not added to the iframe src', async () => {
|
|
1422
|
-
await testUrlParams(
|
|
1423
|
-
{
|
|
1424
|
-
...defaultViewConfig,
|
|
1425
|
-
} as AppViewConfig,
|
|
1426
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2${defaultParams}${defaultParamsPost}#/home`
|
|
1427
|
-
);
|
|
1428
|
-
});
|
|
1429
|
-
|
|
1430
1568
|
test('Should add enableAskSage flag to the iframe src', async () => {
|
|
1431
1569
|
await testUrlParams(
|
|
1432
1570
|
{
|
|
1433
1571
|
...defaultViewConfig,
|
|
1434
1572
|
enableAskSage: true,
|
|
1435
1573
|
} as AppViewConfig,
|
|
1436
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1574
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableAskSage=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1437
1575
|
);
|
|
1438
1576
|
});
|
|
1439
1577
|
|
|
@@ -1445,30 +1583,28 @@ describe('App embed tests', () => {
|
|
|
1445
1583
|
listPageVersion: ListPage.ListWithUXChanges,
|
|
1446
1584
|
},
|
|
1447
1585
|
} as AppViewConfig,
|
|
1448
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1586
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&listpageVersion=v3&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1449
1587
|
);
|
|
1450
1588
|
});
|
|
1451
1589
|
|
|
1452
|
-
test('Should
|
|
1590
|
+
test('Should send navigationVersion=v3 & homepageVersion=v3 by default when no discoveryExperience is provided', async () => {
|
|
1453
1591
|
await testUrlParams(
|
|
1454
1592
|
{
|
|
1455
1593
|
...defaultViewConfig,
|
|
1456
1594
|
} as AppViewConfig,
|
|
1457
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1595
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1458
1596
|
);
|
|
1459
1597
|
});
|
|
1460
1598
|
|
|
1461
|
-
test('Should
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1471
|
-
);
|
|
1599
|
+
test('Should not send modularHomeExperience param by default when not specified', async () => {
|
|
1600
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1601
|
+
...defaultViewConfig,
|
|
1602
|
+
} as AppViewConfig);
|
|
1603
|
+
appEmbed.render();
|
|
1604
|
+
await executeAfterWait(() => {
|
|
1605
|
+
const url = new URL(getIFrameSrc());
|
|
1606
|
+
expect(url.searchParams.has('modularHomeExperience')).toBe(false);
|
|
1607
|
+
});
|
|
1472
1608
|
});
|
|
1473
1609
|
|
|
1474
1610
|
|
|
@@ -1477,12 +1613,10 @@ describe('App embed tests', () => {
|
|
|
1477
1613
|
{
|
|
1478
1614
|
...defaultViewConfig,
|
|
1479
1615
|
discoveryExperience: {
|
|
1480
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
1481
|
-
homePage: HomePage.Modular,
|
|
1482
1616
|
listPageVersion: ListPage.ListWithUXChanges,
|
|
1483
1617
|
},
|
|
1484
1618
|
} as AppViewConfig,
|
|
1485
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1619
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1486
1620
|
);
|
|
1487
1621
|
});
|
|
1488
1622
|
|
|
@@ -1495,7 +1629,7 @@ describe('App embed tests', () => {
|
|
|
1495
1629
|
await executeAfterWait(() => {
|
|
1496
1630
|
expectUrlMatchesWithParams(
|
|
1497
1631
|
getIFrameSrc(),
|
|
1498
|
-
`http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1632
|
+
`http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1499
1633
|
);
|
|
1500
1634
|
});
|
|
1501
1635
|
|
|
@@ -1508,7 +1642,7 @@ describe('App embed tests', () => {
|
|
|
1508
1642
|
await executeAfterWait(() => {
|
|
1509
1643
|
expectUrlMatchesWithParams(
|
|
1510
1644
|
getIFrameSrc(),
|
|
1511
|
-
`http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1645
|
+
`http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1512
1646
|
);
|
|
1513
1647
|
});
|
|
1514
1648
|
});
|
|
@@ -1522,7 +1656,7 @@ describe('App embed tests', () => {
|
|
|
1522
1656
|
await executeAfterWait(() => {
|
|
1523
1657
|
expectUrlMatchesWithParams(
|
|
1524
1658
|
getIFrameSrc(),
|
|
1525
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true${defaultParamsPost}#/home`,
|
|
1659
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
1526
1660
|
);
|
|
1527
1661
|
});
|
|
1528
1662
|
});
|
|
@@ -1536,7 +1670,7 @@ describe('App embed tests', () => {
|
|
|
1536
1670
|
await executeAfterWait(() => {
|
|
1537
1671
|
expectUrlMatchesWithParams(
|
|
1538
1672
|
getIFrameSrc(),
|
|
1539
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false${defaultParamsPost}#/home`,
|
|
1673
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
1540
1674
|
);
|
|
1541
1675
|
});
|
|
1542
1676
|
});
|
|
@@ -1561,7 +1695,7 @@ describe('App embed tests', () => {
|
|
|
1561
1695
|
await executeAfterWait(() => {
|
|
1562
1696
|
expectUrlMatchesWithParams(
|
|
1563
1697
|
getIFrameSrc(),
|
|
1564
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1698
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=objectSearch&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1565
1699
|
);
|
|
1566
1700
|
});
|
|
1567
1701
|
});
|
|
@@ -1576,7 +1710,7 @@ describe('App embed tests', () => {
|
|
|
1576
1710
|
await executeAfterWait(() => {
|
|
1577
1711
|
expectUrlMatchesWithParams(
|
|
1578
1712
|
getIFrameSrc(),
|
|
1579
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1713
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=aiAnswer&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1580
1714
|
);
|
|
1581
1715
|
});
|
|
1582
1716
|
});
|
|
@@ -1591,7 +1725,7 @@ describe('App embed tests', () => {
|
|
|
1591
1725
|
await executeAfterWait(() => {
|
|
1592
1726
|
expectUrlMatchesWithParams(
|
|
1593
1727
|
getIFrameSrc(),
|
|
1594
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1728
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=none&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1595
1729
|
);
|
|
1596
1730
|
});
|
|
1597
1731
|
});
|
|
@@ -1608,7 +1742,7 @@ describe('App embed tests', () => {
|
|
|
1608
1742
|
await executeAfterWait(() => {
|
|
1609
1743
|
expectUrlMatchesWithParams(
|
|
1610
1744
|
getIFrameSrc(),
|
|
1611
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1745
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1612
1746
|
);
|
|
1613
1747
|
});
|
|
1614
1748
|
});
|
|
@@ -1669,7 +1803,7 @@ describe('App embed tests', () => {
|
|
|
1669
1803
|
appEmbed.navigateToPage(path);
|
|
1670
1804
|
expectUrlMatchesWithParams(
|
|
1671
1805
|
getIFrameSrc(),
|
|
1672
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
|
|
1806
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
|
|
1673
1807
|
);
|
|
1674
1808
|
});
|
|
1675
1809
|
|
|
@@ -1736,6 +1870,116 @@ describe('App embed tests', () => {
|
|
|
1736
1870
|
'Please call render before invoking this method',
|
|
1737
1871
|
);
|
|
1738
1872
|
});
|
|
1873
|
+
|
|
1874
|
+
describe('overrideHistoryState flag', () => {
|
|
1875
|
+
test('navigateToPage with overrideHistoryState=true should trigger HostEvent.Navigate', async () => {
|
|
1876
|
+
mockMessageChannel();
|
|
1877
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1878
|
+
frameParams: {
|
|
1879
|
+
width: '100%',
|
|
1880
|
+
height: '100%',
|
|
1881
|
+
},
|
|
1882
|
+
overrideHistoryState: true,
|
|
1883
|
+
});
|
|
1884
|
+
await appEmbed.render();
|
|
1885
|
+
|
|
1886
|
+
const iframe = getIFrameEl();
|
|
1887
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1888
|
+
appEmbed.navigateToPage(path, false);
|
|
1889
|
+
|
|
1890
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(
|
|
1891
|
+
expect.objectContaining({
|
|
1892
|
+
type: HostEvent.Navigate,
|
|
1893
|
+
data: path,
|
|
1894
|
+
}),
|
|
1895
|
+
`http://${thoughtSpotHost}`,
|
|
1896
|
+
expect.anything(),
|
|
1897
|
+
);
|
|
1898
|
+
});
|
|
1899
|
+
|
|
1900
|
+
test('navigateToPage with overrideHistoryState=true and path as number should trigger HostEvent.Navigate', async () => {
|
|
1901
|
+
mockMessageChannel();
|
|
1902
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1903
|
+
frameParams: {
|
|
1904
|
+
width: '100%',
|
|
1905
|
+
height: '100%',
|
|
1906
|
+
},
|
|
1907
|
+
overrideHistoryState: true,
|
|
1908
|
+
});
|
|
1909
|
+
await appEmbed.render();
|
|
1910
|
+
|
|
1911
|
+
const iframe = getIFrameEl();
|
|
1912
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1913
|
+
appEmbed.navigateToPage(-1, false);
|
|
1914
|
+
|
|
1915
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(
|
|
1916
|
+
expect.objectContaining({
|
|
1917
|
+
type: HostEvent.Navigate,
|
|
1918
|
+
data: -1,
|
|
1919
|
+
}),
|
|
1920
|
+
`http://${thoughtSpotHost}`,
|
|
1921
|
+
expect.anything(),
|
|
1922
|
+
);
|
|
1923
|
+
});
|
|
1924
|
+
|
|
1925
|
+
test('navigateToPage with overrideHistoryState=false and noReload=false should update iframe src', async () => {
|
|
1926
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1927
|
+
frameParams: {
|
|
1928
|
+
width: '100%',
|
|
1929
|
+
height: '100%',
|
|
1930
|
+
},
|
|
1931
|
+
overrideHistoryState: false,
|
|
1932
|
+
});
|
|
1933
|
+
await appEmbed.render();
|
|
1934
|
+
appEmbed.navigateToPage(path, false);
|
|
1935
|
+
|
|
1936
|
+
expectUrlMatchesWithParams(
|
|
1937
|
+
getIFrameSrc(),
|
|
1938
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
|
|
1939
|
+
);
|
|
1940
|
+
});
|
|
1941
|
+
|
|
1942
|
+
test('navigateToPage with overrideHistoryState=undefined and noReload=false should update iframe src', async () => {
|
|
1943
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1944
|
+
frameParams: {
|
|
1945
|
+
width: '100%',
|
|
1946
|
+
height: '100%',
|
|
1947
|
+
},
|
|
1948
|
+
});
|
|
1949
|
+
await appEmbed.render();
|
|
1950
|
+
appEmbed.navigateToPage(path, false);
|
|
1951
|
+
|
|
1952
|
+
expectUrlMatchesWithParams(
|
|
1953
|
+
getIFrameSrc(),
|
|
1954
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
|
|
1955
|
+
);
|
|
1956
|
+
});
|
|
1957
|
+
|
|
1958
|
+
test('navigateToPage respects noReload priority over overrideHistoryState', async () => {
|
|
1959
|
+
mockMessageChannel();
|
|
1960
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1961
|
+
frameParams: {
|
|
1962
|
+
width: '100%',
|
|
1963
|
+
height: '100%',
|
|
1964
|
+
},
|
|
1965
|
+
overrideHistoryState: false,
|
|
1966
|
+
});
|
|
1967
|
+
await appEmbed.render();
|
|
1968
|
+
|
|
1969
|
+
const iframe = getIFrameEl();
|
|
1970
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1971
|
+
appEmbed.navigateToPage(path, true);
|
|
1972
|
+
|
|
1973
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(
|
|
1974
|
+
expect.objectContaining({
|
|
1975
|
+
type: HostEvent.Navigate,
|
|
1976
|
+
data: path,
|
|
1977
|
+
}),
|
|
1978
|
+
`http://${thoughtSpotHost}`,
|
|
1979
|
+
expect.anything(),
|
|
1980
|
+
);
|
|
1981
|
+
});
|
|
1982
|
+
});
|
|
1739
1983
|
});
|
|
1740
1984
|
|
|
1741
1985
|
describe('LazyLoadingForFullHeight functionality', () => {
|
|
@@ -2333,3 +2577,106 @@ describe('AppEmbed visualOverrides tests', () => {
|
|
|
2333
2577
|
await testVisualOverridesInEmbed(appEmbed, visualOverrides);
|
|
2334
2578
|
});
|
|
2335
2579
|
});
|
|
2580
|
+
|
|
2581
|
+
describe('AppEmbed getEmbedParamsObject', () => {
|
|
2582
|
+
beforeEach(() => {
|
|
2583
|
+
cleanUp();
|
|
2584
|
+
jest.spyOn(TsEmbed.prototype as any, 'getAppInitData').mockResolvedValue({});
|
|
2585
|
+
});
|
|
2586
|
+
|
|
2587
|
+
afterEach(() => {
|
|
2588
|
+
jest.restoreAllMocks();
|
|
2589
|
+
});
|
|
2590
|
+
|
|
2591
|
+
test('getEmbedParams should use getEmbedParamsObject internally', async () => {
|
|
2592
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2593
|
+
...defaultViewConfig,
|
|
2594
|
+
fullHeight: true,
|
|
2595
|
+
} as AppViewConfig);
|
|
2596
|
+
|
|
2597
|
+
const getEmbedParamsObjectSpy = jest.spyOn(appEmbed as any, 'getEmbedParamsObject');
|
|
2598
|
+
|
|
2599
|
+
await appEmbed.render();
|
|
2600
|
+
|
|
2601
|
+
expect(getEmbedParamsObjectSpy).toHaveBeenCalled();
|
|
2602
|
+
});
|
|
2603
|
+
|
|
2604
|
+
test('getEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', () => {
|
|
2605
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2606
|
+
...defaultViewConfig,
|
|
2607
|
+
fullHeight: true,
|
|
2608
|
+
} as AppViewConfig);
|
|
2609
|
+
|
|
2610
|
+
const params = (appEmbed as any).getEmbedParamsObject();
|
|
2611
|
+
|
|
2612
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
2613
|
+
expect(params.fullHeight).toBeUndefined();
|
|
2614
|
+
});
|
|
2615
|
+
|
|
2616
|
+
test('getEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', () => {
|
|
2617
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2618
|
+
...defaultViewConfig,
|
|
2619
|
+
fullHeight: false,
|
|
2620
|
+
} as AppViewConfig);
|
|
2621
|
+
|
|
2622
|
+
const params = (appEmbed as any).getEmbedParamsObject();
|
|
2623
|
+
|
|
2624
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
2625
|
+
});
|
|
2626
|
+
|
|
2627
|
+
test('getUpdateEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', async () => {
|
|
2628
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2629
|
+
...defaultViewConfig,
|
|
2630
|
+
fullHeight: true,
|
|
2631
|
+
} as AppViewConfig);
|
|
2632
|
+
|
|
2633
|
+
const params = await (appEmbed as any).getUpdateEmbedParamsObject();
|
|
2634
|
+
|
|
2635
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
2636
|
+
});
|
|
2637
|
+
|
|
2638
|
+
test('getUpdateEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', async () => {
|
|
2639
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2640
|
+
...defaultViewConfig,
|
|
2641
|
+
fullHeight: false,
|
|
2642
|
+
} as AppViewConfig);
|
|
2643
|
+
|
|
2644
|
+
const params = await (appEmbed as any).getUpdateEmbedParamsObject();
|
|
2645
|
+
|
|
2646
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
2647
|
+
});
|
|
2648
|
+
});
|
|
2649
|
+
|
|
2650
|
+
describe('AppEmbed updatedSpotterExperience tests', () => {
|
|
2651
|
+
beforeEach(() => {
|
|
2652
|
+
cleanUp();
|
|
2653
|
+
});
|
|
2654
|
+
|
|
2655
|
+
test('should set updatedSpotterExperience to true in url', async () => {
|
|
2656
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2657
|
+
...defaultViewConfig,
|
|
2658
|
+
updatedSpotterExperience: true,
|
|
2659
|
+
} as AppViewConfig);
|
|
2660
|
+
appEmbed.render();
|
|
2661
|
+
await executeAfterWait(() => {
|
|
2662
|
+
expectUrlMatchesWithParams(
|
|
2663
|
+
getIFrameSrc(),
|
|
2664
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
2665
|
+
);
|
|
2666
|
+
});
|
|
2667
|
+
});
|
|
2668
|
+
|
|
2669
|
+
test('should set updatedSpotterExperience to false in url', async () => {
|
|
2670
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2671
|
+
...defaultViewConfig,
|
|
2672
|
+
updatedSpotterExperience: false,
|
|
2673
|
+
} as AppViewConfig);
|
|
2674
|
+
appEmbed.render();
|
|
2675
|
+
await executeAfterWait(() => {
|
|
2676
|
+
expectUrlMatchesWithParams(
|
|
2677
|
+
getIFrameSrc(),
|
|
2678
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
2679
|
+
);
|
|
2680
|
+
});
|
|
2681
|
+
});
|
|
2682
|
+
});
|