@thoughtspot/visual-embed-sdk 1.50.0 → 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.
- package/cjs/package.json +1 -1
- package/cjs/src/config.d.ts +1 -0
- package/cjs/src/config.d.ts.map +1 -1
- package/cjs/src/config.js +2 -1
- package/cjs/src/config.js.map +1 -1
- package/cjs/src/css-variables.d.ts +122 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +176 -24
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +86 -38
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +672 -150
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +1 -1
- package/cjs/src/embed/base.js +1 -1
- package/cjs/src/embed/conversation.d.ts +401 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +32 -16
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +346 -17
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +638 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/host-events.spec.js +187 -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 +2 -1
- 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 +236 -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 +81 -13
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +50 -9
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +432 -4
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +15 -1
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-utils.js +28 -1
- package/cjs/src/embed/spotter-utils.js.map +1 -1
- package/cjs/src/embed/spotter-utils.spec.js +129 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.d.ts +37 -4
- 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 +16 -8
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +96 -37
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +683 -3
- 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 +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +4 -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/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/all-types-export.parity.spec.d.ts +2 -0
- package/cjs/src/react/all-types-export.parity.spec.d.ts.map +1 -0
- package/cjs/src/react/all-types-export.parity.spec.js +194 -0
- package/cjs/src/react/all-types-export.parity.spec.js.map +1 -0
- package/cjs/src/react/index.d.ts +66 -32
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +5 -3
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +101 -0
- package/cjs/src/react/index.spec.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 +902 -28
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +701 -14
- 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/cjs/src/utils.spec.js +4 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-B5xoN6Cp.js → index-Bivg-mDx.js} +1 -1
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +122 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +176 -24
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +1 -1
- package/dist/src/embed/conversation.d.ts +401 -2
- 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 +2 -1
- 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 +81 -13
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +15 -1
- package/dist/src/embed/spotter-utils.d.ts.map +1 -1
- package/dist/src/embed/spotter-viz-utils.d.ts +37 -4
- package/dist/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +16 -8
- 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 +3 -3
- 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/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/all-types-export.parity.spec.d.ts +2 -0
- package/dist/src/react/all-types-export.parity.spec.d.ts.map +1 -0
- package/dist/src/react/index.d.ts +66 -32
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +902 -28
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +1269 -206
- package/dist/tsembed-react.js +1268 -205
- package/dist/tsembed.es.js +1364 -304
- package/dist/tsembed.js +1362 -302
- package/dist/visual-embed-sdk-react-full.d.ts +1867 -157
- package/dist/visual-embed-sdk-react.d.ts +1872 -161
- package/dist/visual-embed-sdk.d.ts +1815 -127
- package/lib/package.json +1 -1
- package/lib/src/config.d.ts +1 -0
- package/lib/src/config.d.ts.map +1 -1
- package/lib/src/config.js +1 -0
- package/lib/src/config.js.map +1 -1
- package/lib/src/css-variables.d.ts +122 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +176 -24
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +87 -39
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +673 -151
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -1
- package/lib/src/embed/base.js +1 -1
- package/lib/src/embed/conversation.d.ts +401 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +33 -17
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +347 -18
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +638 -0
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/host-events.spec.js +188 -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 +2 -1
- 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 +236 -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 +81 -13
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +50 -9
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +432 -4
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +15 -1
- package/lib/src/embed/spotter-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-utils.js +25 -0
- package/lib/src/embed/spotter-utils.js.map +1 -1
- package/lib/src/embed/spotter-utils.spec.js +130 -1
- package/lib/src/embed/spotter-utils.spec.js.map +1 -1
- package/lib/src/embed/spotter-viz-utils.d.ts +37 -4
- 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 +16 -8
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +96 -37
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +683 -3
- 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 +3 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +3 -3
- 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/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/all-types-export.parity.spec.d.ts +2 -0
- package/lib/src/react/all-types-export.parity.spec.d.ts.map +1 -0
- package/lib/src/react/all-types-export.parity.spec.js +191 -0
- package/lib/src/react/all-types-export.parity.spec.js.map +1 -0
- package/lib/src/react/index.d.ts +66 -32
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +5 -3
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +102 -1
- package/lib/src/react/index.spec.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 +902 -28
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +701 -14
- 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/utils.spec.js +4 -0
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1815 -127
- package/package.json +1 -1
- package/src/config.ts +1 -0
- package/src/css-variables.ts +150 -0
- package/src/embed/app.spec.ts +877 -196
- package/src/embed/app.ts +276 -75
- package/src/embed/base.ts +1 -1
- package/src/embed/conversation.spec.ts +411 -21
- package/src/embed/conversation.ts +441 -18
- package/src/embed/events.spec.ts +761 -1
- package/src/embed/host-events.spec.ts +242 -0
- package/src/embed/hostEventClient/contracts.ts +57 -14
- package/src/embed/hostEventClient/host-event-client.spec.ts +372 -0
- package/src/embed/hostEventClient/host-event-client.ts +18 -2
- package/src/embed/hostEventClient/utils.spec.ts +204 -0
- package/src/embed/hostEventClient/utils.ts +37 -10
- package/src/embed/liveboard.spec.ts +565 -4
- package/src/embed/liveboard.ts +155 -28
- package/src/embed/spotter-utils.spec.ts +140 -1
- package/src/embed/spotter-utils.ts +36 -1
- package/src/embed/spotter-viz-utils.spec.ts +17 -0
- package/src/embed/spotter-viz-utils.ts +37 -4
- package/src/embed/ts-embed.spec.ts +885 -3
- package/src/embed/ts-embed.ts +111 -39
- package/src/errors.ts +1 -0
- package/src/index.ts +45 -2
- package/src/mixpanel-service.ts +4 -0
- package/src/react/all-types-export.parity.spec.ts +208 -0
- package/src/react/all-types-export.ts +22 -0
- package/src/react/index.spec.tsx +158 -0
- package/src/react/index.tsx +70 -33
- package/src/react/util.spec.tsx +255 -0
- package/src/types.ts +904 -24
- package/src/utils/processData.spec.ts +97 -0
- package/src/utils/processTrigger.spec.ts +91 -0
- package/src/utils.spec.ts +5 -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,8 @@ 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',
|
|
214
|
+
[Page.LiveboardSchedules]: 'home/liveboard-schedules',
|
|
213
215
|
};
|
|
214
216
|
|
|
215
217
|
const pageIds = Object.keys(pageRouteMap);
|
|
@@ -227,7 +229,7 @@ describe('App embed tests', () => {
|
|
|
227
229
|
await executeAfterWait(() => {
|
|
228
230
|
expectUrlMatchesWithParams(
|
|
229
231
|
getIFrameSrc(),
|
|
230
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`,
|
|
232
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`,
|
|
231
233
|
);
|
|
232
234
|
cleanUp();
|
|
233
235
|
});
|
|
@@ -243,6 +245,8 @@ describe('App embed tests', () => {
|
|
|
243
245
|
[Page.Home]: 'home',
|
|
244
246
|
[Page.SpotIQ]: 'home/spotiq-analysis',
|
|
245
247
|
[Page.Monitor]: 'home/monitor-alerts',
|
|
248
|
+
[Page.Collections]: 'collections',
|
|
249
|
+
[Page.LiveboardSchedules]: 'home/liveboard-schedules',
|
|
246
250
|
};
|
|
247
251
|
|
|
248
252
|
const pageIdsForModularHomes = Object.keys(pageRouteMapForModularHome);
|
|
@@ -261,7 +265,7 @@ describe('App embed tests', () => {
|
|
|
261
265
|
await executeAfterWait(() => {
|
|
262
266
|
expectUrlMatchesWithParams(
|
|
263
267
|
getIFrameSrc(),
|
|
264
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`,
|
|
268
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`,
|
|
265
269
|
);
|
|
266
270
|
cleanUp();
|
|
267
271
|
});
|
|
@@ -278,7 +282,7 @@ describe('App embed tests', () => {
|
|
|
278
282
|
await executeAfterWait(() => {
|
|
279
283
|
expectUrlMatchesWithParams(
|
|
280
284
|
getIFrameSrc(),
|
|
281
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/foo/bar`,
|
|
285
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/foo/bar`,
|
|
282
286
|
);
|
|
283
287
|
});
|
|
284
288
|
});
|
|
@@ -301,7 +305,7 @@ describe('App embed tests', () => {
|
|
|
301
305
|
await executeAfterWait(() => {
|
|
302
306
|
expectUrlMatchesWithParams(
|
|
303
307
|
getIFrameSrc(),
|
|
304
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000${defaultParams}${defaultParamsPost}#/home`,
|
|
308
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
305
309
|
);
|
|
306
310
|
});
|
|
307
311
|
});
|
|
@@ -324,7 +328,7 @@ describe('App embed tests', () => {
|
|
|
324
328
|
await executeAfterWait(() => {
|
|
325
329
|
expectUrlMatchesWithParams(
|
|
326
330
|
getIFrameSrc(),
|
|
327
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
331
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
328
332
|
);
|
|
329
333
|
});
|
|
330
334
|
});
|
|
@@ -348,7 +352,7 @@ describe('App embed tests', () => {
|
|
|
348
352
|
await executeAfterWait(() => {
|
|
349
353
|
expectUrlMatchesWithParams(
|
|
350
354
|
getIFrameSrc(),
|
|
351
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`,
|
|
355
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`,
|
|
352
356
|
);
|
|
353
357
|
});
|
|
354
358
|
});
|
|
@@ -366,7 +370,7 @@ describe('App embed tests', () => {
|
|
|
366
370
|
await executeAfterWait(() => {
|
|
367
371
|
expectUrlMatchesWithParams(
|
|
368
372
|
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`,
|
|
373
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`,
|
|
370
374
|
);
|
|
371
375
|
});
|
|
372
376
|
});
|
|
@@ -381,7 +385,22 @@ describe('App embed tests', () => {
|
|
|
381
385
|
await executeAfterWait(() => {
|
|
382
386
|
expectUrlMatchesWithParams(
|
|
383
387
|
getIFrameSrc(),
|
|
384
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`,
|
|
388
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
389
|
+
);
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
test('should set isLiveboardAlwaysOn12ColLayout to true in url', async () => {
|
|
394
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
395
|
+
...defaultViewConfig,
|
|
396
|
+
isLiveboardAlwaysOn12ColLayout: true,
|
|
397
|
+
} as AppViewConfig);
|
|
398
|
+
|
|
399
|
+
appEmbed.render();
|
|
400
|
+
await executeAfterWait(() => {
|
|
401
|
+
expectUrlMatchesWithParams(
|
|
402
|
+
getIFrameSrc(),
|
|
403
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardAlwaysOn12ColLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
385
404
|
);
|
|
386
405
|
});
|
|
387
406
|
});
|
|
@@ -395,7 +414,7 @@ describe('App embed tests', () => {
|
|
|
395
414
|
await executeAfterWait(() => {
|
|
396
415
|
expectUrlMatchesWithParams(
|
|
397
416
|
getIFrameSrc(),
|
|
398
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false${defaultParamsPost}#/home`,
|
|
417
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
399
418
|
);
|
|
400
419
|
});
|
|
401
420
|
});
|
|
@@ -409,7 +428,21 @@ describe('App embed tests', () => {
|
|
|
409
428
|
await executeAfterWait(() => {
|
|
410
429
|
expectUrlMatchesWithParams(
|
|
411
430
|
getIFrameSrc(),
|
|
412
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true${defaultParamsPost}#/home`,
|
|
431
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
432
|
+
);
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
test('should set liveboardGutter in url', async () => {
|
|
437
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
438
|
+
...defaultViewConfig,
|
|
439
|
+
liveboardGutter: 8,
|
|
440
|
+
} as AppViewConfig);
|
|
441
|
+
appEmbed.render();
|
|
442
|
+
await executeAfterWait(() => {
|
|
443
|
+
expectUrlMatchesWithParams(
|
|
444
|
+
getIFrameSrc(),
|
|
445
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&liveboardGutter=8&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
413
446
|
);
|
|
414
447
|
});
|
|
415
448
|
});
|
|
@@ -423,7 +456,7 @@ describe('App embed tests', () => {
|
|
|
423
456
|
await executeAfterWait(() => {
|
|
424
457
|
expectUrlMatchesWithParams(
|
|
425
458
|
getIFrameSrc(),
|
|
426
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true${defaultParamsPost}#/home`,
|
|
459
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
427
460
|
);
|
|
428
461
|
});
|
|
429
462
|
});
|
|
@@ -437,7 +470,7 @@ describe('App embed tests', () => {
|
|
|
437
470
|
await executeAfterWait(() => {
|
|
438
471
|
expectUrlMatchesWithParams(
|
|
439
472
|
getIFrameSrc(),
|
|
440
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true${defaultParamsPost}#/home`,
|
|
473
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
441
474
|
);
|
|
442
475
|
});
|
|
443
476
|
});
|
|
@@ -448,7 +481,7 @@ describe('App embed tests', () => {
|
|
|
448
481
|
await executeAfterWait(() => {
|
|
449
482
|
expectUrlMatchesWithParams(
|
|
450
483
|
getIFrameSrc(),
|
|
451
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false${defaultParamsPost}#/home`,
|
|
484
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
452
485
|
);
|
|
453
486
|
});
|
|
454
487
|
});
|
|
@@ -462,7 +495,7 @@ describe('App embed tests', () => {
|
|
|
462
495
|
await executeAfterWait(() => {
|
|
463
496
|
expectUrlMatchesWithParams(
|
|
464
497
|
getIFrameSrc(),
|
|
465
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`,
|
|
498
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
466
499
|
);
|
|
467
500
|
});
|
|
468
501
|
});
|
|
@@ -476,12 +509,12 @@ describe('App embed tests', () => {
|
|
|
476
509
|
await executeAfterWait(() => {
|
|
477
510
|
expectUrlMatchesWithParams(
|
|
478
511
|
getIFrameSrc(),
|
|
479
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true${defaultParamsPost}#/home`,
|
|
512
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
480
513
|
);
|
|
481
514
|
});
|
|
482
515
|
});
|
|
483
516
|
|
|
484
|
-
test('should
|
|
517
|
+
test('should not set isWYSIWYGLiveboardPDFEnabled in url by default', async () => {
|
|
485
518
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
486
519
|
...defaultViewConfig,
|
|
487
520
|
} as AppViewConfig);
|
|
@@ -489,7 +522,7 @@ describe('App embed tests', () => {
|
|
|
489
522
|
await executeAfterWait(() => {
|
|
490
523
|
expectUrlMatchesWithParams(
|
|
491
524
|
getIFrameSrc(),
|
|
492
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
525
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
493
526
|
);
|
|
494
527
|
});
|
|
495
528
|
});
|
|
@@ -503,7 +536,7 @@ describe('App embed tests', () => {
|
|
|
503
536
|
await executeAfterWait(() => {
|
|
504
537
|
expectUrlMatchesWithParams(
|
|
505
538
|
getIFrameSrc(),
|
|
506
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true${defaultParamsPost}#/home`,
|
|
539
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
507
540
|
);
|
|
508
541
|
});
|
|
509
542
|
});
|
|
@@ -517,7 +550,7 @@ describe('App embed tests', () => {
|
|
|
517
550
|
await executeAfterWait(() => {
|
|
518
551
|
expectUrlMatchesWithParams(
|
|
519
552
|
getIFrameSrc(),
|
|
520
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false${defaultParamsPost}#/home`,
|
|
553
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
521
554
|
);
|
|
522
555
|
});
|
|
523
556
|
});
|
|
@@ -530,7 +563,7 @@ describe('App embed tests', () => {
|
|
|
530
563
|
homePage: HomePage.Focused,
|
|
531
564
|
},
|
|
532
565
|
} as AppViewConfig,
|
|
533
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
566
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=true${defaultParams}${defaultParamsPost}#/home`,
|
|
534
567
|
);
|
|
535
568
|
});
|
|
536
569
|
|
|
@@ -543,7 +576,7 @@ describe('App embed tests', () => {
|
|
|
543
576
|
},
|
|
544
577
|
updatedSpotterChatPrompt: false,
|
|
545
578
|
} as AppViewConfig,
|
|
546
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
579
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=false${defaultParams}${defaultParamsPost}#/home`,
|
|
547
580
|
);
|
|
548
581
|
});
|
|
549
582
|
|
|
@@ -556,7 +589,7 @@ describe('App embed tests', () => {
|
|
|
556
589
|
await executeAfterWait(() => {
|
|
557
590
|
expectUrlMatchesWithParams(
|
|
558
591
|
getIFrameSrc(),
|
|
559
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`,
|
|
592
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
560
593
|
);
|
|
561
594
|
});
|
|
562
595
|
});
|
|
@@ -570,7 +603,7 @@ describe('App embed tests', () => {
|
|
|
570
603
|
await executeAfterWait(() => {
|
|
571
604
|
expectUrlMatchesWithParams(
|
|
572
605
|
getIFrameSrc(),
|
|
573
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true${defaultParamsPost}#/home`,
|
|
606
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
574
607
|
);
|
|
575
608
|
});
|
|
576
609
|
});
|
|
@@ -584,7 +617,62 @@ describe('App embed tests', () => {
|
|
|
584
617
|
await executeAfterWait(() => {
|
|
585
618
|
expectUrlMatchesWithParams(
|
|
586
619
|
getIFrameSrc(),
|
|
587
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false${defaultParamsPost}#/home`,
|
|
620
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
621
|
+
);
|
|
622
|
+
});
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
test('should set showSpotterRadiance to true in url', async () => {
|
|
626
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
627
|
+
...defaultViewConfig,
|
|
628
|
+
showSpotterRadiance: true,
|
|
629
|
+
} as AppViewConfig);
|
|
630
|
+
appEmbed.render();
|
|
631
|
+
await executeAfterWait(() => {
|
|
632
|
+
expectUrlMatchesWithParams(
|
|
633
|
+
getIFrameSrc(),
|
|
634
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=true${defaultParamsPost}#/home`,
|
|
635
|
+
);
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
test('should set showSpotterRadiance to false in url', async () => {
|
|
640
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
641
|
+
...defaultViewConfig,
|
|
642
|
+
showSpotterRadiance: false,
|
|
643
|
+
} as AppViewConfig);
|
|
644
|
+
appEmbed.render();
|
|
645
|
+
await executeAfterWait(() => {
|
|
646
|
+
expectUrlMatchesWithParams(
|
|
647
|
+
getIFrameSrc(),
|
|
648
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=false${defaultParamsPost}#/home`,
|
|
649
|
+
);
|
|
650
|
+
});
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
test('should set defaultQueryMode to research in url', async () => {
|
|
654
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
655
|
+
...defaultViewConfig,
|
|
656
|
+
defaultQueryMode: SpotterQueryMode.RESEARCH,
|
|
657
|
+
} as AppViewConfig);
|
|
658
|
+
appEmbed.render();
|
|
659
|
+
await executeAfterWait(() => {
|
|
660
|
+
expectUrlMatchesWithParams(
|
|
661
|
+
getIFrameSrc(),
|
|
662
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&defaultQueryMode=research${defaultParamsPost}#/home`,
|
|
663
|
+
);
|
|
664
|
+
});
|
|
665
|
+
});
|
|
666
|
+
|
|
667
|
+
test('should not set defaultQueryMode in url when unset', async () => {
|
|
668
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
669
|
+
...defaultViewConfig,
|
|
670
|
+
} as AppViewConfig);
|
|
671
|
+
appEmbed.render();
|
|
672
|
+
await executeAfterWait(() => {
|
|
673
|
+
expectUrlMatchesWithParams(
|
|
674
|
+
getIFrameSrc(),
|
|
675
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false${defaultParamsPost}#/home`,
|
|
588
676
|
);
|
|
589
677
|
});
|
|
590
678
|
});
|
|
@@ -600,11 +688,46 @@ describe('App embed tests', () => {
|
|
|
600
688
|
await executeAfterWait(() => {
|
|
601
689
|
expectUrlMatchesWithParams(
|
|
602
690
|
getIFrameSrc(),
|
|
603
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true${defaultParamsPost}#/home`,
|
|
691
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
692
|
+
);
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
test('should set spotterDataSources to a list of Model GUIDs in url', async () => {
|
|
697
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
698
|
+
...defaultViewConfig,
|
|
699
|
+
spotterDataSources: ['model-guid-123', 'model-guid-456'],
|
|
700
|
+
} as AppViewConfig);
|
|
701
|
+
appEmbed.render();
|
|
702
|
+
await executeAfterWait(() => {
|
|
703
|
+
expectUrlMatchesWithParams(
|
|
704
|
+
getIFrameSrc(),
|
|
705
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterDataSources=${encodeURIComponent(JSON.stringify(['model-guid-123', 'model-guid-456']))}${defaultParamsPost}#/home`,
|
|
604
706
|
);
|
|
605
707
|
});
|
|
606
708
|
});
|
|
607
709
|
|
|
710
|
+
test('should not add spotterDataSources to url when not provided', async () => {
|
|
711
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
712
|
+
...defaultViewConfig,
|
|
713
|
+
} as AppViewConfig);
|
|
714
|
+
appEmbed.render();
|
|
715
|
+
await executeAfterWait(() => {
|
|
716
|
+
expect(getIFrameSrc()).not.toContain('spotterDataSources');
|
|
717
|
+
});
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
test('should not add spotterDataSources to url when empty array', async () => {
|
|
721
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
722
|
+
...defaultViewConfig,
|
|
723
|
+
spotterDataSources: [],
|
|
724
|
+
} as AppViewConfig);
|
|
725
|
+
appEmbed.render();
|
|
726
|
+
await executeAfterWait(() => {
|
|
727
|
+
expect(getIFrameSrc()).not.toContain('spotterDataSources');
|
|
728
|
+
});
|
|
729
|
+
});
|
|
730
|
+
|
|
608
731
|
test('should include spotterVizConfig in APP_INIT embedParams when spotterViz is provided', async () => {
|
|
609
732
|
const spotterViz = {
|
|
610
733
|
brandName: 'MyBrand',
|
|
@@ -649,6 +772,40 @@ describe('App embed tests', () => {
|
|
|
649
772
|
});
|
|
650
773
|
});
|
|
651
774
|
|
|
775
|
+
test('should include starterPrompts in APP_INIT embedParams', async () => {
|
|
776
|
+
const starterPrompts = {
|
|
777
|
+
enable: true,
|
|
778
|
+
quick: {
|
|
779
|
+
label: 'Quick',
|
|
780
|
+
questions: [
|
|
781
|
+
{ label: 'Q1', prompt: 'P1' },
|
|
782
|
+
{ label: 'Q2', prompt: 'P2' },
|
|
783
|
+
],
|
|
784
|
+
},
|
|
785
|
+
research: { label: 'Research' },
|
|
786
|
+
};
|
|
787
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
788
|
+
...defaultViewConfig,
|
|
789
|
+
spotterChatConfig: { starterPrompts },
|
|
790
|
+
} as AppViewConfig);
|
|
791
|
+
|
|
792
|
+
mockMessageChannel();
|
|
793
|
+
appEmbed.render();
|
|
794
|
+
|
|
795
|
+
const mockPort: any = { postMessage: jest.fn() };
|
|
796
|
+
await executeAfterWait(() => {
|
|
797
|
+
postMessageToParent(
|
|
798
|
+
getIFrameEl().contentWindow,
|
|
799
|
+
{ type: EmbedEvent.APP_INIT, data: {} },
|
|
800
|
+
mockPort,
|
|
801
|
+
);
|
|
802
|
+
});
|
|
803
|
+
await executeAfterWait(() => {
|
|
804
|
+
expect(mockPort.postMessage.mock.calls[0][0].data.embedParams.starterPrompts)
|
|
805
|
+
.toEqual(starterPrompts);
|
|
806
|
+
});
|
|
807
|
+
});
|
|
808
|
+
|
|
652
809
|
test('should pass brandHeadline through spotterVizConfig in APP_INIT', async () => {
|
|
653
810
|
const spotterViz = { brandName: 'MyBrand', brandHeadline: "Hi, there! I'm" };
|
|
654
811
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
@@ -740,6 +897,104 @@ describe('App embed tests', () => {
|
|
|
740
897
|
});
|
|
741
898
|
});
|
|
742
899
|
|
|
900
|
+
test('should forward spotterChatPinConfig nested in spotterSidebarConfig in APP_INIT', async () => {
|
|
901
|
+
const spotterChatPinConfig = {
|
|
902
|
+
enabled: true,
|
|
903
|
+
pinLabel: 'Pin to top',
|
|
904
|
+
unpinLabel: 'Unpin',
|
|
905
|
+
};
|
|
906
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
907
|
+
...defaultViewConfig,
|
|
908
|
+
spotterSidebarConfig: {
|
|
909
|
+
enablePastConversationsSidebar: true,
|
|
910
|
+
spotterChatPinConfig,
|
|
911
|
+
},
|
|
912
|
+
} as AppViewConfig);
|
|
913
|
+
|
|
914
|
+
mockMessageChannel();
|
|
915
|
+
appEmbed.render();
|
|
916
|
+
|
|
917
|
+
const mockPort: any = { postMessage: jest.fn() };
|
|
918
|
+
await executeAfterWait(() => {
|
|
919
|
+
postMessageToParent(
|
|
920
|
+
getIFrameEl().contentWindow,
|
|
921
|
+
{ type: EmbedEvent.APP_INIT, data: {} },
|
|
922
|
+
mockPort,
|
|
923
|
+
);
|
|
924
|
+
});
|
|
925
|
+
await executeAfterWait(() => {
|
|
926
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
927
|
+
type: EmbedEvent.APP_INIT,
|
|
928
|
+
data: expect.objectContaining({
|
|
929
|
+
embedParams: expect.objectContaining({
|
|
930
|
+
spotterSidebarConfig: expect.objectContaining({
|
|
931
|
+
spotterChatPinConfig,
|
|
932
|
+
}),
|
|
933
|
+
}),
|
|
934
|
+
}),
|
|
935
|
+
});
|
|
936
|
+
});
|
|
937
|
+
});
|
|
938
|
+
|
|
939
|
+
test('should include spotterShareConversationConfig in APP_INIT embedParams when provided', async () => {
|
|
940
|
+
const spotterShareConversationConfig = {
|
|
941
|
+
enableShareConversation: true,
|
|
942
|
+
spotterShareLabel: 'Share',
|
|
943
|
+
spotterShareModalTitle: 'Share conversation',
|
|
944
|
+
};
|
|
945
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
946
|
+
...defaultViewConfig,
|
|
947
|
+
spotterShareConversationConfig,
|
|
948
|
+
} as AppViewConfig);
|
|
949
|
+
|
|
950
|
+
mockMessageChannel();
|
|
951
|
+
appEmbed.render();
|
|
952
|
+
|
|
953
|
+
const mockPort: any = { postMessage: jest.fn() };
|
|
954
|
+
await executeAfterWait(() => {
|
|
955
|
+
postMessageToParent(
|
|
956
|
+
getIFrameEl().contentWindow,
|
|
957
|
+
{ type: EmbedEvent.APP_INIT, data: {} },
|
|
958
|
+
mockPort,
|
|
959
|
+
);
|
|
960
|
+
});
|
|
961
|
+
await executeAfterWait(() => {
|
|
962
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
963
|
+
type: EmbedEvent.APP_INIT,
|
|
964
|
+
data: expect.objectContaining({
|
|
965
|
+
embedParams: expect.objectContaining({
|
|
966
|
+
spotterShareConversationConfig,
|
|
967
|
+
}),
|
|
968
|
+
}),
|
|
969
|
+
});
|
|
970
|
+
});
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
test('should not include spotterShareConversationConfig in APP_INIT when not provided', async () => {
|
|
974
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
975
|
+
...defaultViewConfig,
|
|
976
|
+
} as AppViewConfig);
|
|
977
|
+
|
|
978
|
+
mockMessageChannel();
|
|
979
|
+
appEmbed.render();
|
|
980
|
+
|
|
981
|
+
const mockPort: any = { postMessage: jest.fn() };
|
|
982
|
+
await executeAfterWait(() => {
|
|
983
|
+
postMessageToParent(
|
|
984
|
+
getIFrameEl().contentWindow,
|
|
985
|
+
{ type: EmbedEvent.APP_INIT, data: {} },
|
|
986
|
+
mockPort,
|
|
987
|
+
);
|
|
988
|
+
});
|
|
989
|
+
await executeAfterWait(() => {
|
|
990
|
+
const callArgs = mockPort.postMessage.mock.calls[0][0];
|
|
991
|
+
expect(callArgs.type).toBe(EmbedEvent.APP_INIT);
|
|
992
|
+
if (callArgs.data.embedParams) {
|
|
993
|
+
expect(callArgs.data.embedParams.spotterShareConversationConfig).toBeUndefined();
|
|
994
|
+
}
|
|
995
|
+
});
|
|
996
|
+
});
|
|
997
|
+
|
|
743
998
|
test('should set toolResponseCardBrandingLabel in url via spotterChatConfig', async () => {
|
|
744
999
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
745
1000
|
...defaultViewConfig,
|
|
@@ -751,7 +1006,7 @@ describe('App embed tests', () => {
|
|
|
751
1006
|
await executeAfterWait(() => {
|
|
752
1007
|
expectUrlMatchesWithParams(
|
|
753
1008
|
getIFrameSrc(),
|
|
754
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand${defaultParamsPost}#/home`,
|
|
1009
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
755
1010
|
);
|
|
756
1011
|
});
|
|
757
1012
|
});
|
|
@@ -765,7 +1020,7 @@ describe('App embed tests', () => {
|
|
|
765
1020
|
await executeAfterWait(() => {
|
|
766
1021
|
expectUrlMatchesWithParams(
|
|
767
1022
|
getIFrameSrc(),
|
|
768
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true${defaultParamsPost}#/home`,
|
|
1023
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
769
1024
|
);
|
|
770
1025
|
});
|
|
771
1026
|
});
|
|
@@ -779,11 +1034,48 @@ describe('App embed tests', () => {
|
|
|
779
1034
|
await executeAfterWait(() => {
|
|
780
1035
|
expectUrlMatchesWithParams(
|
|
781
1036
|
getIFrameSrc(),
|
|
782
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true${defaultParamsPost}#/home`,
|
|
1037
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
783
1038
|
);
|
|
784
1039
|
});
|
|
785
1040
|
});
|
|
786
1041
|
|
|
1042
|
+
test('should set openSpotterOnLiveboardByDefault to true in url', async () => {
|
|
1043
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1044
|
+
...defaultViewConfig,
|
|
1045
|
+
spotterChatConfig: { openSpotterOnLiveboardByDefault: true },
|
|
1046
|
+
} as AppViewConfig);
|
|
1047
|
+
appEmbed.render();
|
|
1048
|
+
await executeAfterWait(() => {
|
|
1049
|
+
expectUrlToHaveParamsWithValues(getIFrameSrc(), {
|
|
1050
|
+
openSpotterOnLiveboardByDefault: 'true',
|
|
1051
|
+
});
|
|
1052
|
+
});
|
|
1053
|
+
});
|
|
1054
|
+
|
|
1055
|
+
test('should set openSpotterOnLiveboardByDefault to false when explicitly disabled', async () => {
|
|
1056
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1057
|
+
...defaultViewConfig,
|
|
1058
|
+
spotterChatConfig: { openSpotterOnLiveboardByDefault: false },
|
|
1059
|
+
} as AppViewConfig);
|
|
1060
|
+
appEmbed.render();
|
|
1061
|
+
await executeAfterWait(() => {
|
|
1062
|
+
expectUrlToHaveParamsWithValues(getIFrameSrc(), {
|
|
1063
|
+
openSpotterOnLiveboardByDefault: 'false',
|
|
1064
|
+
});
|
|
1065
|
+
});
|
|
1066
|
+
});
|
|
1067
|
+
|
|
1068
|
+
test('should not set openSpotterOnLiveboardByDefault when it is not configured', async () => {
|
|
1069
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1070
|
+
...defaultViewConfig,
|
|
1071
|
+
spotterChatConfig: { enableStarterPrompts: true },
|
|
1072
|
+
} as AppViewConfig);
|
|
1073
|
+
appEmbed.render();
|
|
1074
|
+
await executeAfterWait(() => {
|
|
1075
|
+
expect(getIFrameSrc()).not.toContain('openSpotterOnLiveboardByDefault');
|
|
1076
|
+
});
|
|
1077
|
+
});
|
|
1078
|
+
|
|
787
1079
|
test('should set spotterFileUploadFileTypes in url', async () => {
|
|
788
1080
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
789
1081
|
...defaultViewConfig,
|
|
@@ -806,7 +1098,7 @@ describe('App embed tests', () => {
|
|
|
806
1098
|
await executeAfterWait(() => {
|
|
807
1099
|
expectUrlMatchesWithParams(
|
|
808
1100
|
getIFrameSrc(),
|
|
809
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false${defaultParamsPost}#/home`,
|
|
1101
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
810
1102
|
);
|
|
811
1103
|
});
|
|
812
1104
|
});
|
|
@@ -820,7 +1112,7 @@ describe('App embed tests', () => {
|
|
|
820
1112
|
await executeAfterWait(() => {
|
|
821
1113
|
expectUrlMatchesWithParams(
|
|
822
1114
|
getIFrameSrc(),
|
|
823
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true${defaultParamsPost}#/home`,
|
|
1115
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
824
1116
|
);
|
|
825
1117
|
});
|
|
826
1118
|
});
|
|
@@ -834,7 +1126,7 @@ describe('App embed tests', () => {
|
|
|
834
1126
|
await executeAfterWait(() => {
|
|
835
1127
|
expectUrlMatchesWithParams(
|
|
836
1128
|
getIFrameSrc(),
|
|
837
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false${defaultParamsPost}#/home`,
|
|
1129
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
838
1130
|
);
|
|
839
1131
|
});
|
|
840
1132
|
});
|
|
@@ -848,7 +1140,7 @@ describe('App embed tests', () => {
|
|
|
848
1140
|
await executeAfterWait(() => {
|
|
849
1141
|
expectUrlMatchesWithParams(
|
|
850
1142
|
getIFrameSrc(),
|
|
851
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true${defaultParamsPost}#/home`,
|
|
1143
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
852
1144
|
);
|
|
853
1145
|
});
|
|
854
1146
|
});
|
|
@@ -862,162 +1154,185 @@ describe('App embed tests', () => {
|
|
|
862
1154
|
await executeAfterWait(() => {
|
|
863
1155
|
expectUrlMatchesWithParams(
|
|
864
1156
|
getIFrameSrc(),
|
|
865
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false${defaultParamsPost}#/home`,
|
|
1157
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
866
1158
|
);
|
|
867
1159
|
});
|
|
868
1160
|
});
|
|
869
1161
|
|
|
870
|
-
test('
|
|
1162
|
+
test('should set isScopedLiveboardFilteringEnabled to true in url', async () => {
|
|
871
1163
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
872
1164
|
...defaultViewConfig,
|
|
873
|
-
|
|
874
|
-
tag: 'Finance',
|
|
1165
|
+
isScopedLiveboardFilteringEnabled: true,
|
|
875
1166
|
} as AppViewConfig);
|
|
876
|
-
|
|
877
1167
|
appEmbed.render();
|
|
878
1168
|
await executeAfterWait(() => {
|
|
879
1169
|
expectUrlMatchesWithParams(
|
|
880
1170
|
getIFrameSrc(),
|
|
881
|
-
`http://${thoughtSpotHost}/?embedApp=true&
|
|
1171
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=true${defaultParamsPost}#/home`,
|
|
882
1172
|
);
|
|
883
1173
|
});
|
|
884
1174
|
});
|
|
885
1175
|
|
|
886
|
-
test('
|
|
1176
|
+
test('should set isScopedLiveboardFilteringEnabled to false in url', async () => {
|
|
887
1177
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
888
1178
|
...defaultViewConfig,
|
|
889
|
-
|
|
890
|
-
hideTagFilterChips: true,
|
|
1179
|
+
isScopedLiveboardFilteringEnabled: false,
|
|
891
1180
|
} as AppViewConfig);
|
|
892
|
-
|
|
893
1181
|
appEmbed.render();
|
|
894
1182
|
await executeAfterWait(() => {
|
|
895
1183
|
expectUrlMatchesWithParams(
|
|
896
1184
|
getIFrameSrc(),
|
|
897
|
-
`http://${thoughtSpotHost}/?embedApp=true&
|
|
1185
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=false${defaultParamsPost}#/home`,
|
|
898
1186
|
);
|
|
899
1187
|
});
|
|
900
1188
|
});
|
|
901
1189
|
|
|
902
|
-
test('
|
|
1190
|
+
test('should not set isScopedLiveboardFilteringEnabled in url when undefined', async () => {
|
|
903
1191
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
904
1192
|
...defaultViewConfig,
|
|
905
|
-
showPrimaryNavbar: false,
|
|
906
|
-
hideTagFilterChips: false,
|
|
907
1193
|
} as AppViewConfig);
|
|
908
1194
|
appEmbed.render();
|
|
909
1195
|
await executeAfterWait(() => {
|
|
910
|
-
|
|
911
|
-
getIFrameSrc(),
|
|
912
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`,
|
|
913
|
-
);
|
|
1196
|
+
expect(getIFrameSrc()).not.toContain('isScopedLiveboardFilteringEnabled');
|
|
914
1197
|
});
|
|
915
1198
|
});
|
|
916
1199
|
|
|
917
|
-
test('Should
|
|
1200
|
+
test('Should add the tag to the iframe src', async () => {
|
|
918
1201
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
919
1202
|
...defaultViewConfig,
|
|
920
1203
|
showPrimaryNavbar: false,
|
|
1204
|
+
tag: 'Finance',
|
|
921
1205
|
} as AppViewConfig);
|
|
1206
|
+
|
|
922
1207
|
appEmbed.render();
|
|
923
1208
|
await executeAfterWait(() => {
|
|
924
1209
|
expectUrlMatchesWithParams(
|
|
925
1210
|
getIFrameSrc(),
|
|
926
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1211
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&tag=Finance${defaultParamsPost}#/home`,
|
|
927
1212
|
);
|
|
928
1213
|
});
|
|
929
1214
|
});
|
|
930
1215
|
|
|
931
|
-
test('Should add
|
|
1216
|
+
test('Should add the hideTagFilterChips true to the iframe src', async () => {
|
|
932
1217
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
933
1218
|
...defaultViewConfig,
|
|
934
1219
|
showPrimaryNavbar: false,
|
|
935
|
-
|
|
1220
|
+
hideTagFilterChips: true,
|
|
936
1221
|
} as AppViewConfig);
|
|
937
1222
|
|
|
938
1223
|
appEmbed.render();
|
|
939
1224
|
await executeAfterWait(() => {
|
|
940
1225
|
expectUrlMatchesWithParams(
|
|
941
1226
|
getIFrameSrc(),
|
|
942
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1227
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`,
|
|
943
1228
|
);
|
|
944
1229
|
});
|
|
945
1230
|
});
|
|
946
1231
|
|
|
947
|
-
test('Should add
|
|
1232
|
+
test('Should add the hideTagFilterChips false to the iframe src', async () => {
|
|
948
1233
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
949
1234
|
...defaultViewConfig,
|
|
950
1235
|
showPrimaryNavbar: false,
|
|
951
|
-
|
|
1236
|
+
hideTagFilterChips: false,
|
|
952
1237
|
} as AppViewConfig);
|
|
953
|
-
|
|
954
1238
|
appEmbed.render();
|
|
955
1239
|
await executeAfterWait(() => {
|
|
956
1240
|
expectUrlMatchesWithParams(
|
|
957
1241
|
getIFrameSrc(),
|
|
958
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1242
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`,
|
|
959
1243
|
);
|
|
960
1244
|
});
|
|
961
1245
|
});
|
|
962
1246
|
|
|
963
|
-
test('Should add
|
|
1247
|
+
test('Should not add hideTagFilterChips if it is undefined', async () => {
|
|
964
1248
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
965
1249
|
...defaultViewConfig,
|
|
966
1250
|
showPrimaryNavbar: false,
|
|
967
1251
|
} as AppViewConfig);
|
|
1252
|
+
appEmbed.render();
|
|
1253
|
+
await executeAfterWait(() => {
|
|
1254
|
+
expectUrlMatchesWithParams(
|
|
1255
|
+
getIFrameSrc(),
|
|
1256
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1257
|
+
);
|
|
1258
|
+
});
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
test('Should add showMaskedFilterChip true to the iframe src', async () => {
|
|
1262
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1263
|
+
...defaultViewConfig,
|
|
1264
|
+
showPrimaryNavbar: false,
|
|
1265
|
+
showMaskedFilterChip: true,
|
|
1266
|
+
} as AppViewConfig);
|
|
968
1267
|
|
|
969
1268
|
appEmbed.render();
|
|
970
1269
|
await executeAfterWait(() => {
|
|
971
1270
|
expectUrlMatchesWithParams(
|
|
972
1271
|
getIFrameSrc(),
|
|
973
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=
|
|
1272
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
974
1273
|
);
|
|
975
1274
|
});
|
|
976
1275
|
});
|
|
977
1276
|
|
|
978
|
-
test('Should add
|
|
1277
|
+
test('Should add showMaskedFilterChip false to the iframe src', async () => {
|
|
979
1278
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
980
1279
|
...defaultViewConfig,
|
|
981
1280
|
showPrimaryNavbar: false,
|
|
982
|
-
|
|
1281
|
+
showMaskedFilterChip: false,
|
|
983
1282
|
} as AppViewConfig);
|
|
984
1283
|
|
|
985
1284
|
appEmbed.render();
|
|
986
1285
|
await executeAfterWait(() => {
|
|
987
1286
|
expectUrlMatchesWithParams(
|
|
988
1287
|
getIFrameSrc(),
|
|
989
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1288
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
990
1289
|
);
|
|
991
1290
|
});
|
|
992
1291
|
});
|
|
993
1292
|
|
|
994
|
-
test('Should add
|
|
1293
|
+
test('Should add default showMaskedFilterChip false when not specified', async () => {
|
|
995
1294
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
996
1295
|
...defaultViewConfig,
|
|
997
1296
|
showPrimaryNavbar: false,
|
|
998
|
-
isLiveboardMasterpiecesEnabled: false,
|
|
999
1297
|
} as AppViewConfig);
|
|
1000
1298
|
|
|
1001
1299
|
appEmbed.render();
|
|
1002
1300
|
await executeAfterWait(() => {
|
|
1003
1301
|
expectUrlMatchesWithParams(
|
|
1004
1302
|
getIFrameSrc(),
|
|
1005
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1303
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1304
|
+
);
|
|
1305
|
+
});
|
|
1306
|
+
});
|
|
1307
|
+
|
|
1308
|
+
test('Should add isLiveboardMasterpiecesEnabled true to the iframe src', async () => {
|
|
1309
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1310
|
+
...defaultViewConfig,
|
|
1311
|
+
showPrimaryNavbar: false,
|
|
1312
|
+
isLiveboardMasterpiecesEnabled: true,
|
|
1313
|
+
} as AppViewConfig);
|
|
1314
|
+
|
|
1315
|
+
appEmbed.render();
|
|
1316
|
+
await executeAfterWait(() => {
|
|
1317
|
+
expectUrlMatchesWithParams(
|
|
1318
|
+
getIFrameSrc(),
|
|
1319
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1006
1320
|
);
|
|
1007
1321
|
});
|
|
1008
1322
|
});
|
|
1009
1323
|
|
|
1010
|
-
test('Should add
|
|
1324
|
+
test('Should add isLiveboardMasterpiecesEnabled false to the iframe src', async () => {
|
|
1011
1325
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1012
1326
|
...defaultViewConfig,
|
|
1013
1327
|
showPrimaryNavbar: false,
|
|
1328
|
+
isLiveboardMasterpiecesEnabled: false,
|
|
1014
1329
|
} as AppViewConfig);
|
|
1015
1330
|
|
|
1016
1331
|
appEmbed.render();
|
|
1017
1332
|
await executeAfterWait(() => {
|
|
1018
1333
|
expectUrlMatchesWithParams(
|
|
1019
1334
|
getIFrameSrc(),
|
|
1020
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1335
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1021
1336
|
);
|
|
1022
1337
|
});
|
|
1023
1338
|
});
|
|
@@ -1033,7 +1348,7 @@ describe('App embed tests', () => {
|
|
|
1033
1348
|
await executeAfterWait(() => {
|
|
1034
1349
|
expectUrlMatchesWithParams(
|
|
1035
1350
|
getIFrameSrc(),
|
|
1036
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1351
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1037
1352
|
);
|
|
1038
1353
|
});
|
|
1039
1354
|
});
|
|
@@ -1049,7 +1364,7 @@ describe('App embed tests', () => {
|
|
|
1049
1364
|
await executeAfterWait(() => {
|
|
1050
1365
|
expectUrlMatchesWithParams(
|
|
1051
1366
|
getIFrameSrc(),
|
|
1052
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1367
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1053
1368
|
);
|
|
1054
1369
|
});
|
|
1055
1370
|
});
|
|
@@ -1064,7 +1379,7 @@ describe('App embed tests', () => {
|
|
|
1064
1379
|
await executeAfterWait(() => {
|
|
1065
1380
|
expectUrlMatchesWithParams(
|
|
1066
1381
|
getIFrameSrc(),
|
|
1067
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1382
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1068
1383
|
);
|
|
1069
1384
|
});
|
|
1070
1385
|
});
|
|
@@ -1079,7 +1394,7 @@ describe('App embed tests', () => {
|
|
|
1079
1394
|
await executeAfterWait(() => {
|
|
1080
1395
|
expectUrlMatchesWithParams(
|
|
1081
1396
|
getIFrameSrc(),
|
|
1082
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1397
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1083
1398
|
);
|
|
1084
1399
|
});
|
|
1085
1400
|
});
|
|
@@ -1094,7 +1409,7 @@ describe('App embed tests', () => {
|
|
|
1094
1409
|
await executeAfterWait(() => {
|
|
1095
1410
|
expectUrlMatchesWithParams(
|
|
1096
1411
|
getIFrameSrc(),
|
|
1097
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1412
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1098
1413
|
);
|
|
1099
1414
|
});
|
|
1100
1415
|
});
|
|
@@ -1109,7 +1424,7 @@ describe('App embed tests', () => {
|
|
|
1109
1424
|
await executeAfterWait(() => {
|
|
1110
1425
|
expectUrlMatchesWithParams(
|
|
1111
1426
|
getIFrameSrc(),
|
|
1112
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1427
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1113
1428
|
);
|
|
1114
1429
|
});
|
|
1115
1430
|
});
|
|
@@ -1124,7 +1439,7 @@ describe('App embed tests', () => {
|
|
|
1124
1439
|
await executeAfterWait(() => {
|
|
1125
1440
|
expectUrlMatchesWithParams(
|
|
1126
1441
|
getIFrameSrc(),
|
|
1127
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1442
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1128
1443
|
);
|
|
1129
1444
|
});
|
|
1130
1445
|
});
|
|
@@ -1139,7 +1454,7 @@ describe('App embed tests', () => {
|
|
|
1139
1454
|
await executeAfterWait(() => {
|
|
1140
1455
|
expectUrlMatchesWithParams(
|
|
1141
1456
|
getIFrameSrc(),
|
|
1142
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1457
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1143
1458
|
);
|
|
1144
1459
|
});
|
|
1145
1460
|
});
|
|
@@ -1155,7 +1470,7 @@ describe('App embed tests', () => {
|
|
|
1155
1470
|
await executeAfterWait(() => {
|
|
1156
1471
|
expectUrlMatchesWithParams(
|
|
1157
1472
|
getIFrameSrc(),
|
|
1158
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1473
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1159
1474
|
);
|
|
1160
1475
|
});
|
|
1161
1476
|
appEmbedTrue.destroy();
|
|
@@ -1170,7 +1485,7 @@ describe('App embed tests', () => {
|
|
|
1170
1485
|
await executeAfterWait(() => {
|
|
1171
1486
|
expectUrlMatchesWithParams(
|
|
1172
1487
|
getIFrameSrc(),
|
|
1173
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1488
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1174
1489
|
);
|
|
1175
1490
|
});
|
|
1176
1491
|
appEmbedFalse.destroy();
|
|
@@ -1184,7 +1499,7 @@ describe('App embed tests', () => {
|
|
|
1184
1499
|
await executeAfterWait(() => {
|
|
1185
1500
|
expectUrlMatchesWithParams(
|
|
1186
1501
|
getIFrameSrc(),
|
|
1187
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1502
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1188
1503
|
);
|
|
1189
1504
|
});
|
|
1190
1505
|
});
|
|
@@ -1240,7 +1555,7 @@ describe('App embed tests', () => {
|
|
|
1240
1555
|
await executeAfterWait(() => {
|
|
1241
1556
|
expectUrlMatchesWithParams(
|
|
1242
1557
|
getIFrameSrc(),
|
|
1243
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1558
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1244
1559
|
);
|
|
1245
1560
|
});
|
|
1246
1561
|
});
|
|
@@ -1255,7 +1570,7 @@ describe('App embed tests', () => {
|
|
|
1255
1570
|
await executeAfterWait(() => {
|
|
1256
1571
|
expectUrlMatchesWithParams(
|
|
1257
1572
|
getIFrameSrc(),
|
|
1258
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1573
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1259
1574
|
);
|
|
1260
1575
|
});
|
|
1261
1576
|
});
|
|
@@ -1269,7 +1584,7 @@ describe('App embed tests', () => {
|
|
|
1269
1584
|
await executeAfterWait(() => {
|
|
1270
1585
|
expectUrlMatchesWithParams(
|
|
1271
1586
|
getIFrameSrc(),
|
|
1272
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
1587
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1273
1588
|
);
|
|
1274
1589
|
});
|
|
1275
1590
|
});
|
|
@@ -1283,7 +1598,7 @@ describe('App embed tests', () => {
|
|
|
1283
1598
|
await executeAfterWait(() => {
|
|
1284
1599
|
expectUrlMatchesWithParams(
|
|
1285
1600
|
getIFrameSrc(),
|
|
1286
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1601
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1287
1602
|
);
|
|
1288
1603
|
});
|
|
1289
1604
|
});
|
|
@@ -1298,7 +1613,7 @@ describe('App embed tests', () => {
|
|
|
1298
1613
|
await executeAfterWait(() => {
|
|
1299
1614
|
expectUrlMatchesWithParams(
|
|
1300
1615
|
getIFrameSrc(),
|
|
1301
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`,
|
|
1616
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1302
1617
|
);
|
|
1303
1618
|
});
|
|
1304
1619
|
});
|
|
@@ -1313,7 +1628,7 @@ describe('App embed tests', () => {
|
|
|
1313
1628
|
await executeAfterWait(() => {
|
|
1314
1629
|
expectUrlMatchesWithParams(
|
|
1315
1630
|
getIFrameSrc(),
|
|
1316
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1631
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHomepageLeftNav=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1317
1632
|
);
|
|
1318
1633
|
});
|
|
1319
1634
|
});
|
|
@@ -1330,7 +1645,7 @@ describe('App embed tests', () => {
|
|
|
1330
1645
|
await executeAfterWait(() => {
|
|
1331
1646
|
expectUrlMatchesWithParams(
|
|
1332
1647
|
getIFrameSrc(),
|
|
1333
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1648
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1334
1649
|
);
|
|
1335
1650
|
});
|
|
1336
1651
|
});
|
|
@@ -1347,93 +1662,18 @@ describe('App embed tests', () => {
|
|
|
1347
1662
|
await executeAfterWait(() => {
|
|
1348
1663
|
expectUrlMatchesWithParams(
|
|
1349
1664
|
getIFrameSrc(),
|
|
1350
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1665
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1351
1666
|
);
|
|
1352
1667
|
});
|
|
1353
1668
|
});
|
|
1354
1669
|
|
|
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
1670
|
test('Should add enableAskSage flag to the iframe src', async () => {
|
|
1431
1671
|
await testUrlParams(
|
|
1432
1672
|
{
|
|
1433
1673
|
...defaultViewConfig,
|
|
1434
1674
|
enableAskSage: true,
|
|
1435
1675
|
} as AppViewConfig,
|
|
1436
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1676
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableAskSage=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1437
1677
|
);
|
|
1438
1678
|
});
|
|
1439
1679
|
|
|
@@ -1445,30 +1685,28 @@ describe('App embed tests', () => {
|
|
|
1445
1685
|
listPageVersion: ListPage.ListWithUXChanges,
|
|
1446
1686
|
},
|
|
1447
1687
|
} as AppViewConfig,
|
|
1448
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1688
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&listpageVersion=v3&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1449
1689
|
);
|
|
1450
1690
|
});
|
|
1451
1691
|
|
|
1452
|
-
test('Should
|
|
1692
|
+
test('Should send navigationVersion=v3 & homepageVersion=v3 by default when no discoveryExperience is provided', async () => {
|
|
1453
1693
|
await testUrlParams(
|
|
1454
1694
|
{
|
|
1455
1695
|
...defaultViewConfig,
|
|
1456
1696
|
} as AppViewConfig,
|
|
1457
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1697
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1458
1698
|
);
|
|
1459
1699
|
});
|
|
1460
1700
|
|
|
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
|
-
);
|
|
1701
|
+
test('Should not send modularHomeExperience param by default when not specified', async () => {
|
|
1702
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1703
|
+
...defaultViewConfig,
|
|
1704
|
+
} as AppViewConfig);
|
|
1705
|
+
appEmbed.render();
|
|
1706
|
+
await executeAfterWait(() => {
|
|
1707
|
+
const url = new URL(getIFrameSrc());
|
|
1708
|
+
expect(url.searchParams.has('modularHomeExperience')).toBe(false);
|
|
1709
|
+
});
|
|
1472
1710
|
});
|
|
1473
1711
|
|
|
1474
1712
|
|
|
@@ -1477,12 +1715,10 @@ describe('App embed tests', () => {
|
|
|
1477
1715
|
{
|
|
1478
1716
|
...defaultViewConfig,
|
|
1479
1717
|
discoveryExperience: {
|
|
1480
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
1481
|
-
homePage: HomePage.Modular,
|
|
1482
1718
|
listPageVersion: ListPage.ListWithUXChanges,
|
|
1483
1719
|
},
|
|
1484
1720
|
} as AppViewConfig,
|
|
1485
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1721
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`
|
|
1486
1722
|
);
|
|
1487
1723
|
});
|
|
1488
1724
|
|
|
@@ -1495,7 +1731,7 @@ describe('App embed tests', () => {
|
|
|
1495
1731
|
await executeAfterWait(() => {
|
|
1496
1732
|
expectUrlMatchesWithParams(
|
|
1497
1733
|
getIFrameSrc(),
|
|
1498
|
-
`http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1734
|
+
`http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1499
1735
|
);
|
|
1500
1736
|
});
|
|
1501
1737
|
|
|
@@ -1508,7 +1744,7 @@ describe('App embed tests', () => {
|
|
|
1508
1744
|
await executeAfterWait(() => {
|
|
1509
1745
|
expectUrlMatchesWithParams(
|
|
1510
1746
|
getIFrameSrc(),
|
|
1511
|
-
`http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1747
|
+
`http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1512
1748
|
);
|
|
1513
1749
|
});
|
|
1514
1750
|
});
|
|
@@ -1522,7 +1758,7 @@ describe('App embed tests', () => {
|
|
|
1522
1758
|
await executeAfterWait(() => {
|
|
1523
1759
|
expectUrlMatchesWithParams(
|
|
1524
1760
|
getIFrameSrc(),
|
|
1525
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true${defaultParamsPost}#/home`,
|
|
1761
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
1526
1762
|
);
|
|
1527
1763
|
});
|
|
1528
1764
|
});
|
|
@@ -1536,7 +1772,7 @@ describe('App embed tests', () => {
|
|
|
1536
1772
|
await executeAfterWait(() => {
|
|
1537
1773
|
expectUrlMatchesWithParams(
|
|
1538
1774
|
getIFrameSrc(),
|
|
1539
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false${defaultParamsPost}#/home`,
|
|
1775
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
1540
1776
|
);
|
|
1541
1777
|
});
|
|
1542
1778
|
});
|
|
@@ -1561,7 +1797,7 @@ describe('App embed tests', () => {
|
|
|
1561
1797
|
await executeAfterWait(() => {
|
|
1562
1798
|
expectUrlMatchesWithParams(
|
|
1563
1799
|
getIFrameSrc(),
|
|
1564
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1800
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=objectSearch&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1565
1801
|
);
|
|
1566
1802
|
});
|
|
1567
1803
|
});
|
|
@@ -1576,7 +1812,7 @@ describe('App embed tests', () => {
|
|
|
1576
1812
|
await executeAfterWait(() => {
|
|
1577
1813
|
expectUrlMatchesWithParams(
|
|
1578
1814
|
getIFrameSrc(),
|
|
1579
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1815
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=aiAnswer&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1580
1816
|
);
|
|
1581
1817
|
});
|
|
1582
1818
|
});
|
|
@@ -1591,7 +1827,7 @@ describe('App embed tests', () => {
|
|
|
1591
1827
|
await executeAfterWait(() => {
|
|
1592
1828
|
expectUrlMatchesWithParams(
|
|
1593
1829
|
getIFrameSrc(),
|
|
1594
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1830
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=none&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1595
1831
|
);
|
|
1596
1832
|
});
|
|
1597
1833
|
});
|
|
@@ -1608,7 +1844,7 @@ describe('App embed tests', () => {
|
|
|
1608
1844
|
await executeAfterWait(() => {
|
|
1609
1845
|
expectUrlMatchesWithParams(
|
|
1610
1846
|
getIFrameSrc(),
|
|
1611
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1847
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
1612
1848
|
);
|
|
1613
1849
|
});
|
|
1614
1850
|
});
|
|
@@ -1669,7 +1905,7 @@ describe('App embed tests', () => {
|
|
|
1669
1905
|
appEmbed.navigateToPage(path);
|
|
1670
1906
|
expectUrlMatchesWithParams(
|
|
1671
1907
|
getIFrameSrc(),
|
|
1672
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
|
|
1908
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
|
|
1673
1909
|
);
|
|
1674
1910
|
});
|
|
1675
1911
|
|
|
@@ -1736,6 +1972,116 @@ describe('App embed tests', () => {
|
|
|
1736
1972
|
'Please call render before invoking this method',
|
|
1737
1973
|
);
|
|
1738
1974
|
});
|
|
1975
|
+
|
|
1976
|
+
describe('overrideHistoryState flag', () => {
|
|
1977
|
+
test('navigateToPage with overrideHistoryState=true should trigger HostEvent.Navigate', async () => {
|
|
1978
|
+
mockMessageChannel();
|
|
1979
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1980
|
+
frameParams: {
|
|
1981
|
+
width: '100%',
|
|
1982
|
+
height: '100%',
|
|
1983
|
+
},
|
|
1984
|
+
overrideHistoryState: true,
|
|
1985
|
+
});
|
|
1986
|
+
await appEmbed.render();
|
|
1987
|
+
|
|
1988
|
+
const iframe = getIFrameEl();
|
|
1989
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1990
|
+
appEmbed.navigateToPage(path, false);
|
|
1991
|
+
|
|
1992
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(
|
|
1993
|
+
expect.objectContaining({
|
|
1994
|
+
type: HostEvent.Navigate,
|
|
1995
|
+
data: path,
|
|
1996
|
+
}),
|
|
1997
|
+
`http://${thoughtSpotHost}`,
|
|
1998
|
+
expect.anything(),
|
|
1999
|
+
);
|
|
2000
|
+
});
|
|
2001
|
+
|
|
2002
|
+
test('navigateToPage with overrideHistoryState=true and path as number should trigger HostEvent.Navigate', async () => {
|
|
2003
|
+
mockMessageChannel();
|
|
2004
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2005
|
+
frameParams: {
|
|
2006
|
+
width: '100%',
|
|
2007
|
+
height: '100%',
|
|
2008
|
+
},
|
|
2009
|
+
overrideHistoryState: true,
|
|
2010
|
+
});
|
|
2011
|
+
await appEmbed.render();
|
|
2012
|
+
|
|
2013
|
+
const iframe = getIFrameEl();
|
|
2014
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
2015
|
+
appEmbed.navigateToPage(-1, false);
|
|
2016
|
+
|
|
2017
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(
|
|
2018
|
+
expect.objectContaining({
|
|
2019
|
+
type: HostEvent.Navigate,
|
|
2020
|
+
data: -1,
|
|
2021
|
+
}),
|
|
2022
|
+
`http://${thoughtSpotHost}`,
|
|
2023
|
+
expect.anything(),
|
|
2024
|
+
);
|
|
2025
|
+
});
|
|
2026
|
+
|
|
2027
|
+
test('navigateToPage with overrideHistoryState=false and noReload=false should update iframe src', async () => {
|
|
2028
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2029
|
+
frameParams: {
|
|
2030
|
+
width: '100%',
|
|
2031
|
+
height: '100%',
|
|
2032
|
+
},
|
|
2033
|
+
overrideHistoryState: false,
|
|
2034
|
+
});
|
|
2035
|
+
await appEmbed.render();
|
|
2036
|
+
appEmbed.navigateToPage(path, false);
|
|
2037
|
+
|
|
2038
|
+
expectUrlMatchesWithParams(
|
|
2039
|
+
getIFrameSrc(),
|
|
2040
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
|
|
2041
|
+
);
|
|
2042
|
+
});
|
|
2043
|
+
|
|
2044
|
+
test('navigateToPage with overrideHistoryState=undefined and noReload=false should update iframe src', async () => {
|
|
2045
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2046
|
+
frameParams: {
|
|
2047
|
+
width: '100%',
|
|
2048
|
+
height: '100%',
|
|
2049
|
+
},
|
|
2050
|
+
});
|
|
2051
|
+
await appEmbed.render();
|
|
2052
|
+
appEmbed.navigateToPage(path, false);
|
|
2053
|
+
|
|
2054
|
+
expectUrlMatchesWithParams(
|
|
2055
|
+
getIFrameSrc(),
|
|
2056
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`,
|
|
2057
|
+
);
|
|
2058
|
+
});
|
|
2059
|
+
|
|
2060
|
+
test('navigateToPage respects noReload priority over overrideHistoryState', async () => {
|
|
2061
|
+
mockMessageChannel();
|
|
2062
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2063
|
+
frameParams: {
|
|
2064
|
+
width: '100%',
|
|
2065
|
+
height: '100%',
|
|
2066
|
+
},
|
|
2067
|
+
overrideHistoryState: false,
|
|
2068
|
+
});
|
|
2069
|
+
await appEmbed.render();
|
|
2070
|
+
|
|
2071
|
+
const iframe = getIFrameEl();
|
|
2072
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
2073
|
+
appEmbed.navigateToPage(path, true);
|
|
2074
|
+
|
|
2075
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(
|
|
2076
|
+
expect.objectContaining({
|
|
2077
|
+
type: HostEvent.Navigate,
|
|
2078
|
+
data: path,
|
|
2079
|
+
}),
|
|
2080
|
+
`http://${thoughtSpotHost}`,
|
|
2081
|
+
expect.anything(),
|
|
2082
|
+
);
|
|
2083
|
+
});
|
|
2084
|
+
});
|
|
1739
2085
|
});
|
|
1740
2086
|
|
|
1741
2087
|
describe('LazyLoadingForFullHeight functionality', () => {
|
|
@@ -1813,6 +2159,238 @@ describe('App embed tests', () => {
|
|
|
1813
2159
|
}, 100);
|
|
1814
2160
|
});
|
|
1815
2161
|
|
|
2162
|
+
test('should default lazy loading flags to true when fullHeight is enabled', async () => {
|
|
2163
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2164
|
+
...defaultViewConfig,
|
|
2165
|
+
fullHeight: true,
|
|
2166
|
+
} as AppViewConfig);
|
|
2167
|
+
|
|
2168
|
+
expect((appEmbed as any).viewConfig.lazyLoadingForFullHeight).toBe(true);
|
|
2169
|
+
expect((appEmbed as any).viewConfig.enableScrollableContainerLazyLoading).toBe(true);
|
|
2170
|
+
expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBe('500px 0px');
|
|
2171
|
+
|
|
2172
|
+
await appEmbed.render();
|
|
2173
|
+
|
|
2174
|
+
await executeAfterWait(() => {
|
|
2175
|
+
const iframeSrc = getIFrameSrc();
|
|
2176
|
+
expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
|
|
2177
|
+
expect(iframeSrc).toContain('isFullHeightPinboard=true');
|
|
2178
|
+
expect(iframeSrc).toContain('rootMarginForLazyLoad=500px%200px');
|
|
2179
|
+
}, 100);
|
|
2180
|
+
});
|
|
2181
|
+
|
|
2182
|
+
test('should not default lazy loading flags when fullHeight is not enabled', async () => {
|
|
2183
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2184
|
+
...defaultViewConfig,
|
|
2185
|
+
} as AppViewConfig);
|
|
2186
|
+
|
|
2187
|
+
expect((appEmbed as any).viewConfig.lazyLoadingForFullHeight).toBeUndefined();
|
|
2188
|
+
expect(
|
|
2189
|
+
(appEmbed as any).viewConfig.enableScrollableContainerLazyLoading,
|
|
2190
|
+
).toBeUndefined();
|
|
2191
|
+
expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBeUndefined();
|
|
2192
|
+
});
|
|
2193
|
+
|
|
2194
|
+
test('should not write the defaults back onto the caller view config', async () => {
|
|
2195
|
+
const callerViewConfig = {
|
|
2196
|
+
...defaultViewConfig,
|
|
2197
|
+
fullHeight: true,
|
|
2198
|
+
} as AppViewConfig;
|
|
2199
|
+
|
|
2200
|
+
new AppEmbed(getRootEl(), callerViewConfig);
|
|
2201
|
+
|
|
2202
|
+
expect(callerViewConfig.lazyLoadingForFullHeight).toBeUndefined();
|
|
2203
|
+
expect(callerViewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
|
|
2204
|
+
expect(callerViewConfig.lazyLoadingMargin).toBeUndefined();
|
|
2205
|
+
});
|
|
2206
|
+
|
|
2207
|
+
test('should not default lazy loading flags when fullHeight is explicitly false', async () => {
|
|
2208
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2209
|
+
...defaultViewConfig,
|
|
2210
|
+
fullHeight: false,
|
|
2211
|
+
} as AppViewConfig);
|
|
2212
|
+
|
|
2213
|
+
expect((appEmbed as any).viewConfig.lazyLoadingForFullHeight).toBeUndefined();
|
|
2214
|
+
expect(
|
|
2215
|
+
(appEmbed as any).viewConfig.enableScrollableContainerLazyLoading,
|
|
2216
|
+
).toBeUndefined();
|
|
2217
|
+
expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBeUndefined();
|
|
2218
|
+
});
|
|
2219
|
+
|
|
2220
|
+
test('should default lazyLoadingMargin when lazyLoadingForFullHeight is set explicitly', async () => {
|
|
2221
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2222
|
+
...defaultViewConfig,
|
|
2223
|
+
fullHeight: true,
|
|
2224
|
+
lazyLoadingForFullHeight: true,
|
|
2225
|
+
} as AppViewConfig);
|
|
2226
|
+
|
|
2227
|
+
expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBe(
|
|
2228
|
+
config.DEFAULT_LAZY_LOADING_MARGIN,
|
|
2229
|
+
);
|
|
2230
|
+
|
|
2231
|
+
await appEmbed.render();
|
|
2232
|
+
|
|
2233
|
+
await executeAfterWait(() => {
|
|
2234
|
+
expect(getIFrameSrc()).toContain('rootMarginForLazyLoad=500px%200px');
|
|
2235
|
+
}, 100);
|
|
2236
|
+
});
|
|
2237
|
+
|
|
2238
|
+
test('should let an explicit lazyLoadingMargin win over the default', async () => {
|
|
2239
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2240
|
+
...defaultViewConfig,
|
|
2241
|
+
fullHeight: true,
|
|
2242
|
+
lazyLoadingMargin: '250px',
|
|
2243
|
+
} as AppViewConfig);
|
|
2244
|
+
|
|
2245
|
+
await appEmbed.render();
|
|
2246
|
+
|
|
2247
|
+
await executeAfterWait(() => {
|
|
2248
|
+
const iframeSrc = getIFrameSrc();
|
|
2249
|
+
expect(iframeSrc).toContain('rootMarginForLazyLoad=250px');
|
|
2250
|
+
expect(iframeSrc).not.toContain('rootMarginForLazyLoad=500px%200px');
|
|
2251
|
+
}, 100);
|
|
2252
|
+
});
|
|
2253
|
+
|
|
2254
|
+
test('should drop an invalid lazyLoadingMargin and log an error', async () => {
|
|
2255
|
+
const loggerErrorSpy = jest.spyOn(logger, 'error').mockImplementation(() => undefined);
|
|
2256
|
+
|
|
2257
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2258
|
+
...defaultViewConfig,
|
|
2259
|
+
fullHeight: true,
|
|
2260
|
+
lazyLoadingMargin: 'not-a-margin',
|
|
2261
|
+
} as AppViewConfig);
|
|
2262
|
+
|
|
2263
|
+
await appEmbed.render();
|
|
2264
|
+
|
|
2265
|
+
await executeAfterWait(() => {
|
|
2266
|
+
const iframeSrc = getIFrameSrc();
|
|
2267
|
+
expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
|
|
2268
|
+
expect(iframeSrc).not.toContain('rootMarginForLazyLoad');
|
|
2269
|
+
expect(loggerErrorSpy).toHaveBeenCalledWith(
|
|
2270
|
+
'Please provide a valid lazyLoadingMargin value (e.g., "10px")',
|
|
2271
|
+
);
|
|
2272
|
+
}, 100);
|
|
2273
|
+
});
|
|
2274
|
+
|
|
2275
|
+
test('should track scrollable ancestors by default when only fullHeight is set', async () => {
|
|
2276
|
+
const scrollContainer = getRootEl();
|
|
2277
|
+
scrollContainer.style.overflow = 'auto';
|
|
2278
|
+
|
|
2279
|
+
const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
|
|
2280
|
+
const resizeObserveSpy = jest.fn();
|
|
2281
|
+
const resizeDisconnectSpy = jest.fn();
|
|
2282
|
+
(window as any).ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
2283
|
+
observe: resizeObserveSpy,
|
|
2284
|
+
disconnect: resizeDisconnectSpy,
|
|
2285
|
+
}));
|
|
2286
|
+
|
|
2287
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2288
|
+
...defaultViewConfig,
|
|
2289
|
+
fullHeight: true,
|
|
2290
|
+
} as AppViewConfig);
|
|
2291
|
+
|
|
2292
|
+
await appEmbed.render();
|
|
2293
|
+
|
|
2294
|
+
await executeAfterWait(() => {
|
|
2295
|
+
expect(scrollContainerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
|
|
2296
|
+
expect(resizeObserveSpy).toHaveBeenCalledWith(scrollContainer);
|
|
2297
|
+
}, 100);
|
|
2298
|
+
|
|
2299
|
+
appEmbed.destroy();
|
|
2300
|
+
expect(resizeDisconnectSpy).toHaveBeenCalled();
|
|
2301
|
+
|
|
2302
|
+
scrollContainer.style.overflow = '';
|
|
2303
|
+
(window as any).ResizeObserver = originalResizeObserver;
|
|
2304
|
+
});
|
|
2305
|
+
|
|
2306
|
+
test('should skip ancestor tracking when enableScrollableContainerLazyLoading is false', async () => {
|
|
2307
|
+
const scrollContainer = getRootEl();
|
|
2308
|
+
scrollContainer.style.overflow = 'auto';
|
|
2309
|
+
|
|
2310
|
+
const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
|
|
2311
|
+
const windowSpy = jest.spyOn(window, 'addEventListener');
|
|
2312
|
+
|
|
2313
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2314
|
+
...defaultViewConfig,
|
|
2315
|
+
fullHeight: true,
|
|
2316
|
+
enableScrollableContainerLazyLoading: false,
|
|
2317
|
+
} as AppViewConfig);
|
|
2318
|
+
|
|
2319
|
+
await appEmbed.render();
|
|
2320
|
+
|
|
2321
|
+
await executeAfterWait(() => {
|
|
2322
|
+
expect(windowSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
|
|
2323
|
+
expect(scrollContainerSpy).not.toHaveBeenCalledWith('scroll', expect.any(Function));
|
|
2324
|
+
}, 100);
|
|
2325
|
+
|
|
2326
|
+
appEmbed.destroy();
|
|
2327
|
+
scrollContainer.style.overflow = '';
|
|
2328
|
+
});
|
|
2329
|
+
|
|
2330
|
+
test('should wire the window scroll listener to the coordinates sender by default', async () => {
|
|
2331
|
+
const addEventListenerSpy = jest.spyOn(window, 'addEventListener');
|
|
2332
|
+
|
|
2333
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2334
|
+
...defaultViewConfig,
|
|
2335
|
+
fullHeight: true,
|
|
2336
|
+
} as AppViewConfig);
|
|
2337
|
+
|
|
2338
|
+
const mockTrigger = jest
|
|
2339
|
+
.spyOn(appEmbed, 'trigger')
|
|
2340
|
+
.mockImplementation(() => Promise.resolve(undefined as any));
|
|
2341
|
+
|
|
2342
|
+
await appEmbed.render();
|
|
2343
|
+
|
|
2344
|
+
await executeAfterWait(() => {
|
|
2345
|
+
const scrollCall = addEventListenerSpy.mock.calls.find(
|
|
2346
|
+
([eventName, , capture]) => eventName === 'scroll' && capture === true,
|
|
2347
|
+
);
|
|
2348
|
+
expect(scrollCall).toBeDefined();
|
|
2349
|
+
|
|
2350
|
+
// Call the handler the way a real scroll event would.
|
|
2351
|
+
(scrollCall as any)[1]();
|
|
2352
|
+
|
|
2353
|
+
expect(mockTrigger).toHaveBeenCalledWith(
|
|
2354
|
+
HostEvent.VisibleEmbedCoordinates,
|
|
2355
|
+
expect.objectContaining({ top: expect.any(Number) }),
|
|
2356
|
+
);
|
|
2357
|
+
}, 100);
|
|
2358
|
+
|
|
2359
|
+
appEmbed.destroy();
|
|
2360
|
+
addEventListenerSpy.mockRestore();
|
|
2361
|
+
});
|
|
2362
|
+
|
|
2363
|
+
test('should remove listeners on destroy when the flags come from defaults', async () => {
|
|
2364
|
+
const removeEventListenerSpy = jest.spyOn(window, 'removeEventListener');
|
|
2365
|
+
|
|
2366
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2367
|
+
...defaultViewConfig,
|
|
2368
|
+
fullHeight: true,
|
|
2369
|
+
} as AppViewConfig);
|
|
2370
|
+
|
|
2371
|
+
await appEmbed.render();
|
|
2372
|
+
appEmbed.destroy();
|
|
2373
|
+
|
|
2374
|
+
expect(removeEventListenerSpy).toHaveBeenCalledWith('resize', expect.anything());
|
|
2375
|
+
expect(removeEventListenerSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
|
|
2376
|
+
|
|
2377
|
+
removeEventListenerSpy.mockRestore();
|
|
2378
|
+
});
|
|
2379
|
+
|
|
2380
|
+
test('should keep an explicit false for the lazy loading flags', async () => {
|
|
2381
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2382
|
+
...defaultViewConfig,
|
|
2383
|
+
fullHeight: true,
|
|
2384
|
+
lazyLoadingForFullHeight: false,
|
|
2385
|
+
enableScrollableContainerLazyLoading: false,
|
|
2386
|
+
lazyLoadingMargin: '0px',
|
|
2387
|
+
} as AppViewConfig);
|
|
2388
|
+
|
|
2389
|
+
expect((appEmbed as any).viewConfig.lazyLoadingForFullHeight).toBe(false);
|
|
2390
|
+
expect((appEmbed as any).viewConfig.enableScrollableContainerLazyLoading).toBe(false);
|
|
2391
|
+
expect((appEmbed as any).viewConfig.lazyLoadingMargin).toBe('0px');
|
|
2392
|
+
});
|
|
2393
|
+
|
|
1816
2394
|
test('should not set lazyLoadingForEmbed when lazyLoadingForFullHeight is enabled but fullHeight is false', async () => {
|
|
1817
2395
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1818
2396
|
...defaultViewConfig,
|
|
@@ -2333,3 +2911,106 @@ describe('AppEmbed visualOverrides tests', () => {
|
|
|
2333
2911
|
await testVisualOverridesInEmbed(appEmbed, visualOverrides);
|
|
2334
2912
|
});
|
|
2335
2913
|
});
|
|
2914
|
+
|
|
2915
|
+
describe('AppEmbed getEmbedParamsObject', () => {
|
|
2916
|
+
beforeEach(() => {
|
|
2917
|
+
cleanUp();
|
|
2918
|
+
jest.spyOn(TsEmbed.prototype as any, 'getAppInitData').mockResolvedValue({});
|
|
2919
|
+
});
|
|
2920
|
+
|
|
2921
|
+
afterEach(() => {
|
|
2922
|
+
jest.restoreAllMocks();
|
|
2923
|
+
});
|
|
2924
|
+
|
|
2925
|
+
test('getEmbedParams should use getEmbedParamsObject internally', async () => {
|
|
2926
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2927
|
+
...defaultViewConfig,
|
|
2928
|
+
fullHeight: true,
|
|
2929
|
+
} as AppViewConfig);
|
|
2930
|
+
|
|
2931
|
+
const getEmbedParamsObjectSpy = jest.spyOn(appEmbed as any, 'getEmbedParamsObject');
|
|
2932
|
+
|
|
2933
|
+
await appEmbed.render();
|
|
2934
|
+
|
|
2935
|
+
expect(getEmbedParamsObjectSpy).toHaveBeenCalled();
|
|
2936
|
+
});
|
|
2937
|
+
|
|
2938
|
+
test('getEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', () => {
|
|
2939
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2940
|
+
...defaultViewConfig,
|
|
2941
|
+
fullHeight: true,
|
|
2942
|
+
} as AppViewConfig);
|
|
2943
|
+
|
|
2944
|
+
const params = (appEmbed as any).getEmbedParamsObject();
|
|
2945
|
+
|
|
2946
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
2947
|
+
expect(params.fullHeight).toBeUndefined();
|
|
2948
|
+
});
|
|
2949
|
+
|
|
2950
|
+
test('getEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', () => {
|
|
2951
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2952
|
+
...defaultViewConfig,
|
|
2953
|
+
fullHeight: false,
|
|
2954
|
+
} as AppViewConfig);
|
|
2955
|
+
|
|
2956
|
+
const params = (appEmbed as any).getEmbedParamsObject();
|
|
2957
|
+
|
|
2958
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
2959
|
+
});
|
|
2960
|
+
|
|
2961
|
+
test('getUpdateEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', async () => {
|
|
2962
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2963
|
+
...defaultViewConfig,
|
|
2964
|
+
fullHeight: true,
|
|
2965
|
+
} as AppViewConfig);
|
|
2966
|
+
|
|
2967
|
+
const params = await (appEmbed as any).getUpdateEmbedParamsObject();
|
|
2968
|
+
|
|
2969
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
2970
|
+
});
|
|
2971
|
+
|
|
2972
|
+
test('getUpdateEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', async () => {
|
|
2973
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2974
|
+
...defaultViewConfig,
|
|
2975
|
+
fullHeight: false,
|
|
2976
|
+
} as AppViewConfig);
|
|
2977
|
+
|
|
2978
|
+
const params = await (appEmbed as any).getUpdateEmbedParamsObject();
|
|
2979
|
+
|
|
2980
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
2981
|
+
});
|
|
2982
|
+
});
|
|
2983
|
+
|
|
2984
|
+
describe('AppEmbed updatedSpotterExperience tests', () => {
|
|
2985
|
+
beforeEach(() => {
|
|
2986
|
+
cleanUp();
|
|
2987
|
+
});
|
|
2988
|
+
|
|
2989
|
+
test('should set updatedSpotterExperience to true in url', async () => {
|
|
2990
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2991
|
+
...defaultViewConfig,
|
|
2992
|
+
updatedSpotterExperience: true,
|
|
2993
|
+
} as AppViewConfig);
|
|
2994
|
+
appEmbed.render();
|
|
2995
|
+
await executeAfterWait(() => {
|
|
2996
|
+
expectUrlMatchesWithParams(
|
|
2997
|
+
getIFrameSrc(),
|
|
2998
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
2999
|
+
);
|
|
3000
|
+
});
|
|
3001
|
+
});
|
|
3002
|
+
|
|
3003
|
+
test('should set updatedSpotterExperience to false in url', async () => {
|
|
3004
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
3005
|
+
...defaultViewConfig,
|
|
3006
|
+
updatedSpotterExperience: false,
|
|
3007
|
+
} as AppViewConfig);
|
|
3008
|
+
appEmbed.render();
|
|
3009
|
+
await executeAfterWait(() => {
|
|
3010
|
+
expectUrlMatchesWithParams(
|
|
3011
|
+
getIFrameSrc(),
|
|
3012
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`,
|
|
3013
|
+
);
|
|
3014
|
+
});
|
|
3015
|
+
});
|
|
3016
|
+
});
|