@thoughtspot/visual-embed-sdk 1.50.0 → 1.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/css-variables.d.ts +95 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +136 -15
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +59 -37
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +419 -149
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +230 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +30 -16
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +221 -17
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +635 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/host-events.spec.js +151 -0
- package/cjs/src/embed/host-events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +51 -14
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +11 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +9 -0
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +218 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.js +32 -2
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.spec.js +178 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +42 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +26 -6
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +83 -2
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +8 -1
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-utils.js +14 -1
- package/cjs/src/embed/spotter-utils.js.map +1 -1
- package/cjs/src/embed/spotter-utils.spec.js +61 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.d.ts +34 -0
- package/cjs/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.js.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.spec.js +17 -0
- package/cjs/src/embed/spotter-viz-utils.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +29 -7
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +146 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -2
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts +4 -0
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +4 -0
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/react/util.spec.js +251 -0
- package/cjs/src/react/util.spec.js.map +1 -1
- package/cjs/src/types.d.ts +573 -11
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +519 -2
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +93 -0
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/cjs/src/utils/processTrigger.spec.js +61 -0
- package/cjs/src/utils/processTrigger.spec.js.map +1 -1
- package/dist/{index-B5xoN6Cp.js → index-aBzH5ZwF.js} +1 -1
- package/dist/src/css-variables.d.ts +95 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +136 -15
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +230 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +51 -14
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +1 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +2 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +42 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +8 -1
- package/dist/src/embed/spotter-utils.d.ts.map +1 -1
- package/dist/src/embed/spotter-viz-utils.d.ts +34 -0
- package/dist/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +4 -0
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/types.d.ts +573 -11
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +936 -142
- package/dist/tsembed-react.js +935 -141
- package/dist/tsembed.es.js +935 -142
- package/dist/tsembed.js +933 -140
- package/dist/visual-embed-sdk-react-full.d.ts +1147 -44
- package/dist/visual-embed-sdk-react.d.ts +1153 -46
- package/dist/visual-embed-sdk.d.ts +1161 -46
- package/lib/package.json +1 -1
- package/lib/src/css-variables.d.ts +95 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +136 -15
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +60 -38
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +420 -150
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +230 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +31 -17
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +222 -18
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +635 -0
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/host-events.spec.js +152 -1
- package/lib/src/embed/host-events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +51 -14
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +10 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +10 -1
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +218 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +2 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/utils.js +28 -1
- package/lib/src/embed/hostEventClient/utils.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.spec.js +179 -1
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +42 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +26 -6
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +83 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +8 -1
- package/lib/src/embed/spotter-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-utils.js +12 -0
- package/lib/src/embed/spotter-utils.js.map +1 -1
- package/lib/src/embed/spotter-utils.spec.js +62 -1
- package/lib/src/embed/spotter-utils.spec.js.map +1 -1
- package/lib/src/embed/spotter-viz-utils.d.ts +34 -0
- package/lib/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-viz-utils.js.map +1 -1
- package/lib/src/embed/spotter-viz-utils.spec.js +17 -0
- package/lib/src/embed/spotter-viz-utils.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +29 -7
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +146 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +4 -0
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +4 -0
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/react/util.spec.js +251 -0
- package/lib/src/react/util.spec.js.map +1 -1
- package/lib/src/types.d.ts +573 -11
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +519 -2
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.spec.js +93 -0
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/utils/processTrigger.spec.js +61 -0
- package/lib/src/utils/processTrigger.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1161 -46
- package/package.json +1 -1
- package/src/css-variables.ts +118 -0
- package/src/embed/app.spec.ts +530 -183
- package/src/embed/app.ts +209 -66
- package/src/embed/conversation.spec.ts +275 -21
- package/src/embed/conversation.ts +262 -17
- package/src/embed/events.spec.ts +757 -1
- package/src/embed/host-events.spec.ts +194 -0
- package/src/embed/hostEventClient/contracts.ts +57 -14
- package/src/embed/hostEventClient/host-event-client.spec.ts +338 -0
- package/src/embed/hostEventClient/host-event-client.ts +16 -0
- package/src/embed/hostEventClient/utils.spec.ts +204 -0
- package/src/embed/hostEventClient/utils.ts +37 -10
- package/src/embed/liveboard.spec.ts +108 -2
- package/src/embed/liveboard.ts +82 -14
- package/src/embed/spotter-utils.spec.ts +68 -1
- package/src/embed/spotter-utils.ts +16 -1
- package/src/embed/spotter-viz-utils.spec.ts +17 -0
- package/src/embed/spotter-viz-utils.ts +34 -0
- package/src/embed/ts-embed.spec.ts +186 -0
- package/src/embed/ts-embed.ts +30 -4
- package/src/errors.ts +1 -0
- package/src/index.ts +3 -1
- package/src/mixpanel-service.ts +4 -0
- package/src/react/util.spec.tsx +255 -0
- package/src/types.ts +575 -8
- package/src/utils/processData.spec.ts +97 -0
- package/src/utils/processTrigger.spec.ts +91 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppEmbed, DataPanelCustomColumnGroupsAccordionState, Page, HomePageSearchBarMode,
|
|
1
|
+
import { AppEmbed, DataPanelCustomColumnGroupsAccordionState, Page, HomePageSearchBarMode, HomePage, ListPage, } from './app';
|
|
2
|
+
import { SpotterQueryMode } from './conversation';
|
|
2
3
|
import { init } from '../index';
|
|
3
4
|
import { Action, AuthType, EmbedEvent, HostEvent, RuntimeFilterOp } from '../types';
|
|
4
5
|
import { executeAfterWait, getDocumentBody, getIFrameSrc, getRootEl, getIFrameEl, mockMessageChannel, defaultParams, defaultParamsForPinboardEmbed, defaultParamsWithoutHiddenActions, expectUrlMatchesWithParams, postMessageToParent, testVisualOverridesInEmbed, expectUrlToHaveParamsWithValues, } from '../test/test-utils';
|
|
@@ -97,7 +98,7 @@ describe('App embed tests', () => {
|
|
|
97
98
|
const appEmbed = new AppEmbed(getRootEl(), defaultViewConfig);
|
|
98
99
|
appEmbed.render();
|
|
99
100
|
await executeAfterWait(() => {
|
|
100
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`);
|
|
101
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
101
102
|
});
|
|
102
103
|
});
|
|
103
104
|
test('should hide the primary nav bar', async () => {
|
|
@@ -107,7 +108,7 @@ describe('App embed tests', () => {
|
|
|
107
108
|
});
|
|
108
109
|
appEmbed.render();
|
|
109
110
|
await executeAfterWait(() => {
|
|
110
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`);
|
|
111
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
111
112
|
});
|
|
112
113
|
});
|
|
113
114
|
test('should hide the help and profile buttons from nav bar', async () => {
|
|
@@ -117,7 +118,7 @@ describe('App embed tests', () => {
|
|
|
117
118
|
});
|
|
118
119
|
appEmbed.render();
|
|
119
120
|
await executeAfterWait(() => {
|
|
120
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true${defaultParams}${defaultParamsPost}#/home`);
|
|
121
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
121
122
|
});
|
|
122
123
|
});
|
|
123
124
|
test('should hide the application switcher button from nav bar', async () => {
|
|
@@ -127,7 +128,7 @@ describe('App embed tests', () => {
|
|
|
127
128
|
});
|
|
128
129
|
appEmbed.render();
|
|
129
130
|
await executeAfterWait(() => {
|
|
130
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true${defaultParams}${defaultParamsPost}#/home`);
|
|
131
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
131
132
|
});
|
|
132
133
|
});
|
|
133
134
|
test('should hide the org switcher button from nav bar', async () => {
|
|
@@ -137,7 +138,7 @@ describe('App embed tests', () => {
|
|
|
137
138
|
});
|
|
138
139
|
appEmbed.render();
|
|
139
140
|
await executeAfterWait(() => {
|
|
140
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true${defaultParams}${defaultParamsPost}#/home`);
|
|
141
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
141
142
|
});
|
|
142
143
|
});
|
|
143
144
|
describe('should render the correct routes for pages', () => {
|
|
@@ -150,6 +151,7 @@ describe('App embed tests', () => {
|
|
|
150
151
|
[Page.Home]: 'home',
|
|
151
152
|
[Page.SpotIQ]: 'insights/results',
|
|
152
153
|
[Page.Monitor]: 'insights/monitor-alerts',
|
|
154
|
+
[Page.Collections]: 'collections',
|
|
153
155
|
};
|
|
154
156
|
const pageIds = Object.keys(pageRouteMap);
|
|
155
157
|
for (let i = 0; i < pageIds.length; i++) {
|
|
@@ -162,7 +164,7 @@ describe('App embed tests', () => {
|
|
|
162
164
|
});
|
|
163
165
|
appEmbed.render();
|
|
164
166
|
await executeAfterWait(() => {
|
|
165
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`);
|
|
167
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`);
|
|
166
168
|
cleanUp();
|
|
167
169
|
});
|
|
168
170
|
});
|
|
@@ -176,6 +178,7 @@ describe('App embed tests', () => {
|
|
|
176
178
|
[Page.Home]: 'home',
|
|
177
179
|
[Page.SpotIQ]: 'home/spotiq-analysis',
|
|
178
180
|
[Page.Monitor]: 'home/monitor-alerts',
|
|
181
|
+
[Page.Collections]: 'collections',
|
|
179
182
|
};
|
|
180
183
|
const pageIdsForModularHomes = Object.keys(pageRouteMapForModularHome);
|
|
181
184
|
for (let i = 0; i < pageIdsForModularHomes.length; i++) {
|
|
@@ -189,7 +192,7 @@ describe('App embed tests', () => {
|
|
|
189
192
|
});
|
|
190
193
|
appEmbed.render();
|
|
191
194
|
await executeAfterWait(() => {
|
|
192
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`);
|
|
195
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`);
|
|
193
196
|
cleanUp();
|
|
194
197
|
});
|
|
195
198
|
});
|
|
@@ -202,7 +205,7 @@ describe('App embed tests', () => {
|
|
|
202
205
|
});
|
|
203
206
|
appEmbed.render();
|
|
204
207
|
await executeAfterWait(() => {
|
|
205
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/foo/bar`);
|
|
208
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/foo/bar`);
|
|
206
209
|
});
|
|
207
210
|
});
|
|
208
211
|
test('should apply runtime filters', async () => {
|
|
@@ -220,7 +223,7 @@ describe('App embed tests', () => {
|
|
|
220
223
|
});
|
|
221
224
|
appEmbed.render();
|
|
222
225
|
await executeAfterWait(() => {
|
|
223
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000${defaultParams}${defaultParamsPost}#/home`);
|
|
226
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
224
227
|
});
|
|
225
228
|
});
|
|
226
229
|
test('should not append runtime filters in URL if excludeRuntimeFiltersfromURL is true', async () => {
|
|
@@ -238,7 +241,7 @@ describe('App embed tests', () => {
|
|
|
238
241
|
});
|
|
239
242
|
appEmbed.render();
|
|
240
243
|
await executeAfterWait(() => {
|
|
241
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`);
|
|
244
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
242
245
|
});
|
|
243
246
|
});
|
|
244
247
|
test('should append runtime filters in URL if excludeRuntimeFiltersfromURL is undefined', async () => {
|
|
@@ -257,7 +260,7 @@ describe('App embed tests', () => {
|
|
|
257
260
|
appEmbed.render();
|
|
258
261
|
const runtimeFilter = 'col1=sales&op1=EQ&val1=1000';
|
|
259
262
|
await executeAfterWait(() => {
|
|
260
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`);
|
|
263
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`);
|
|
261
264
|
});
|
|
262
265
|
});
|
|
263
266
|
test('should disable and hide actions', async () => {
|
|
@@ -270,7 +273,7 @@ describe('App embed tests', () => {
|
|
|
270
273
|
});
|
|
271
274
|
appEmbed.render();
|
|
272
275
|
await executeAfterWait(() => {
|
|
273
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&${defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`);
|
|
276
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`);
|
|
274
277
|
});
|
|
275
278
|
});
|
|
276
279
|
test('should set enable2ColumnLayout to true in url', async () => {
|
|
@@ -280,7 +283,7 @@ describe('App embed tests', () => {
|
|
|
280
283
|
});
|
|
281
284
|
appEmbed.render();
|
|
282
285
|
await executeAfterWait(() => {
|
|
283
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`);
|
|
286
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
284
287
|
});
|
|
285
288
|
});
|
|
286
289
|
test('should set coverAndFilterOptionInPDF to false in url', async () => {
|
|
@@ -290,7 +293,7 @@ describe('App embed tests', () => {
|
|
|
290
293
|
});
|
|
291
294
|
appEmbed.render();
|
|
292
295
|
await executeAfterWait(() => {
|
|
293
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false${defaultParamsPost}#/home`);
|
|
296
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
294
297
|
});
|
|
295
298
|
});
|
|
296
299
|
test('should set isLiveboardStylingAndGroupingEnabled to true in url (deprecated, use isLiveboardMasterpiecesEnabled)', async () => {
|
|
@@ -300,7 +303,7 @@ describe('App embed tests', () => {
|
|
|
300
303
|
});
|
|
301
304
|
appEmbed.render();
|
|
302
305
|
await executeAfterWait(() => {
|
|
303
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true${defaultParamsPost}#/home`);
|
|
306
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
304
307
|
});
|
|
305
308
|
});
|
|
306
309
|
test('should set isThisPeriodInDateFiltersEnabled to true in url', async () => {
|
|
@@ -310,7 +313,7 @@ describe('App embed tests', () => {
|
|
|
310
313
|
});
|
|
311
314
|
appEmbed.render();
|
|
312
315
|
await executeAfterWait(() => {
|
|
313
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true${defaultParamsPost}#/home`);
|
|
316
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
314
317
|
});
|
|
315
318
|
});
|
|
316
319
|
test('should set enableHomepageAnnouncement to true in url', async () => {
|
|
@@ -320,14 +323,14 @@ describe('App embed tests', () => {
|
|
|
320
323
|
});
|
|
321
324
|
appEmbed.render();
|
|
322
325
|
await executeAfterWait(() => {
|
|
323
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true${defaultParamsPost}#/home`);
|
|
326
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
324
327
|
});
|
|
325
328
|
});
|
|
326
329
|
test('should set enableHomepageAnnouncement to false in url when not provided in AppViewConfig', async () => {
|
|
327
330
|
const appEmbed = new AppEmbed(getRootEl(), defaultViewConfig);
|
|
328
331
|
appEmbed.render();
|
|
329
332
|
await executeAfterWait(() => {
|
|
330
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false${defaultParamsPost}#/home`);
|
|
333
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
331
334
|
});
|
|
332
335
|
});
|
|
333
336
|
test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
|
|
@@ -337,7 +340,7 @@ describe('App embed tests', () => {
|
|
|
337
340
|
});
|
|
338
341
|
appEmbed.render();
|
|
339
342
|
await executeAfterWait(() => {
|
|
340
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`);
|
|
343
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
341
344
|
});
|
|
342
345
|
});
|
|
343
346
|
test('should set isWYSIWYGLiveboardPDFEnabled to true in url', async () => {
|
|
@@ -347,16 +350,16 @@ describe('App embed tests', () => {
|
|
|
347
350
|
});
|
|
348
351
|
appEmbed.render();
|
|
349
352
|
await executeAfterWait(() => {
|
|
350
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true${defaultParamsPost}#/home`);
|
|
353
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
351
354
|
});
|
|
352
355
|
});
|
|
353
|
-
test('should
|
|
356
|
+
test('should not set isWYSIWYGLiveboardPDFEnabled in url by default', async () => {
|
|
354
357
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
355
358
|
...defaultViewConfig,
|
|
356
359
|
});
|
|
357
360
|
appEmbed.render();
|
|
358
361
|
await executeAfterWait(() => {
|
|
359
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
362
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
360
363
|
});
|
|
361
364
|
});
|
|
362
365
|
test('should set isLinkParametersEnabled to true in url', async () => {
|
|
@@ -366,7 +369,7 @@ describe('App embed tests', () => {
|
|
|
366
369
|
});
|
|
367
370
|
appEmbed.render();
|
|
368
371
|
await executeAfterWait(() => {
|
|
369
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true${defaultParamsPost}#/home`);
|
|
372
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
370
373
|
});
|
|
371
374
|
});
|
|
372
375
|
test('should set isLinkParametersEnabled to false in url', async () => {
|
|
@@ -376,7 +379,7 @@ describe('App embed tests', () => {
|
|
|
376
379
|
});
|
|
377
380
|
appEmbed.render();
|
|
378
381
|
await executeAfterWait(() => {
|
|
379
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false${defaultParamsPost}#/home`);
|
|
382
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
380
383
|
});
|
|
381
384
|
});
|
|
382
385
|
test('Should add homepageVersion=v4 and updatedSpotterChatPrompt=true when homePage is Focused to the iframe src', async () => {
|
|
@@ -385,7 +388,7 @@ describe('App embed tests', () => {
|
|
|
385
388
|
discoveryExperience: {
|
|
386
389
|
homePage: HomePage.Focused,
|
|
387
390
|
},
|
|
388
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
391
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=true${defaultParams}${defaultParamsPost}#/home`);
|
|
389
392
|
});
|
|
390
393
|
test('Should respect explicit updatedSpotterChatPrompt=false even when homePage is Focused', async () => {
|
|
391
394
|
await testUrlParams({
|
|
@@ -394,7 +397,7 @@ describe('App embed tests', () => {
|
|
|
394
397
|
homePage: HomePage.Focused,
|
|
395
398
|
},
|
|
396
399
|
updatedSpotterChatPrompt: false,
|
|
397
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
400
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=false${defaultParams}${defaultParamsPost}#/home`);
|
|
398
401
|
});
|
|
399
402
|
test('should set isLiveboardXLSXCSVDownloadEnabled to true in url', async () => {
|
|
400
403
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
@@ -403,7 +406,7 @@ describe('App embed tests', () => {
|
|
|
403
406
|
});
|
|
404
407
|
appEmbed.render();
|
|
405
408
|
await executeAfterWait(() => {
|
|
406
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`);
|
|
409
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
407
410
|
});
|
|
408
411
|
});
|
|
409
412
|
test('should set updatedSpotterChatPrompt to true in url', async () => {
|
|
@@ -413,7 +416,7 @@ describe('App embed tests', () => {
|
|
|
413
416
|
});
|
|
414
417
|
appEmbed.render();
|
|
415
418
|
await executeAfterWait(() => {
|
|
416
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true${defaultParamsPost}#/home`);
|
|
419
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
417
420
|
});
|
|
418
421
|
});
|
|
419
422
|
test('should set updatedSpotterChatPrompt to false in url', async () => {
|
|
@@ -423,7 +426,46 @@ describe('App embed tests', () => {
|
|
|
423
426
|
});
|
|
424
427
|
appEmbed.render();
|
|
425
428
|
await executeAfterWait(() => {
|
|
426
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false${defaultParamsPost}#/home`);
|
|
429
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
430
|
+
});
|
|
431
|
+
});
|
|
432
|
+
test('should set showSpotterRadiance to true in url', async () => {
|
|
433
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
434
|
+
...defaultViewConfig,
|
|
435
|
+
showSpotterRadiance: true,
|
|
436
|
+
});
|
|
437
|
+
appEmbed.render();
|
|
438
|
+
await executeAfterWait(() => {
|
|
439
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=true${defaultParamsPost}#/home`);
|
|
440
|
+
});
|
|
441
|
+
});
|
|
442
|
+
test('should set showSpotterRadiance to false in url', async () => {
|
|
443
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
444
|
+
...defaultViewConfig,
|
|
445
|
+
showSpotterRadiance: false,
|
|
446
|
+
});
|
|
447
|
+
appEmbed.render();
|
|
448
|
+
await executeAfterWait(() => {
|
|
449
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=false${defaultParamsPost}#/home`);
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
test('should set defaultQueryMode to research in url', async () => {
|
|
453
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
454
|
+
...defaultViewConfig,
|
|
455
|
+
defaultQueryMode: SpotterQueryMode.RESEARCH,
|
|
456
|
+
});
|
|
457
|
+
appEmbed.render();
|
|
458
|
+
await executeAfterWait(() => {
|
|
459
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&defaultQueryMode=research${defaultParamsPost}#/home`);
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
test('should not set defaultQueryMode in url when unset', async () => {
|
|
463
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
464
|
+
...defaultViewConfig,
|
|
465
|
+
});
|
|
466
|
+
appEmbed.render();
|
|
467
|
+
await executeAfterWait(() => {
|
|
468
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false${defaultParamsPost}#/home`);
|
|
427
469
|
});
|
|
428
470
|
});
|
|
429
471
|
test('should set hideToolResponseCardBranding to true in url via spotterChatConfig', async () => {
|
|
@@ -435,7 +477,36 @@ describe('App embed tests', () => {
|
|
|
435
477
|
});
|
|
436
478
|
appEmbed.render();
|
|
437
479
|
await executeAfterWait(() => {
|
|
438
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true${defaultParamsPost}#/home`);
|
|
480
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
test('should set spotterDataSources to a list of Model GUIDs in url', async () => {
|
|
484
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
485
|
+
...defaultViewConfig,
|
|
486
|
+
spotterDataSources: ['model-guid-123', 'model-guid-456'],
|
|
487
|
+
});
|
|
488
|
+
appEmbed.render();
|
|
489
|
+
await executeAfterWait(() => {
|
|
490
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterDataSources=${encodeURIComponent(JSON.stringify(['model-guid-123', 'model-guid-456']))}${defaultParamsPost}#/home`);
|
|
491
|
+
});
|
|
492
|
+
});
|
|
493
|
+
test('should not add spotterDataSources to url when not provided', async () => {
|
|
494
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
495
|
+
...defaultViewConfig,
|
|
496
|
+
});
|
|
497
|
+
appEmbed.render();
|
|
498
|
+
await executeAfterWait(() => {
|
|
499
|
+
expect(getIFrameSrc()).not.toContain('spotterDataSources');
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
test('should not add spotterDataSources to url when empty array', async () => {
|
|
503
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
504
|
+
...defaultViewConfig,
|
|
505
|
+
spotterDataSources: [],
|
|
506
|
+
});
|
|
507
|
+
appEmbed.render();
|
|
508
|
+
await executeAfterWait(() => {
|
|
509
|
+
expect(getIFrameSrc()).not.toContain('spotterDataSources');
|
|
439
510
|
});
|
|
440
511
|
});
|
|
441
512
|
test('should include spotterVizConfig in APP_INIT embedParams when spotterViz is provided', async () => {
|
|
@@ -545,6 +616,83 @@ describe('App embed tests', () => {
|
|
|
545
616
|
});
|
|
546
617
|
});
|
|
547
618
|
});
|
|
619
|
+
test('should forward spotterChatPinConfig nested in spotterSidebarConfig in APP_INIT', async () => {
|
|
620
|
+
const spotterChatPinConfig = {
|
|
621
|
+
enabled: true,
|
|
622
|
+
pinLabel: 'Pin to top',
|
|
623
|
+
unpinLabel: 'Unpin',
|
|
624
|
+
};
|
|
625
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
626
|
+
...defaultViewConfig,
|
|
627
|
+
spotterSidebarConfig: {
|
|
628
|
+
enablePastConversationsSidebar: true,
|
|
629
|
+
spotterChatPinConfig,
|
|
630
|
+
},
|
|
631
|
+
});
|
|
632
|
+
mockMessageChannel();
|
|
633
|
+
appEmbed.render();
|
|
634
|
+
const mockPort = { postMessage: jest.fn() };
|
|
635
|
+
await executeAfterWait(() => {
|
|
636
|
+
postMessageToParent(getIFrameEl().contentWindow, { type: EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
637
|
+
});
|
|
638
|
+
await executeAfterWait(() => {
|
|
639
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
640
|
+
type: EmbedEvent.APP_INIT,
|
|
641
|
+
data: expect.objectContaining({
|
|
642
|
+
embedParams: expect.objectContaining({
|
|
643
|
+
spotterSidebarConfig: expect.objectContaining({
|
|
644
|
+
spotterChatPinConfig,
|
|
645
|
+
}),
|
|
646
|
+
}),
|
|
647
|
+
}),
|
|
648
|
+
});
|
|
649
|
+
});
|
|
650
|
+
});
|
|
651
|
+
test('should include spotterShareConversationConfig in APP_INIT embedParams when provided', async () => {
|
|
652
|
+
const spotterShareConversationConfig = {
|
|
653
|
+
enableShareConversation: true,
|
|
654
|
+
spotterShareLabel: 'Share',
|
|
655
|
+
spotterShareModalTitle: 'Share conversation',
|
|
656
|
+
};
|
|
657
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
658
|
+
...defaultViewConfig,
|
|
659
|
+
spotterShareConversationConfig,
|
|
660
|
+
});
|
|
661
|
+
mockMessageChannel();
|
|
662
|
+
appEmbed.render();
|
|
663
|
+
const mockPort = { postMessage: jest.fn() };
|
|
664
|
+
await executeAfterWait(() => {
|
|
665
|
+
postMessageToParent(getIFrameEl().contentWindow, { type: EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
666
|
+
});
|
|
667
|
+
await executeAfterWait(() => {
|
|
668
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
669
|
+
type: EmbedEvent.APP_INIT,
|
|
670
|
+
data: expect.objectContaining({
|
|
671
|
+
embedParams: expect.objectContaining({
|
|
672
|
+
spotterShareConversationConfig,
|
|
673
|
+
}),
|
|
674
|
+
}),
|
|
675
|
+
});
|
|
676
|
+
});
|
|
677
|
+
});
|
|
678
|
+
test('should not include spotterShareConversationConfig in APP_INIT when not provided', async () => {
|
|
679
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
680
|
+
...defaultViewConfig,
|
|
681
|
+
});
|
|
682
|
+
mockMessageChannel();
|
|
683
|
+
appEmbed.render();
|
|
684
|
+
const mockPort = { postMessage: jest.fn() };
|
|
685
|
+
await executeAfterWait(() => {
|
|
686
|
+
postMessageToParent(getIFrameEl().contentWindow, { type: EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
687
|
+
});
|
|
688
|
+
await executeAfterWait(() => {
|
|
689
|
+
const callArgs = mockPort.postMessage.mock.calls[0][0];
|
|
690
|
+
expect(callArgs.type).toBe(EmbedEvent.APP_INIT);
|
|
691
|
+
if (callArgs.data.embedParams) {
|
|
692
|
+
expect(callArgs.data.embedParams.spotterShareConversationConfig).toBeUndefined();
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
});
|
|
548
696
|
test('should set toolResponseCardBrandingLabel in url via spotterChatConfig', async () => {
|
|
549
697
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
550
698
|
...defaultViewConfig,
|
|
@@ -554,7 +702,7 @@ describe('App embed tests', () => {
|
|
|
554
702
|
});
|
|
555
703
|
appEmbed.render();
|
|
556
704
|
await executeAfterWait(() => {
|
|
557
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand${defaultParamsPost}#/home`);
|
|
705
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
558
706
|
});
|
|
559
707
|
});
|
|
560
708
|
test('should set spotterFileUploadEnabled to true in url', async () => {
|
|
@@ -564,7 +712,7 @@ describe('App embed tests', () => {
|
|
|
564
712
|
});
|
|
565
713
|
appEmbed.render();
|
|
566
714
|
await executeAfterWait(() => {
|
|
567
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true${defaultParamsPost}#/home`);
|
|
715
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
568
716
|
});
|
|
569
717
|
});
|
|
570
718
|
test('should set enableStarterPrompts to true in url', async () => {
|
|
@@ -596,7 +744,7 @@ describe('App embed tests', () => {
|
|
|
596
744
|
});
|
|
597
745
|
appEmbed.render();
|
|
598
746
|
await executeAfterWait(() => {
|
|
599
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false${defaultParamsPost}#/home`);
|
|
747
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
600
748
|
});
|
|
601
749
|
});
|
|
602
750
|
test('should set isGranularXLSXCSVSchedulesEnabled to true in url', async () => {
|
|
@@ -606,7 +754,7 @@ describe('App embed tests', () => {
|
|
|
606
754
|
});
|
|
607
755
|
appEmbed.render();
|
|
608
756
|
await executeAfterWait(() => {
|
|
609
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true${defaultParamsPost}#/home`);
|
|
757
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
610
758
|
});
|
|
611
759
|
});
|
|
612
760
|
test('should set isGranularXLSXCSVSchedulesEnabled to false in url', async () => {
|
|
@@ -616,7 +764,7 @@ describe('App embed tests', () => {
|
|
|
616
764
|
});
|
|
617
765
|
appEmbed.render();
|
|
618
766
|
await executeAfterWait(() => {
|
|
619
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false${defaultParamsPost}#/home`);
|
|
767
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
620
768
|
});
|
|
621
769
|
});
|
|
622
770
|
test('should set isCentralizedLiveboardFilterUXEnabled to true in url', async () => {
|
|
@@ -626,7 +774,7 @@ describe('App embed tests', () => {
|
|
|
626
774
|
});
|
|
627
775
|
appEmbed.render();
|
|
628
776
|
await executeAfterWait(() => {
|
|
629
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true${defaultParamsPost}#/home`);
|
|
777
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
630
778
|
});
|
|
631
779
|
});
|
|
632
780
|
test('should set isCentralizedLiveboardFilterUXEnabled to false in url', async () => {
|
|
@@ -636,7 +784,36 @@ describe('App embed tests', () => {
|
|
|
636
784
|
});
|
|
637
785
|
appEmbed.render();
|
|
638
786
|
await executeAfterWait(() => {
|
|
639
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false${defaultParamsPost}#/home`);
|
|
787
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
788
|
+
});
|
|
789
|
+
});
|
|
790
|
+
test('should set isScopedLiveboardFilteringEnabled to true in url', async () => {
|
|
791
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
792
|
+
...defaultViewConfig,
|
|
793
|
+
isScopedLiveboardFilteringEnabled: true,
|
|
794
|
+
});
|
|
795
|
+
appEmbed.render();
|
|
796
|
+
await executeAfterWait(() => {
|
|
797
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=true${defaultParamsPost}#/home`);
|
|
798
|
+
});
|
|
799
|
+
});
|
|
800
|
+
test('should set isScopedLiveboardFilteringEnabled to false in url', async () => {
|
|
801
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
802
|
+
...defaultViewConfig,
|
|
803
|
+
isScopedLiveboardFilteringEnabled: false,
|
|
804
|
+
});
|
|
805
|
+
appEmbed.render();
|
|
806
|
+
await executeAfterWait(() => {
|
|
807
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=false${defaultParamsPost}#/home`);
|
|
808
|
+
});
|
|
809
|
+
});
|
|
810
|
+
test('should not set isScopedLiveboardFilteringEnabled in url when undefined', async () => {
|
|
811
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
812
|
+
...defaultViewConfig,
|
|
813
|
+
});
|
|
814
|
+
appEmbed.render();
|
|
815
|
+
await executeAfterWait(() => {
|
|
816
|
+
expect(getIFrameSrc()).not.toContain('isScopedLiveboardFilteringEnabled');
|
|
640
817
|
});
|
|
641
818
|
});
|
|
642
819
|
test('Should add the tag to the iframe src', async () => {
|
|
@@ -647,7 +824,7 @@ describe('App embed tests', () => {
|
|
|
647
824
|
});
|
|
648
825
|
appEmbed.render();
|
|
649
826
|
await executeAfterWait(() => {
|
|
650
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&tag=Finance${defaultParamsPost}#/home`);
|
|
827
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&tag=Finance${defaultParamsPost}#/home`);
|
|
651
828
|
});
|
|
652
829
|
});
|
|
653
830
|
test('Should add the hideTagFilterChips true to the iframe src', async () => {
|
|
@@ -658,7 +835,7 @@ describe('App embed tests', () => {
|
|
|
658
835
|
});
|
|
659
836
|
appEmbed.render();
|
|
660
837
|
await executeAfterWait(() => {
|
|
661
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`);
|
|
838
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`);
|
|
662
839
|
});
|
|
663
840
|
});
|
|
664
841
|
test('Should add the hideTagFilterChips false to the iframe src', async () => {
|
|
@@ -669,7 +846,7 @@ describe('App embed tests', () => {
|
|
|
669
846
|
});
|
|
670
847
|
appEmbed.render();
|
|
671
848
|
await executeAfterWait(() => {
|
|
672
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`);
|
|
849
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`);
|
|
673
850
|
});
|
|
674
851
|
});
|
|
675
852
|
test('Should not add hideTagFilterChips if it is undefined', async () => {
|
|
@@ -679,7 +856,7 @@ describe('App embed tests', () => {
|
|
|
679
856
|
});
|
|
680
857
|
appEmbed.render();
|
|
681
858
|
await executeAfterWait(() => {
|
|
682
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`);
|
|
859
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
683
860
|
});
|
|
684
861
|
});
|
|
685
862
|
test('Should add showMaskedFilterChip true to the iframe src', async () => {
|
|
@@ -690,7 +867,7 @@ describe('App embed tests', () => {
|
|
|
690
867
|
});
|
|
691
868
|
appEmbed.render();
|
|
692
869
|
await executeAfterWait(() => {
|
|
693
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true${defaultParams}${defaultParamsPost}#/home`);
|
|
870
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
694
871
|
});
|
|
695
872
|
});
|
|
696
873
|
test('Should add showMaskedFilterChip false to the iframe src', async () => {
|
|
@@ -701,7 +878,7 @@ describe('App embed tests', () => {
|
|
|
701
878
|
});
|
|
702
879
|
appEmbed.render();
|
|
703
880
|
await executeAfterWait(() => {
|
|
704
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${defaultParams}${defaultParamsPost}#/home`);
|
|
881
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
705
882
|
});
|
|
706
883
|
});
|
|
707
884
|
test('Should add default showMaskedFilterChip false when not specified', async () => {
|
|
@@ -711,7 +888,7 @@ describe('App embed tests', () => {
|
|
|
711
888
|
});
|
|
712
889
|
appEmbed.render();
|
|
713
890
|
await executeAfterWait(() => {
|
|
714
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${defaultParams}${defaultParamsPost}#/home`);
|
|
891
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
715
892
|
});
|
|
716
893
|
});
|
|
717
894
|
test('Should add isLiveboardMasterpiecesEnabled true to the iframe src', async () => {
|
|
@@ -722,7 +899,7 @@ describe('App embed tests', () => {
|
|
|
722
899
|
});
|
|
723
900
|
appEmbed.render();
|
|
724
901
|
await executeAfterWait(() => {
|
|
725
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true${defaultParams}${defaultParamsPost}#/home`);
|
|
902
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
726
903
|
});
|
|
727
904
|
});
|
|
728
905
|
test('Should add isLiveboardMasterpiecesEnabled false to the iframe src', async () => {
|
|
@@ -733,17 +910,7 @@ describe('App embed tests', () => {
|
|
|
733
910
|
});
|
|
734
911
|
appEmbed.render();
|
|
735
912
|
await executeAfterWait(() => {
|
|
736
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${defaultParams}${defaultParamsPost}#/home`);
|
|
737
|
-
});
|
|
738
|
-
});
|
|
739
|
-
test('Should add default isLiveboardMasterpiecesEnabled false when not specified', async () => {
|
|
740
|
-
const appEmbed = new AppEmbed(getRootEl(), {
|
|
741
|
-
...defaultViewConfig,
|
|
742
|
-
showPrimaryNavbar: false,
|
|
743
|
-
});
|
|
744
|
-
appEmbed.render();
|
|
745
|
-
await executeAfterWait(() => {
|
|
746
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${defaultParams}${defaultParamsPost}#/home`);
|
|
913
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
747
914
|
});
|
|
748
915
|
});
|
|
749
916
|
test('Should add newChartsLibrary true to the iframe src', async () => {
|
|
@@ -754,7 +921,7 @@ describe('App embed tests', () => {
|
|
|
754
921
|
});
|
|
755
922
|
appEmbed.render();
|
|
756
923
|
await executeAfterWait(() => {
|
|
757
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true${defaultParams}${defaultParamsPost}#/home`);
|
|
924
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
758
925
|
});
|
|
759
926
|
});
|
|
760
927
|
test('Should add newChartsLibrary false to the iframe src', async () => {
|
|
@@ -765,7 +932,7 @@ describe('App embed tests', () => {
|
|
|
765
932
|
});
|
|
766
933
|
appEmbed.render();
|
|
767
934
|
await executeAfterWait(() => {
|
|
768
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false${defaultParams}${defaultParamsPost}#/home`);
|
|
935
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
769
936
|
});
|
|
770
937
|
});
|
|
771
938
|
test('Should not add newChartsLibrary to the iframe src when not specified', async () => {
|
|
@@ -775,7 +942,7 @@ describe('App embed tests', () => {
|
|
|
775
942
|
});
|
|
776
943
|
appEmbed.render();
|
|
777
944
|
await executeAfterWait(() => {
|
|
778
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`);
|
|
945
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
779
946
|
});
|
|
780
947
|
});
|
|
781
948
|
test('Should add enableSearchAssist flagto the iframe src', async () => {
|
|
@@ -785,7 +952,7 @@ describe('App embed tests', () => {
|
|
|
785
952
|
});
|
|
786
953
|
appEmbed.render();
|
|
787
954
|
await executeAfterWait(() => {
|
|
788
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true${defaultParams}${defaultParamsPost}#/home`);
|
|
955
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
789
956
|
});
|
|
790
957
|
});
|
|
791
958
|
test('Should add enableDataPanelV2 flag to the iframe src', async () => {
|
|
@@ -795,7 +962,7 @@ describe('App embed tests', () => {
|
|
|
795
962
|
});
|
|
796
963
|
appEmbed.render();
|
|
797
964
|
await executeAfterWait(() => {
|
|
798
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true${defaultParams}${defaultParamsPost}#/home`);
|
|
965
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
799
966
|
});
|
|
800
967
|
});
|
|
801
968
|
test('Should add isLiveboardHeaderSticky flag to the iframe src', async () => {
|
|
@@ -805,7 +972,7 @@ describe('App embed tests', () => {
|
|
|
805
972
|
});
|
|
806
973
|
appEmbed.render();
|
|
807
974
|
await executeAfterWait(() => {
|
|
808
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false${defaultParams}${defaultParamsPost}#/home`);
|
|
975
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
809
976
|
});
|
|
810
977
|
});
|
|
811
978
|
test('Should add isLiveboardCompactHeaderEnabled flag to the iframe src', async () => {
|
|
@@ -815,7 +982,7 @@ describe('App embed tests', () => {
|
|
|
815
982
|
});
|
|
816
983
|
appEmbed.render();
|
|
817
984
|
await executeAfterWait(() => {
|
|
818
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false${defaultParams}${defaultParamsPost}#/home`);
|
|
985
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
819
986
|
});
|
|
820
987
|
});
|
|
821
988
|
test('Should add showLiveboardReverifyBanner flag to the iframe src', async () => {
|
|
@@ -825,7 +992,7 @@ describe('App embed tests', () => {
|
|
|
825
992
|
});
|
|
826
993
|
appEmbed.render();
|
|
827
994
|
await executeAfterWait(() => {
|
|
828
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false${defaultParams}${defaultParamsPost}#/home`);
|
|
995
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
829
996
|
});
|
|
830
997
|
});
|
|
831
998
|
test('Should add isUnifiedSearchExperienceEnabled flag to the iframe src', async () => {
|
|
@@ -836,7 +1003,7 @@ describe('App embed tests', () => {
|
|
|
836
1003
|
});
|
|
837
1004
|
appEmbedTrue.render();
|
|
838
1005
|
await executeAfterWait(() => {
|
|
839
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1006
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
840
1007
|
});
|
|
841
1008
|
appEmbedTrue.destroy();
|
|
842
1009
|
// Case 2: explicitly false
|
|
@@ -846,7 +1013,7 @@ describe('App embed tests', () => {
|
|
|
846
1013
|
});
|
|
847
1014
|
appEmbedFalse.render();
|
|
848
1015
|
await executeAfterWait(() => {
|
|
849
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1016
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
850
1017
|
});
|
|
851
1018
|
appEmbedFalse.destroy();
|
|
852
1019
|
// Case 3: not provided — defaults to false
|
|
@@ -855,7 +1022,7 @@ describe('App embed tests', () => {
|
|
|
855
1022
|
});
|
|
856
1023
|
appEmbedDefault.render();
|
|
857
1024
|
await executeAfterWait(() => {
|
|
858
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1025
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
859
1026
|
});
|
|
860
1027
|
});
|
|
861
1028
|
test('should set newConnectionsExperience to true in url', async () => {
|
|
@@ -894,7 +1061,7 @@ describe('App embed tests', () => {
|
|
|
894
1061
|
});
|
|
895
1062
|
appEmbed.render();
|
|
896
1063
|
await executeAfterWait(() => {
|
|
897
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1064
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
898
1065
|
});
|
|
899
1066
|
});
|
|
900
1067
|
test('Should add showLiveboardVerifiedBadge flag to the iframe src', async () => {
|
|
@@ -904,7 +1071,7 @@ describe('App embed tests', () => {
|
|
|
904
1071
|
});
|
|
905
1072
|
appEmbed.render();
|
|
906
1073
|
await executeAfterWait(() => {
|
|
907
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1074
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
908
1075
|
});
|
|
909
1076
|
});
|
|
910
1077
|
test('Should add isLiveboardPermissionV2Enabled flag to the iframe src', async () => {
|
|
@@ -914,7 +1081,7 @@ describe('App embed tests', () => {
|
|
|
914
1081
|
});
|
|
915
1082
|
appEmbed.render();
|
|
916
1083
|
await executeAfterWait(() => {
|
|
917
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1084
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
918
1085
|
});
|
|
919
1086
|
});
|
|
920
1087
|
test('Should add default values of flags to the iframe src', async () => {
|
|
@@ -923,7 +1090,7 @@ describe('App embed tests', () => {
|
|
|
923
1090
|
});
|
|
924
1091
|
appEmbed.render();
|
|
925
1092
|
await executeAfterWait(() => {
|
|
926
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1093
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
927
1094
|
});
|
|
928
1095
|
});
|
|
929
1096
|
test('Should add modularHomeExperience flag to the iframe src', async () => {
|
|
@@ -933,7 +1100,7 @@ describe('App embed tests', () => {
|
|
|
933
1100
|
});
|
|
934
1101
|
appEmbed.render();
|
|
935
1102
|
await executeAfterWait(() => {
|
|
936
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1103
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
937
1104
|
});
|
|
938
1105
|
});
|
|
939
1106
|
test('Should add hideHomepageLeftNav flag to the iframe src', async () => {
|
|
@@ -943,7 +1110,7 @@ describe('App embed tests', () => {
|
|
|
943
1110
|
});
|
|
944
1111
|
appEmbed.render();
|
|
945
1112
|
await executeAfterWait(() => {
|
|
946
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1113
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHomepageLeftNav=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
947
1114
|
});
|
|
948
1115
|
});
|
|
949
1116
|
test('Should add hideHamburger, hideObjectSearch, hideNotification flags to the iframe src', async () => {
|
|
@@ -955,7 +1122,7 @@ describe('App embed tests', () => {
|
|
|
955
1122
|
});
|
|
956
1123
|
appEmbed.render();
|
|
957
1124
|
await executeAfterWait(() => {
|
|
958
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1125
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
959
1126
|
});
|
|
960
1127
|
});
|
|
961
1128
|
test('Should not add when hideHamburger, hideObjectSearch, hideNotification values are not true to the iframe src', async () => {
|
|
@@ -967,65 +1134,14 @@ describe('App embed tests', () => {
|
|
|
967
1134
|
});
|
|
968
1135
|
appEmbed.render();
|
|
969
1136
|
await executeAfterWait(() => {
|
|
970
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1137
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
971
1138
|
});
|
|
972
1139
|
});
|
|
973
|
-
test('Should add navigationVersion=v3 when primaryNavbarVersion is Sliding to the iframe src', async () => {
|
|
974
|
-
await testUrlParams({
|
|
975
|
-
...defaultViewConfig,
|
|
976
|
-
discoveryExperience: {
|
|
977
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
978
|
-
homePage: HomePage.Modular,
|
|
979
|
-
},
|
|
980
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
981
|
-
});
|
|
982
|
-
test('Should not add navigationVersion=v3 when primaryNavbarVersion is not added to the iframe src', async () => {
|
|
983
|
-
await testUrlParams({
|
|
984
|
-
...defaultViewConfig,
|
|
985
|
-
discoveryExperience: {
|
|
986
|
-
homePage: HomePage.Modular,
|
|
987
|
-
},
|
|
988
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`);
|
|
989
|
-
});
|
|
990
|
-
test('Should add navigationVersion=v3 & modularHomeExperience=true when primaryNavbarVersion is Sliding to the iframe src', async () => {
|
|
991
|
-
await testUrlParams({
|
|
992
|
-
...defaultViewConfig,
|
|
993
|
-
// homePage v2 config not included under discoveryExperience
|
|
994
|
-
discoveryExperience: {
|
|
995
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
996
|
-
},
|
|
997
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
998
|
-
});
|
|
999
|
-
test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when Sliding and ModularWithStylingChanges configured in the iframe src', async () => {
|
|
1000
|
-
await testUrlParams({
|
|
1001
|
-
...defaultViewConfig,
|
|
1002
|
-
discoveryExperience: {
|
|
1003
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
1004
|
-
homePage: HomePage.ModularWithStylingChanges,
|
|
1005
|
-
},
|
|
1006
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1007
|
-
});
|
|
1008
|
-
test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when homePage is ModularWithStylingChanges to the iframe src', async () => {
|
|
1009
|
-
await testUrlParams({
|
|
1010
|
-
...defaultViewConfig,
|
|
1011
|
-
// primaryNavbarVersion is not included under
|
|
1012
|
-
// discoveryExperience, then it set navigationVersion=v2 and
|
|
1013
|
-
// modularHomeExperience=false.
|
|
1014
|
-
discoveryExperience: {
|
|
1015
|
-
homePage: HomePage.ModularWithStylingChanges,
|
|
1016
|
-
},
|
|
1017
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1018
|
-
});
|
|
1019
|
-
test('Should add navigationVersion=v2 when primaryNavbarVersion is not added to the iframe src', async () => {
|
|
1020
|
-
await testUrlParams({
|
|
1021
|
-
...defaultViewConfig,
|
|
1022
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2${defaultParams}${defaultParamsPost}#/home`);
|
|
1023
|
-
});
|
|
1024
1140
|
test('Should add enableAskSage flag to the iframe src', async () => {
|
|
1025
1141
|
await testUrlParams({
|
|
1026
1142
|
...defaultViewConfig,
|
|
1027
1143
|
enableAskSage: true,
|
|
1028
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1144
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableAskSage=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1029
1145
|
});
|
|
1030
1146
|
test('Should add listpageVersion=v3 when listPageVersion is ListWithUXChanges to the iframe src', async () => {
|
|
1031
1147
|
await testUrlParams({
|
|
@@ -1033,31 +1149,30 @@ describe('App embed tests', () => {
|
|
|
1033
1149
|
discoveryExperience: {
|
|
1034
1150
|
listPageVersion: ListPage.ListWithUXChanges,
|
|
1035
1151
|
},
|
|
1036
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1152
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&listpageVersion=v3&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1037
1153
|
});
|
|
1038
|
-
test('Should
|
|
1154
|
+
test('Should send navigationVersion=v3 & homepageVersion=v3 by default when no discoveryExperience is provided', async () => {
|
|
1039
1155
|
await testUrlParams({
|
|
1040
1156
|
...defaultViewConfig,
|
|
1041
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1157
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1042
1158
|
});
|
|
1043
|
-
test('Should
|
|
1044
|
-
|
|
1159
|
+
test('Should not send modularHomeExperience param by default when not specified', async () => {
|
|
1160
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1045
1161
|
...defaultViewConfig,
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1162
|
+
});
|
|
1163
|
+
appEmbed.render();
|
|
1164
|
+
await executeAfterWait(() => {
|
|
1165
|
+
const url = new URL(getIFrameSrc());
|
|
1166
|
+
expect(url.searchParams.has('modularHomeExperience')).toBe(false);
|
|
1167
|
+
});
|
|
1051
1168
|
});
|
|
1052
1169
|
test('Should add listpageVersion=v3 combined with other discoveryExperience options to the iframe src', async () => {
|
|
1053
1170
|
await testUrlParams({
|
|
1054
1171
|
...defaultViewConfig,
|
|
1055
1172
|
discoveryExperience: {
|
|
1056
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
1057
|
-
homePage: HomePage.Modular,
|
|
1058
1173
|
listPageVersion: ListPage.ListWithUXChanges,
|
|
1059
1174
|
},
|
|
1060
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1175
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1061
1176
|
});
|
|
1062
1177
|
test('Should add enablePendoHelp flag to the iframe src conditional on navbar', async () => {
|
|
1063
1178
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
@@ -1065,7 +1180,7 @@ describe('App embed tests', () => {
|
|
|
1065
1180
|
});
|
|
1066
1181
|
appEmbed.render();
|
|
1067
1182
|
await executeAfterWait(() => {
|
|
1068
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1183
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1069
1184
|
});
|
|
1070
1185
|
const noNavEmbed = new AppEmbed(getRootEl(), {
|
|
1071
1186
|
...defaultViewConfig,
|
|
@@ -1073,7 +1188,7 @@ describe('App embed tests', () => {
|
|
|
1073
1188
|
});
|
|
1074
1189
|
noNavEmbed.render();
|
|
1075
1190
|
await executeAfterWait(() => {
|
|
1076
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1191
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1077
1192
|
});
|
|
1078
1193
|
});
|
|
1079
1194
|
test('should set enableLiveboardDataCache to true in url', async () => {
|
|
@@ -1083,7 +1198,7 @@ describe('App embed tests', () => {
|
|
|
1083
1198
|
});
|
|
1084
1199
|
appEmbed.render();
|
|
1085
1200
|
await executeAfterWait(() => {
|
|
1086
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true${defaultParamsPost}#/home`);
|
|
1201
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
1087
1202
|
});
|
|
1088
1203
|
});
|
|
1089
1204
|
test('should set enableLiveboardDataCache to false in url', async () => {
|
|
@@ -1093,7 +1208,7 @@ describe('App embed tests', () => {
|
|
|
1093
1208
|
});
|
|
1094
1209
|
appEmbed.render();
|
|
1095
1210
|
await executeAfterWait(() => {
|
|
1096
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false${defaultParamsPost}#/home`);
|
|
1211
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
1097
1212
|
});
|
|
1098
1213
|
});
|
|
1099
1214
|
test('should not set enableLiveboardDataCache in url when not provided', async () => {
|
|
@@ -1112,7 +1227,7 @@ describe('App embed tests', () => {
|
|
|
1112
1227
|
});
|
|
1113
1228
|
await appEmbed.render();
|
|
1114
1229
|
await executeAfterWait(() => {
|
|
1115
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1230
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=objectSearch&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1116
1231
|
});
|
|
1117
1232
|
});
|
|
1118
1233
|
test('Should add HomePageSearchBarMode flag with ai answer to the iframe src', async () => {
|
|
@@ -1122,7 +1237,7 @@ describe('App embed tests', () => {
|
|
|
1122
1237
|
});
|
|
1123
1238
|
await appEmbed.render();
|
|
1124
1239
|
await executeAfterWait(() => {
|
|
1125
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1240
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=aiAnswer&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1126
1241
|
});
|
|
1127
1242
|
});
|
|
1128
1243
|
test('Should add HomePageSearchBarMode flag with none to the iframe src', async () => {
|
|
@@ -1132,7 +1247,7 @@ describe('App embed tests', () => {
|
|
|
1132
1247
|
});
|
|
1133
1248
|
await appEmbed.render();
|
|
1134
1249
|
await executeAfterWait(() => {
|
|
1135
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1250
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=none&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1136
1251
|
});
|
|
1137
1252
|
});
|
|
1138
1253
|
test('Should add dataPanelCustomGroupsAccordionInitialState flag to the iframe src', async () => {
|
|
@@ -1142,7 +1257,7 @@ describe('App embed tests', () => {
|
|
|
1142
1257
|
});
|
|
1143
1258
|
appEmbed.render();
|
|
1144
1259
|
await executeAfterWait(() => {
|
|
1145
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1260
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1146
1261
|
});
|
|
1147
1262
|
});
|
|
1148
1263
|
test('should register event handlers to adjust iframe height', async () => {
|
|
@@ -1194,7 +1309,7 @@ describe('App embed tests', () => {
|
|
|
1194
1309
|
});
|
|
1195
1310
|
await appEmbed.render();
|
|
1196
1311
|
appEmbed.navigateToPage(path);
|
|
1197
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1312
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1198
1313
|
});
|
|
1199
1314
|
test('navigateToPage with noReload should trigger the appropriate event', async () => {
|
|
1200
1315
|
mockMessageChannel();
|
|
@@ -1242,6 +1357,85 @@ describe('App embed tests', () => {
|
|
|
1242
1357
|
await appEmbed.render();
|
|
1243
1358
|
expect(logger.log).toHaveBeenCalledWith('Please call render before invoking this method');
|
|
1244
1359
|
});
|
|
1360
|
+
describe('overrideHistoryState flag', () => {
|
|
1361
|
+
test('navigateToPage with overrideHistoryState=true should trigger HostEvent.Navigate', async () => {
|
|
1362
|
+
mockMessageChannel();
|
|
1363
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1364
|
+
frameParams: {
|
|
1365
|
+
width: '100%',
|
|
1366
|
+
height: '100%',
|
|
1367
|
+
},
|
|
1368
|
+
overrideHistoryState: true,
|
|
1369
|
+
});
|
|
1370
|
+
await appEmbed.render();
|
|
1371
|
+
const iframe = getIFrameEl();
|
|
1372
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1373
|
+
appEmbed.navigateToPage(path, false);
|
|
1374
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
1375
|
+
type: HostEvent.Navigate,
|
|
1376
|
+
data: path,
|
|
1377
|
+
}), `http://${thoughtSpotHost}`, expect.anything());
|
|
1378
|
+
});
|
|
1379
|
+
test('navigateToPage with overrideHistoryState=true and path as number should trigger HostEvent.Navigate', async () => {
|
|
1380
|
+
mockMessageChannel();
|
|
1381
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1382
|
+
frameParams: {
|
|
1383
|
+
width: '100%',
|
|
1384
|
+
height: '100%',
|
|
1385
|
+
},
|
|
1386
|
+
overrideHistoryState: true,
|
|
1387
|
+
});
|
|
1388
|
+
await appEmbed.render();
|
|
1389
|
+
const iframe = getIFrameEl();
|
|
1390
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1391
|
+
appEmbed.navigateToPage(-1, false);
|
|
1392
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
1393
|
+
type: HostEvent.Navigate,
|
|
1394
|
+
data: -1,
|
|
1395
|
+
}), `http://${thoughtSpotHost}`, expect.anything());
|
|
1396
|
+
});
|
|
1397
|
+
test('navigateToPage with overrideHistoryState=false and noReload=false should update iframe src', async () => {
|
|
1398
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1399
|
+
frameParams: {
|
|
1400
|
+
width: '100%',
|
|
1401
|
+
height: '100%',
|
|
1402
|
+
},
|
|
1403
|
+
overrideHistoryState: false,
|
|
1404
|
+
});
|
|
1405
|
+
await appEmbed.render();
|
|
1406
|
+
appEmbed.navigateToPage(path, false);
|
|
1407
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1408
|
+
});
|
|
1409
|
+
test('navigateToPage with overrideHistoryState=undefined and noReload=false should update iframe src', async () => {
|
|
1410
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1411
|
+
frameParams: {
|
|
1412
|
+
width: '100%',
|
|
1413
|
+
height: '100%',
|
|
1414
|
+
},
|
|
1415
|
+
});
|
|
1416
|
+
await appEmbed.render();
|
|
1417
|
+
appEmbed.navigateToPage(path, false);
|
|
1418
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1419
|
+
});
|
|
1420
|
+
test('navigateToPage respects noReload priority over overrideHistoryState', async () => {
|
|
1421
|
+
mockMessageChannel();
|
|
1422
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1423
|
+
frameParams: {
|
|
1424
|
+
width: '100%',
|
|
1425
|
+
height: '100%',
|
|
1426
|
+
},
|
|
1427
|
+
overrideHistoryState: false,
|
|
1428
|
+
});
|
|
1429
|
+
await appEmbed.render();
|
|
1430
|
+
const iframe = getIFrameEl();
|
|
1431
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1432
|
+
appEmbed.navigateToPage(path, true);
|
|
1433
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
1434
|
+
type: HostEvent.Navigate,
|
|
1435
|
+
data: path,
|
|
1436
|
+
}), `http://${thoughtSpotHost}`, expect.anything());
|
|
1437
|
+
});
|
|
1438
|
+
});
|
|
1245
1439
|
});
|
|
1246
1440
|
describe('LazyLoadingForFullHeight functionality', () => {
|
|
1247
1441
|
let mockIFrame;
|
|
@@ -1743,4 +1937,80 @@ describe('AppEmbed visualOverrides tests', () => {
|
|
|
1743
1937
|
await testVisualOverridesInEmbed(appEmbed, visualOverrides);
|
|
1744
1938
|
});
|
|
1745
1939
|
});
|
|
1940
|
+
describe('AppEmbed getEmbedParamsObject', () => {
|
|
1941
|
+
beforeEach(() => {
|
|
1942
|
+
cleanUp();
|
|
1943
|
+
jest.spyOn(TsEmbed.prototype, 'getAppInitData').mockResolvedValue({});
|
|
1944
|
+
});
|
|
1945
|
+
afterEach(() => {
|
|
1946
|
+
jest.restoreAllMocks();
|
|
1947
|
+
});
|
|
1948
|
+
test('getEmbedParams should use getEmbedParamsObject internally', async () => {
|
|
1949
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1950
|
+
...defaultViewConfig,
|
|
1951
|
+
fullHeight: true,
|
|
1952
|
+
});
|
|
1953
|
+
const getEmbedParamsObjectSpy = jest.spyOn(appEmbed, 'getEmbedParamsObject');
|
|
1954
|
+
await appEmbed.render();
|
|
1955
|
+
expect(getEmbedParamsObjectSpy).toHaveBeenCalled();
|
|
1956
|
+
});
|
|
1957
|
+
test('getEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', () => {
|
|
1958
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1959
|
+
...defaultViewConfig,
|
|
1960
|
+
fullHeight: true,
|
|
1961
|
+
});
|
|
1962
|
+
const params = appEmbed.getEmbedParamsObject();
|
|
1963
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
1964
|
+
expect(params.fullHeight).toBeUndefined();
|
|
1965
|
+
});
|
|
1966
|
+
test('getEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', () => {
|
|
1967
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1968
|
+
...defaultViewConfig,
|
|
1969
|
+
fullHeight: false,
|
|
1970
|
+
});
|
|
1971
|
+
const params = appEmbed.getEmbedParamsObject();
|
|
1972
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
1973
|
+
});
|
|
1974
|
+
test('getUpdateEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', async () => {
|
|
1975
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1976
|
+
...defaultViewConfig,
|
|
1977
|
+
fullHeight: true,
|
|
1978
|
+
});
|
|
1979
|
+
const params = await appEmbed.getUpdateEmbedParamsObject();
|
|
1980
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
1981
|
+
});
|
|
1982
|
+
test('getUpdateEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', async () => {
|
|
1983
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1984
|
+
...defaultViewConfig,
|
|
1985
|
+
fullHeight: false,
|
|
1986
|
+
});
|
|
1987
|
+
const params = await appEmbed.getUpdateEmbedParamsObject();
|
|
1988
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
1989
|
+
});
|
|
1990
|
+
});
|
|
1991
|
+
describe('AppEmbed updatedSpotterExperience tests', () => {
|
|
1992
|
+
beforeEach(() => {
|
|
1993
|
+
cleanUp();
|
|
1994
|
+
});
|
|
1995
|
+
test('should set updatedSpotterExperience to true in url', async () => {
|
|
1996
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1997
|
+
...defaultViewConfig,
|
|
1998
|
+
updatedSpotterExperience: true,
|
|
1999
|
+
});
|
|
2000
|
+
appEmbed.render();
|
|
2001
|
+
await executeAfterWait(() => {
|
|
2002
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
2003
|
+
});
|
|
2004
|
+
});
|
|
2005
|
+
test('should set updatedSpotterExperience to false in url', async () => {
|
|
2006
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2007
|
+
...defaultViewConfig,
|
|
2008
|
+
updatedSpotterExperience: false,
|
|
2009
|
+
});
|
|
2010
|
+
appEmbed.render();
|
|
2011
|
+
await executeAfterWait(() => {
|
|
2012
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
2013
|
+
});
|
|
2014
|
+
});
|
|
2015
|
+
});
|
|
1746
2016
|
//# sourceMappingURL=app.spec.js.map
|