@thoughtspot/visual-embed-sdk 1.50.0 → 1.51.0-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/config.d.ts +1 -0
- package/cjs/src/config.d.ts.map +1 -1
- package/cjs/src/config.js +2 -1
- package/cjs/src/config.js.map +1 -1
- package/cjs/src/css-variables.d.ts +122 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +176 -24
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +86 -38
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +672 -150
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +1 -1
- package/cjs/src/embed/base.js +1 -1
- package/cjs/src/embed/conversation.d.ts +401 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +32 -16
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +346 -17
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +638 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/host-events.spec.js +187 -0
- package/cjs/src/embed/host-events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +51 -14
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +11 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +2 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +9 -0
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +236 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.js +32 -2
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.spec.js +178 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +81 -13
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +50 -9
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +432 -4
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +15 -1
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-utils.js +28 -1
- package/cjs/src/embed/spotter-utils.js.map +1 -1
- package/cjs/src/embed/spotter-utils.spec.js +129 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.d.ts +37 -4
- package/cjs/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.js.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.spec.js +17 -0
- package/cjs/src/embed/spotter-viz-utils.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +16 -8
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +96 -37
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +683 -3
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +4 -2
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts +4 -0
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +4 -0
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/all-types-export.parity.spec.d.ts +2 -0
- package/cjs/src/react/all-types-export.parity.spec.d.ts.map +1 -0
- package/cjs/src/react/all-types-export.parity.spec.js +194 -0
- package/cjs/src/react/all-types-export.parity.spec.js.map +1 -0
- package/cjs/src/react/index.d.ts +66 -32
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +5 -3
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +101 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/react/util.spec.js +251 -0
- package/cjs/src/react/util.spec.js.map +1 -1
- package/cjs/src/types.d.ts +902 -28
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +701 -14
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +93 -0
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/cjs/src/utils/processTrigger.spec.js +61 -0
- package/cjs/src/utils/processTrigger.spec.js.map +1 -1
- package/cjs/src/utils.spec.js +4 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-B5xoN6Cp.js → index-Bivg-mDx.js} +1 -1
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +122 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +176 -24
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +1 -1
- package/dist/src/embed/conversation.d.ts +401 -2
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +51 -14
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +2 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +2 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +81 -13
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +15 -1
- package/dist/src/embed/spotter-utils.d.ts.map +1 -1
- package/dist/src/embed/spotter-viz-utils.d.ts +37 -4
- package/dist/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +16 -8
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +4 -0
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/all-types-export.parity.spec.d.ts +2 -0
- package/dist/src/react/all-types-export.parity.spec.d.ts.map +1 -0
- package/dist/src/react/index.d.ts +66 -32
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +902 -28
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +1269 -206
- package/dist/tsembed-react.js +1268 -205
- package/dist/tsembed.es.js +1364 -304
- package/dist/tsembed.js +1362 -302
- package/dist/visual-embed-sdk-react-full.d.ts +1867 -157
- package/dist/visual-embed-sdk-react.d.ts +1872 -161
- package/dist/visual-embed-sdk.d.ts +1815 -127
- package/lib/package.json +1 -1
- package/lib/src/config.d.ts +1 -0
- package/lib/src/config.d.ts.map +1 -1
- package/lib/src/config.js +1 -0
- package/lib/src/config.js.map +1 -1
- package/lib/src/css-variables.d.ts +122 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +176 -24
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +87 -39
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +673 -151
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -1
- package/lib/src/embed/base.js +1 -1
- package/lib/src/embed/conversation.d.ts +401 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +33 -17
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +347 -18
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +638 -0
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/host-events.spec.js +188 -1
- package/lib/src/embed/host-events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +51 -14
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +10 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +2 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +10 -1
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +236 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +2 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/utils.js +28 -1
- package/lib/src/embed/hostEventClient/utils.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.spec.js +179 -1
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +81 -13
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +50 -9
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +432 -4
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +15 -1
- package/lib/src/embed/spotter-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-utils.js +25 -0
- package/lib/src/embed/spotter-utils.js.map +1 -1
- package/lib/src/embed/spotter-utils.spec.js +130 -1
- package/lib/src/embed/spotter-utils.spec.js.map +1 -1
- package/lib/src/embed/spotter-viz-utils.d.ts +37 -4
- package/lib/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-viz-utils.js.map +1 -1
- package/lib/src/embed/spotter-viz-utils.spec.js +17 -0
- package/lib/src/embed/spotter-viz-utils.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +16 -8
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +96 -37
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +683 -3
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +3 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +3 -3
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +4 -0
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +4 -0
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/all-types-export.parity.spec.d.ts +2 -0
- package/lib/src/react/all-types-export.parity.spec.d.ts.map +1 -0
- package/lib/src/react/all-types-export.parity.spec.js +191 -0
- package/lib/src/react/all-types-export.parity.spec.js.map +1 -0
- package/lib/src/react/index.d.ts +66 -32
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +5 -3
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +102 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/react/util.spec.js +251 -0
- package/lib/src/react/util.spec.js.map +1 -1
- package/lib/src/types.d.ts +902 -28
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +701 -14
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.spec.js +93 -0
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/utils/processTrigger.spec.js +61 -0
- package/lib/src/utils/processTrigger.spec.js.map +1 -1
- package/lib/src/utils.spec.js +4 -0
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1815 -127
- package/package.json +1 -1
- package/src/config.ts +1 -0
- package/src/css-variables.ts +150 -0
- package/src/embed/app.spec.ts +877 -196
- package/src/embed/app.ts +276 -75
- package/src/embed/base.ts +1 -1
- package/src/embed/conversation.spec.ts +411 -21
- package/src/embed/conversation.ts +441 -18
- package/src/embed/events.spec.ts +761 -1
- package/src/embed/host-events.spec.ts +242 -0
- package/src/embed/hostEventClient/contracts.ts +57 -14
- package/src/embed/hostEventClient/host-event-client.spec.ts +372 -0
- package/src/embed/hostEventClient/host-event-client.ts +18 -2
- package/src/embed/hostEventClient/utils.spec.ts +204 -0
- package/src/embed/hostEventClient/utils.ts +37 -10
- package/src/embed/liveboard.spec.ts +565 -4
- package/src/embed/liveboard.ts +155 -28
- package/src/embed/spotter-utils.spec.ts +140 -1
- package/src/embed/spotter-utils.ts +36 -1
- package/src/embed/spotter-viz-utils.spec.ts +17 -0
- package/src/embed/spotter-viz-utils.ts +37 -4
- package/src/embed/ts-embed.spec.ts +885 -3
- package/src/embed/ts-embed.ts +111 -39
- package/src/errors.ts +1 -0
- package/src/index.ts +45 -2
- package/src/mixpanel-service.ts +4 -0
- package/src/react/all-types-export.parity.spec.ts +208 -0
- package/src/react/all-types-export.ts +22 -0
- package/src/react/index.spec.tsx +158 -0
- package/src/react/index.tsx +70 -33
- package/src/react/util.spec.tsx +255 -0
- package/src/types.ts +904 -24
- package/src/utils/processData.spec.ts +97 -0
- package/src/utils/processTrigger.spec.ts +91 -0
- package/src/utils.spec.ts +5 -0
|
@@ -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,8 @@ 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',
|
|
155
|
+
[Page.LiveboardSchedules]: 'home/liveboard-schedules',
|
|
153
156
|
};
|
|
154
157
|
const pageIds = Object.keys(pageRouteMap);
|
|
155
158
|
for (let i = 0; i < pageIds.length; i++) {
|
|
@@ -162,7 +165,7 @@ describe('App embed tests', () => {
|
|
|
162
165
|
});
|
|
163
166
|
appEmbed.render();
|
|
164
167
|
await executeAfterWait(() => {
|
|
165
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`);
|
|
168
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`);
|
|
166
169
|
cleanUp();
|
|
167
170
|
});
|
|
168
171
|
});
|
|
@@ -176,6 +179,8 @@ describe('App embed tests', () => {
|
|
|
176
179
|
[Page.Home]: 'home',
|
|
177
180
|
[Page.SpotIQ]: 'home/spotiq-analysis',
|
|
178
181
|
[Page.Monitor]: 'home/monitor-alerts',
|
|
182
|
+
[Page.Collections]: 'collections',
|
|
183
|
+
[Page.LiveboardSchedules]: 'home/liveboard-schedules',
|
|
179
184
|
};
|
|
180
185
|
const pageIdsForModularHomes = Object.keys(pageRouteMapForModularHome);
|
|
181
186
|
for (let i = 0; i < pageIdsForModularHomes.length; i++) {
|
|
@@ -189,7 +194,7 @@ describe('App embed tests', () => {
|
|
|
189
194
|
});
|
|
190
195
|
appEmbed.render();
|
|
191
196
|
await executeAfterWait(() => {
|
|
192
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/${route}`);
|
|
197
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/${route}`);
|
|
193
198
|
cleanUp();
|
|
194
199
|
});
|
|
195
200
|
});
|
|
@@ -202,7 +207,7 @@ describe('App embed tests', () => {
|
|
|
202
207
|
});
|
|
203
208
|
appEmbed.render();
|
|
204
209
|
await executeAfterWait(() => {
|
|
205
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/foo/bar`);
|
|
210
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/foo/bar`);
|
|
206
211
|
});
|
|
207
212
|
});
|
|
208
213
|
test('should apply runtime filters', async () => {
|
|
@@ -220,7 +225,7 @@ describe('App embed tests', () => {
|
|
|
220
225
|
});
|
|
221
226
|
appEmbed.render();
|
|
222
227
|
await executeAfterWait(() => {
|
|
223
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000${defaultParams}${defaultParamsPost}#/home`);
|
|
228
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
224
229
|
});
|
|
225
230
|
});
|
|
226
231
|
test('should not append runtime filters in URL if excludeRuntimeFiltersfromURL is true', async () => {
|
|
@@ -238,7 +243,7 @@ describe('App embed tests', () => {
|
|
|
238
243
|
});
|
|
239
244
|
appEmbed.render();
|
|
240
245
|
await executeAfterWait(() => {
|
|
241
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`);
|
|
246
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
242
247
|
});
|
|
243
248
|
});
|
|
244
249
|
test('should append runtime filters in URL if excludeRuntimeFiltersfromURL is undefined', async () => {
|
|
@@ -257,7 +262,7 @@ describe('App embed tests', () => {
|
|
|
257
262
|
appEmbed.render();
|
|
258
263
|
const runtimeFilter = 'col1=sales&op1=EQ&val1=1000';
|
|
259
264
|
await executeAfterWait(() => {
|
|
260
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`);
|
|
265
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`);
|
|
261
266
|
});
|
|
262
267
|
});
|
|
263
268
|
test('should disable and hide actions', async () => {
|
|
@@ -270,7 +275,7 @@ describe('App embed tests', () => {
|
|
|
270
275
|
});
|
|
271
276
|
appEmbed.render();
|
|
272
277
|
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`);
|
|
278
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`);
|
|
274
279
|
});
|
|
275
280
|
});
|
|
276
281
|
test('should set enable2ColumnLayout to true in url', async () => {
|
|
@@ -280,7 +285,17 @@ describe('App embed tests', () => {
|
|
|
280
285
|
});
|
|
281
286
|
appEmbed.render();
|
|
282
287
|
await executeAfterWait(() => {
|
|
283
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`);
|
|
288
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
test('should set isLiveboardAlwaysOn12ColLayout to true in url', async () => {
|
|
292
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
293
|
+
...defaultViewConfig,
|
|
294
|
+
isLiveboardAlwaysOn12ColLayout: true,
|
|
295
|
+
});
|
|
296
|
+
appEmbed.render();
|
|
297
|
+
await executeAfterWait(() => {
|
|
298
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardAlwaysOn12ColLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
284
299
|
});
|
|
285
300
|
});
|
|
286
301
|
test('should set coverAndFilterOptionInPDF to false in url', async () => {
|
|
@@ -290,7 +305,7 @@ describe('App embed tests', () => {
|
|
|
290
305
|
});
|
|
291
306
|
appEmbed.render();
|
|
292
307
|
await executeAfterWait(() => {
|
|
293
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false${defaultParamsPost}#/home`);
|
|
308
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
294
309
|
});
|
|
295
310
|
});
|
|
296
311
|
test('should set isLiveboardStylingAndGroupingEnabled to true in url (deprecated, use isLiveboardMasterpiecesEnabled)', async () => {
|
|
@@ -300,7 +315,17 @@ describe('App embed tests', () => {
|
|
|
300
315
|
});
|
|
301
316
|
appEmbed.render();
|
|
302
317
|
await executeAfterWait(() => {
|
|
303
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true${defaultParamsPost}#/home`);
|
|
318
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
test('should set liveboardGutter in url', async () => {
|
|
322
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
323
|
+
...defaultViewConfig,
|
|
324
|
+
liveboardGutter: 8,
|
|
325
|
+
});
|
|
326
|
+
appEmbed.render();
|
|
327
|
+
await executeAfterWait(() => {
|
|
328
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&liveboardGutter=8&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
304
329
|
});
|
|
305
330
|
});
|
|
306
331
|
test('should set isThisPeriodInDateFiltersEnabled to true in url', async () => {
|
|
@@ -310,7 +335,7 @@ describe('App embed tests', () => {
|
|
|
310
335
|
});
|
|
311
336
|
appEmbed.render();
|
|
312
337
|
await executeAfterWait(() => {
|
|
313
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true${defaultParamsPost}#/home`);
|
|
338
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
314
339
|
});
|
|
315
340
|
});
|
|
316
341
|
test('should set enableHomepageAnnouncement to true in url', async () => {
|
|
@@ -320,14 +345,14 @@ describe('App embed tests', () => {
|
|
|
320
345
|
});
|
|
321
346
|
appEmbed.render();
|
|
322
347
|
await executeAfterWait(() => {
|
|
323
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true${defaultParamsPost}#/home`);
|
|
348
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
324
349
|
});
|
|
325
350
|
});
|
|
326
351
|
test('should set enableHomepageAnnouncement to false in url when not provided in AppViewConfig', async () => {
|
|
327
352
|
const appEmbed = new AppEmbed(getRootEl(), defaultViewConfig);
|
|
328
353
|
appEmbed.render();
|
|
329
354
|
await executeAfterWait(() => {
|
|
330
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false${defaultParamsPost}#/home`);
|
|
355
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
331
356
|
});
|
|
332
357
|
});
|
|
333
358
|
test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
|
|
@@ -337,7 +362,7 @@ describe('App embed tests', () => {
|
|
|
337
362
|
});
|
|
338
363
|
appEmbed.render();
|
|
339
364
|
await executeAfterWait(() => {
|
|
340
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`);
|
|
365
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
341
366
|
});
|
|
342
367
|
});
|
|
343
368
|
test('should set isWYSIWYGLiveboardPDFEnabled to true in url', async () => {
|
|
@@ -347,16 +372,16 @@ describe('App embed tests', () => {
|
|
|
347
372
|
});
|
|
348
373
|
appEmbed.render();
|
|
349
374
|
await executeAfterWait(() => {
|
|
350
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true${defaultParamsPost}#/home`);
|
|
375
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
351
376
|
});
|
|
352
377
|
});
|
|
353
|
-
test('should
|
|
378
|
+
test('should not set isWYSIWYGLiveboardPDFEnabled in url by default', async () => {
|
|
354
379
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
355
380
|
...defaultViewConfig,
|
|
356
381
|
});
|
|
357
382
|
appEmbed.render();
|
|
358
383
|
await executeAfterWait(() => {
|
|
359
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
384
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
360
385
|
});
|
|
361
386
|
});
|
|
362
387
|
test('should set isLinkParametersEnabled to true in url', async () => {
|
|
@@ -366,7 +391,7 @@ describe('App embed tests', () => {
|
|
|
366
391
|
});
|
|
367
392
|
appEmbed.render();
|
|
368
393
|
await executeAfterWait(() => {
|
|
369
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true${defaultParamsPost}#/home`);
|
|
394
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
370
395
|
});
|
|
371
396
|
});
|
|
372
397
|
test('should set isLinkParametersEnabled to false in url', async () => {
|
|
@@ -376,7 +401,7 @@ describe('App embed tests', () => {
|
|
|
376
401
|
});
|
|
377
402
|
appEmbed.render();
|
|
378
403
|
await executeAfterWait(() => {
|
|
379
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false${defaultParamsPost}#/home`);
|
|
404
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
380
405
|
});
|
|
381
406
|
});
|
|
382
407
|
test('Should add homepageVersion=v4 and updatedSpotterChatPrompt=true when homePage is Focused to the iframe src', async () => {
|
|
@@ -385,7 +410,7 @@ describe('App embed tests', () => {
|
|
|
385
410
|
discoveryExperience: {
|
|
386
411
|
homePage: HomePage.Focused,
|
|
387
412
|
},
|
|
388
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
413
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=true${defaultParams}${defaultParamsPost}#/home`);
|
|
389
414
|
});
|
|
390
415
|
test('Should respect explicit updatedSpotterChatPrompt=false even when homePage is Focused', async () => {
|
|
391
416
|
await testUrlParams({
|
|
@@ -394,7 +419,7 @@ describe('App embed tests', () => {
|
|
|
394
419
|
homePage: HomePage.Focused,
|
|
395
420
|
},
|
|
396
421
|
updatedSpotterChatPrompt: false,
|
|
397
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
422
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=false${defaultParams}${defaultParamsPost}#/home`);
|
|
398
423
|
});
|
|
399
424
|
test('should set isLiveboardXLSXCSVDownloadEnabled to true in url', async () => {
|
|
400
425
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
@@ -403,7 +428,7 @@ describe('App embed tests', () => {
|
|
|
403
428
|
});
|
|
404
429
|
appEmbed.render();
|
|
405
430
|
await executeAfterWait(() => {
|
|
406
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`);
|
|
431
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
407
432
|
});
|
|
408
433
|
});
|
|
409
434
|
test('should set updatedSpotterChatPrompt to true in url', async () => {
|
|
@@ -413,7 +438,7 @@ describe('App embed tests', () => {
|
|
|
413
438
|
});
|
|
414
439
|
appEmbed.render();
|
|
415
440
|
await executeAfterWait(() => {
|
|
416
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true${defaultParamsPost}#/home`);
|
|
441
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
417
442
|
});
|
|
418
443
|
});
|
|
419
444
|
test('should set updatedSpotterChatPrompt to false in url', async () => {
|
|
@@ -423,7 +448,46 @@ describe('App embed tests', () => {
|
|
|
423
448
|
});
|
|
424
449
|
appEmbed.render();
|
|
425
450
|
await executeAfterWait(() => {
|
|
426
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false${defaultParamsPost}#/home`);
|
|
451
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
test('should set showSpotterRadiance to true in url', async () => {
|
|
455
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
456
|
+
...defaultViewConfig,
|
|
457
|
+
showSpotterRadiance: true,
|
|
458
|
+
});
|
|
459
|
+
appEmbed.render();
|
|
460
|
+
await executeAfterWait(() => {
|
|
461
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=true${defaultParamsPost}#/home`);
|
|
462
|
+
});
|
|
463
|
+
});
|
|
464
|
+
test('should set showSpotterRadiance to false in url', async () => {
|
|
465
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
466
|
+
...defaultViewConfig,
|
|
467
|
+
showSpotterRadiance: false,
|
|
468
|
+
});
|
|
469
|
+
appEmbed.render();
|
|
470
|
+
await executeAfterWait(() => {
|
|
471
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=false${defaultParamsPost}#/home`);
|
|
472
|
+
});
|
|
473
|
+
});
|
|
474
|
+
test('should set defaultQueryMode to research in url', async () => {
|
|
475
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
476
|
+
...defaultViewConfig,
|
|
477
|
+
defaultQueryMode: SpotterQueryMode.RESEARCH,
|
|
478
|
+
});
|
|
479
|
+
appEmbed.render();
|
|
480
|
+
await executeAfterWait(() => {
|
|
481
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&defaultQueryMode=research${defaultParamsPost}#/home`);
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
test('should not set defaultQueryMode in url when unset', async () => {
|
|
485
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
486
|
+
...defaultViewConfig,
|
|
487
|
+
});
|
|
488
|
+
appEmbed.render();
|
|
489
|
+
await executeAfterWait(() => {
|
|
490
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false${defaultParamsPost}#/home`);
|
|
427
491
|
});
|
|
428
492
|
});
|
|
429
493
|
test('should set hideToolResponseCardBranding to true in url via spotterChatConfig', async () => {
|
|
@@ -435,7 +499,36 @@ describe('App embed tests', () => {
|
|
|
435
499
|
});
|
|
436
500
|
appEmbed.render();
|
|
437
501
|
await executeAfterWait(() => {
|
|
438
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true${defaultParamsPost}#/home`);
|
|
502
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
test('should set spotterDataSources to a list of Model GUIDs in url', async () => {
|
|
506
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
507
|
+
...defaultViewConfig,
|
|
508
|
+
spotterDataSources: ['model-guid-123', 'model-guid-456'],
|
|
509
|
+
});
|
|
510
|
+
appEmbed.render();
|
|
511
|
+
await executeAfterWait(() => {
|
|
512
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterDataSources=${encodeURIComponent(JSON.stringify(['model-guid-123', 'model-guid-456']))}${defaultParamsPost}#/home`);
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
test('should not add spotterDataSources to url when not provided', async () => {
|
|
516
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
517
|
+
...defaultViewConfig,
|
|
518
|
+
});
|
|
519
|
+
appEmbed.render();
|
|
520
|
+
await executeAfterWait(() => {
|
|
521
|
+
expect(getIFrameSrc()).not.toContain('spotterDataSources');
|
|
522
|
+
});
|
|
523
|
+
});
|
|
524
|
+
test('should not add spotterDataSources to url when empty array', async () => {
|
|
525
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
526
|
+
...defaultViewConfig,
|
|
527
|
+
spotterDataSources: [],
|
|
528
|
+
});
|
|
529
|
+
appEmbed.render();
|
|
530
|
+
await executeAfterWait(() => {
|
|
531
|
+
expect(getIFrameSrc()).not.toContain('spotterDataSources');
|
|
439
532
|
});
|
|
440
533
|
});
|
|
441
534
|
test('should include spotterVizConfig in APP_INIT embedParams when spotterViz is provided', async () => {
|
|
@@ -475,6 +568,33 @@ describe('App embed tests', () => {
|
|
|
475
568
|
});
|
|
476
569
|
});
|
|
477
570
|
});
|
|
571
|
+
test('should include starterPrompts in APP_INIT embedParams', async () => {
|
|
572
|
+
const starterPrompts = {
|
|
573
|
+
enable: true,
|
|
574
|
+
quick: {
|
|
575
|
+
label: 'Quick',
|
|
576
|
+
questions: [
|
|
577
|
+
{ label: 'Q1', prompt: 'P1' },
|
|
578
|
+
{ label: 'Q2', prompt: 'P2' },
|
|
579
|
+
],
|
|
580
|
+
},
|
|
581
|
+
research: { label: 'Research' },
|
|
582
|
+
};
|
|
583
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
584
|
+
...defaultViewConfig,
|
|
585
|
+
spotterChatConfig: { starterPrompts },
|
|
586
|
+
});
|
|
587
|
+
mockMessageChannel();
|
|
588
|
+
appEmbed.render();
|
|
589
|
+
const mockPort = { postMessage: jest.fn() };
|
|
590
|
+
await executeAfterWait(() => {
|
|
591
|
+
postMessageToParent(getIFrameEl().contentWindow, { type: EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
592
|
+
});
|
|
593
|
+
await executeAfterWait(() => {
|
|
594
|
+
expect(mockPort.postMessage.mock.calls[0][0].data.embedParams.starterPrompts)
|
|
595
|
+
.toEqual(starterPrompts);
|
|
596
|
+
});
|
|
597
|
+
});
|
|
478
598
|
test('should pass brandHeadline through spotterVizConfig in APP_INIT', async () => {
|
|
479
599
|
const spotterViz = { brandName: 'MyBrand', brandHeadline: "Hi, there! I'm" };
|
|
480
600
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
@@ -545,6 +665,83 @@ describe('App embed tests', () => {
|
|
|
545
665
|
});
|
|
546
666
|
});
|
|
547
667
|
});
|
|
668
|
+
test('should forward spotterChatPinConfig nested in spotterSidebarConfig in APP_INIT', async () => {
|
|
669
|
+
const spotterChatPinConfig = {
|
|
670
|
+
enabled: true,
|
|
671
|
+
pinLabel: 'Pin to top',
|
|
672
|
+
unpinLabel: 'Unpin',
|
|
673
|
+
};
|
|
674
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
675
|
+
...defaultViewConfig,
|
|
676
|
+
spotterSidebarConfig: {
|
|
677
|
+
enablePastConversationsSidebar: true,
|
|
678
|
+
spotterChatPinConfig,
|
|
679
|
+
},
|
|
680
|
+
});
|
|
681
|
+
mockMessageChannel();
|
|
682
|
+
appEmbed.render();
|
|
683
|
+
const mockPort = { postMessage: jest.fn() };
|
|
684
|
+
await executeAfterWait(() => {
|
|
685
|
+
postMessageToParent(getIFrameEl().contentWindow, { type: EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
686
|
+
});
|
|
687
|
+
await executeAfterWait(() => {
|
|
688
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
689
|
+
type: EmbedEvent.APP_INIT,
|
|
690
|
+
data: expect.objectContaining({
|
|
691
|
+
embedParams: expect.objectContaining({
|
|
692
|
+
spotterSidebarConfig: expect.objectContaining({
|
|
693
|
+
spotterChatPinConfig,
|
|
694
|
+
}),
|
|
695
|
+
}),
|
|
696
|
+
}),
|
|
697
|
+
});
|
|
698
|
+
});
|
|
699
|
+
});
|
|
700
|
+
test('should include spotterShareConversationConfig in APP_INIT embedParams when provided', async () => {
|
|
701
|
+
const spotterShareConversationConfig = {
|
|
702
|
+
enableShareConversation: true,
|
|
703
|
+
spotterShareLabel: 'Share',
|
|
704
|
+
spotterShareModalTitle: 'Share conversation',
|
|
705
|
+
};
|
|
706
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
707
|
+
...defaultViewConfig,
|
|
708
|
+
spotterShareConversationConfig,
|
|
709
|
+
});
|
|
710
|
+
mockMessageChannel();
|
|
711
|
+
appEmbed.render();
|
|
712
|
+
const mockPort = { postMessage: jest.fn() };
|
|
713
|
+
await executeAfterWait(() => {
|
|
714
|
+
postMessageToParent(getIFrameEl().contentWindow, { type: EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
715
|
+
});
|
|
716
|
+
await executeAfterWait(() => {
|
|
717
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
718
|
+
type: EmbedEvent.APP_INIT,
|
|
719
|
+
data: expect.objectContaining({
|
|
720
|
+
embedParams: expect.objectContaining({
|
|
721
|
+
spotterShareConversationConfig,
|
|
722
|
+
}),
|
|
723
|
+
}),
|
|
724
|
+
});
|
|
725
|
+
});
|
|
726
|
+
});
|
|
727
|
+
test('should not include spotterShareConversationConfig in APP_INIT when not provided', async () => {
|
|
728
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
729
|
+
...defaultViewConfig,
|
|
730
|
+
});
|
|
731
|
+
mockMessageChannel();
|
|
732
|
+
appEmbed.render();
|
|
733
|
+
const mockPort = { postMessage: jest.fn() };
|
|
734
|
+
await executeAfterWait(() => {
|
|
735
|
+
postMessageToParent(getIFrameEl().contentWindow, { type: EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
736
|
+
});
|
|
737
|
+
await executeAfterWait(() => {
|
|
738
|
+
const callArgs = mockPort.postMessage.mock.calls[0][0];
|
|
739
|
+
expect(callArgs.type).toBe(EmbedEvent.APP_INIT);
|
|
740
|
+
if (callArgs.data.embedParams) {
|
|
741
|
+
expect(callArgs.data.embedParams.spotterShareConversationConfig).toBeUndefined();
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
});
|
|
548
745
|
test('should set toolResponseCardBrandingLabel in url via spotterChatConfig', async () => {
|
|
549
746
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
550
747
|
...defaultViewConfig,
|
|
@@ -554,7 +751,7 @@ describe('App embed tests', () => {
|
|
|
554
751
|
});
|
|
555
752
|
appEmbed.render();
|
|
556
753
|
await executeAfterWait(() => {
|
|
557
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand${defaultParamsPost}#/home`);
|
|
754
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
558
755
|
});
|
|
559
756
|
});
|
|
560
757
|
test('should set spotterFileUploadEnabled to true in url', async () => {
|
|
@@ -564,7 +761,7 @@ describe('App embed tests', () => {
|
|
|
564
761
|
});
|
|
565
762
|
appEmbed.render();
|
|
566
763
|
await executeAfterWait(() => {
|
|
567
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true${defaultParamsPost}#/home`);
|
|
764
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
568
765
|
});
|
|
569
766
|
});
|
|
570
767
|
test('should set enableStarterPrompts to true in url', async () => {
|
|
@@ -574,7 +771,41 @@ describe('App embed tests', () => {
|
|
|
574
771
|
});
|
|
575
772
|
appEmbed.render();
|
|
576
773
|
await executeAfterWait(() => {
|
|
577
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true${defaultParamsPost}#/home`);
|
|
774
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
775
|
+
});
|
|
776
|
+
});
|
|
777
|
+
test('should set openSpotterOnLiveboardByDefault to true in url', async () => {
|
|
778
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
779
|
+
...defaultViewConfig,
|
|
780
|
+
spotterChatConfig: { openSpotterOnLiveboardByDefault: true },
|
|
781
|
+
});
|
|
782
|
+
appEmbed.render();
|
|
783
|
+
await executeAfterWait(() => {
|
|
784
|
+
expectUrlToHaveParamsWithValues(getIFrameSrc(), {
|
|
785
|
+
openSpotterOnLiveboardByDefault: 'true',
|
|
786
|
+
});
|
|
787
|
+
});
|
|
788
|
+
});
|
|
789
|
+
test('should set openSpotterOnLiveboardByDefault to false when explicitly disabled', async () => {
|
|
790
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
791
|
+
...defaultViewConfig,
|
|
792
|
+
spotterChatConfig: { openSpotterOnLiveboardByDefault: false },
|
|
793
|
+
});
|
|
794
|
+
appEmbed.render();
|
|
795
|
+
await executeAfterWait(() => {
|
|
796
|
+
expectUrlToHaveParamsWithValues(getIFrameSrc(), {
|
|
797
|
+
openSpotterOnLiveboardByDefault: 'false',
|
|
798
|
+
});
|
|
799
|
+
});
|
|
800
|
+
});
|
|
801
|
+
test('should not set openSpotterOnLiveboardByDefault when it is not configured', async () => {
|
|
802
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
803
|
+
...defaultViewConfig,
|
|
804
|
+
spotterChatConfig: { enableStarterPrompts: true },
|
|
805
|
+
});
|
|
806
|
+
appEmbed.render();
|
|
807
|
+
await executeAfterWait(() => {
|
|
808
|
+
expect(getIFrameSrc()).not.toContain('openSpotterOnLiveboardByDefault');
|
|
578
809
|
});
|
|
579
810
|
});
|
|
580
811
|
test('should set spotterFileUploadFileTypes in url', async () => {
|
|
@@ -596,7 +827,7 @@ describe('App embed tests', () => {
|
|
|
596
827
|
});
|
|
597
828
|
appEmbed.render();
|
|
598
829
|
await executeAfterWait(() => {
|
|
599
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false${defaultParamsPost}#/home`);
|
|
830
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
600
831
|
});
|
|
601
832
|
});
|
|
602
833
|
test('should set isGranularXLSXCSVSchedulesEnabled to true in url', async () => {
|
|
@@ -606,7 +837,7 @@ describe('App embed tests', () => {
|
|
|
606
837
|
});
|
|
607
838
|
appEmbed.render();
|
|
608
839
|
await executeAfterWait(() => {
|
|
609
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true${defaultParamsPost}#/home`);
|
|
840
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
610
841
|
});
|
|
611
842
|
});
|
|
612
843
|
test('should set isGranularXLSXCSVSchedulesEnabled to false in url', async () => {
|
|
@@ -616,7 +847,7 @@ describe('App embed tests', () => {
|
|
|
616
847
|
});
|
|
617
848
|
appEmbed.render();
|
|
618
849
|
await executeAfterWait(() => {
|
|
619
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false${defaultParamsPost}#/home`);
|
|
850
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
620
851
|
});
|
|
621
852
|
});
|
|
622
853
|
test('should set isCentralizedLiveboardFilterUXEnabled to true in url', async () => {
|
|
@@ -626,7 +857,7 @@ describe('App embed tests', () => {
|
|
|
626
857
|
});
|
|
627
858
|
appEmbed.render();
|
|
628
859
|
await executeAfterWait(() => {
|
|
629
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true${defaultParamsPost}#/home`);
|
|
860
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
630
861
|
});
|
|
631
862
|
});
|
|
632
863
|
test('should set isCentralizedLiveboardFilterUXEnabled to false in url', async () => {
|
|
@@ -636,7 +867,36 @@ describe('App embed tests', () => {
|
|
|
636
867
|
});
|
|
637
868
|
appEmbed.render();
|
|
638
869
|
await executeAfterWait(() => {
|
|
639
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false${defaultParamsPost}#/home`);
|
|
870
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
871
|
+
});
|
|
872
|
+
});
|
|
873
|
+
test('should set isScopedLiveboardFilteringEnabled to true in url', async () => {
|
|
874
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
875
|
+
...defaultViewConfig,
|
|
876
|
+
isScopedLiveboardFilteringEnabled: true,
|
|
877
|
+
});
|
|
878
|
+
appEmbed.render();
|
|
879
|
+
await executeAfterWait(() => {
|
|
880
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=true${defaultParamsPost}#/home`);
|
|
881
|
+
});
|
|
882
|
+
});
|
|
883
|
+
test('should set isScopedLiveboardFilteringEnabled to false in url', async () => {
|
|
884
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
885
|
+
...defaultViewConfig,
|
|
886
|
+
isScopedLiveboardFilteringEnabled: false,
|
|
887
|
+
});
|
|
888
|
+
appEmbed.render();
|
|
889
|
+
await executeAfterWait(() => {
|
|
890
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=false${defaultParamsPost}#/home`);
|
|
891
|
+
});
|
|
892
|
+
});
|
|
893
|
+
test('should not set isScopedLiveboardFilteringEnabled in url when undefined', async () => {
|
|
894
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
895
|
+
...defaultViewConfig,
|
|
896
|
+
});
|
|
897
|
+
appEmbed.render();
|
|
898
|
+
await executeAfterWait(() => {
|
|
899
|
+
expect(getIFrameSrc()).not.toContain('isScopedLiveboardFilteringEnabled');
|
|
640
900
|
});
|
|
641
901
|
});
|
|
642
902
|
test('Should add the tag to the iframe src', async () => {
|
|
@@ -647,7 +907,7 @@ describe('App embed tests', () => {
|
|
|
647
907
|
});
|
|
648
908
|
appEmbed.render();
|
|
649
909
|
await executeAfterWait(() => {
|
|
650
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&tag=Finance${defaultParamsPost}#/home`);
|
|
910
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&tag=Finance${defaultParamsPost}#/home`);
|
|
651
911
|
});
|
|
652
912
|
});
|
|
653
913
|
test('Should add the hideTagFilterChips true to the iframe src', async () => {
|
|
@@ -658,7 +918,7 @@ describe('App embed tests', () => {
|
|
|
658
918
|
});
|
|
659
919
|
appEmbed.render();
|
|
660
920
|
await executeAfterWait(() => {
|
|
661
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`);
|
|
921
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`);
|
|
662
922
|
});
|
|
663
923
|
});
|
|
664
924
|
test('Should add the hideTagFilterChips false to the iframe src', async () => {
|
|
@@ -669,7 +929,7 @@ describe('App embed tests', () => {
|
|
|
669
929
|
});
|
|
670
930
|
appEmbed.render();
|
|
671
931
|
await executeAfterWait(() => {
|
|
672
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`);
|
|
932
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`);
|
|
673
933
|
});
|
|
674
934
|
});
|
|
675
935
|
test('Should not add hideTagFilterChips if it is undefined', async () => {
|
|
@@ -679,7 +939,7 @@ describe('App embed tests', () => {
|
|
|
679
939
|
});
|
|
680
940
|
appEmbed.render();
|
|
681
941
|
await executeAfterWait(() => {
|
|
682
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`);
|
|
942
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
683
943
|
});
|
|
684
944
|
});
|
|
685
945
|
test('Should add showMaskedFilterChip true to the iframe src', async () => {
|
|
@@ -690,7 +950,7 @@ describe('App embed tests', () => {
|
|
|
690
950
|
});
|
|
691
951
|
appEmbed.render();
|
|
692
952
|
await executeAfterWait(() => {
|
|
693
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true${defaultParams}${defaultParamsPost}#/home`);
|
|
953
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
694
954
|
});
|
|
695
955
|
});
|
|
696
956
|
test('Should add showMaskedFilterChip false to the iframe src', async () => {
|
|
@@ -701,7 +961,7 @@ describe('App embed tests', () => {
|
|
|
701
961
|
});
|
|
702
962
|
appEmbed.render();
|
|
703
963
|
await executeAfterWait(() => {
|
|
704
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${defaultParams}${defaultParamsPost}#/home`);
|
|
964
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
705
965
|
});
|
|
706
966
|
});
|
|
707
967
|
test('Should add default showMaskedFilterChip false when not specified', async () => {
|
|
@@ -711,7 +971,7 @@ describe('App embed tests', () => {
|
|
|
711
971
|
});
|
|
712
972
|
appEmbed.render();
|
|
713
973
|
await executeAfterWait(() => {
|
|
714
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${defaultParams}${defaultParamsPost}#/home`);
|
|
974
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
715
975
|
});
|
|
716
976
|
});
|
|
717
977
|
test('Should add isLiveboardMasterpiecesEnabled true to the iframe src', async () => {
|
|
@@ -722,7 +982,7 @@ describe('App embed tests', () => {
|
|
|
722
982
|
});
|
|
723
983
|
appEmbed.render();
|
|
724
984
|
await executeAfterWait(() => {
|
|
725
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true${defaultParams}${defaultParamsPost}#/home`);
|
|
985
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
726
986
|
});
|
|
727
987
|
});
|
|
728
988
|
test('Should add isLiveboardMasterpiecesEnabled false to the iframe src', async () => {
|
|
@@ -733,17 +993,7 @@ describe('App embed tests', () => {
|
|
|
733
993
|
});
|
|
734
994
|
appEmbed.render();
|
|
735
995
|
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`);
|
|
996
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
747
997
|
});
|
|
748
998
|
});
|
|
749
999
|
test('Should add newChartsLibrary true to the iframe src', async () => {
|
|
@@ -754,7 +1004,7 @@ describe('App embed tests', () => {
|
|
|
754
1004
|
});
|
|
755
1005
|
appEmbed.render();
|
|
756
1006
|
await executeAfterWait(() => {
|
|
757
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1007
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
758
1008
|
});
|
|
759
1009
|
});
|
|
760
1010
|
test('Should add newChartsLibrary false to the iframe src', async () => {
|
|
@@ -765,7 +1015,7 @@ describe('App embed tests', () => {
|
|
|
765
1015
|
});
|
|
766
1016
|
appEmbed.render();
|
|
767
1017
|
await executeAfterWait(() => {
|
|
768
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1018
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
769
1019
|
});
|
|
770
1020
|
});
|
|
771
1021
|
test('Should not add newChartsLibrary to the iframe src when not specified', async () => {
|
|
@@ -775,7 +1025,7 @@ describe('App embed tests', () => {
|
|
|
775
1025
|
});
|
|
776
1026
|
appEmbed.render();
|
|
777
1027
|
await executeAfterWait(() => {
|
|
778
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1028
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
779
1029
|
});
|
|
780
1030
|
});
|
|
781
1031
|
test('Should add enableSearchAssist flagto the iframe src', async () => {
|
|
@@ -785,7 +1035,7 @@ describe('App embed tests', () => {
|
|
|
785
1035
|
});
|
|
786
1036
|
appEmbed.render();
|
|
787
1037
|
await executeAfterWait(() => {
|
|
788
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1038
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
789
1039
|
});
|
|
790
1040
|
});
|
|
791
1041
|
test('Should add enableDataPanelV2 flag to the iframe src', async () => {
|
|
@@ -795,7 +1045,7 @@ describe('App embed tests', () => {
|
|
|
795
1045
|
});
|
|
796
1046
|
appEmbed.render();
|
|
797
1047
|
await executeAfterWait(() => {
|
|
798
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1048
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
799
1049
|
});
|
|
800
1050
|
});
|
|
801
1051
|
test('Should add isLiveboardHeaderSticky flag to the iframe src', async () => {
|
|
@@ -805,7 +1055,7 @@ describe('App embed tests', () => {
|
|
|
805
1055
|
});
|
|
806
1056
|
appEmbed.render();
|
|
807
1057
|
await executeAfterWait(() => {
|
|
808
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1058
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
809
1059
|
});
|
|
810
1060
|
});
|
|
811
1061
|
test('Should add isLiveboardCompactHeaderEnabled flag to the iframe src', async () => {
|
|
@@ -815,7 +1065,7 @@ describe('App embed tests', () => {
|
|
|
815
1065
|
});
|
|
816
1066
|
appEmbed.render();
|
|
817
1067
|
await executeAfterWait(() => {
|
|
818
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1068
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
819
1069
|
});
|
|
820
1070
|
});
|
|
821
1071
|
test('Should add showLiveboardReverifyBanner flag to the iframe src', async () => {
|
|
@@ -825,7 +1075,7 @@ describe('App embed tests', () => {
|
|
|
825
1075
|
});
|
|
826
1076
|
appEmbed.render();
|
|
827
1077
|
await executeAfterWait(() => {
|
|
828
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1078
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
829
1079
|
});
|
|
830
1080
|
});
|
|
831
1081
|
test('Should add isUnifiedSearchExperienceEnabled flag to the iframe src', async () => {
|
|
@@ -836,7 +1086,7 @@ describe('App embed tests', () => {
|
|
|
836
1086
|
});
|
|
837
1087
|
appEmbedTrue.render();
|
|
838
1088
|
await executeAfterWait(() => {
|
|
839
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1089
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
840
1090
|
});
|
|
841
1091
|
appEmbedTrue.destroy();
|
|
842
1092
|
// Case 2: explicitly false
|
|
@@ -846,7 +1096,7 @@ describe('App embed tests', () => {
|
|
|
846
1096
|
});
|
|
847
1097
|
appEmbedFalse.render();
|
|
848
1098
|
await executeAfterWait(() => {
|
|
849
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1099
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
850
1100
|
});
|
|
851
1101
|
appEmbedFalse.destroy();
|
|
852
1102
|
// Case 3: not provided — defaults to false
|
|
@@ -855,7 +1105,7 @@ describe('App embed tests', () => {
|
|
|
855
1105
|
});
|
|
856
1106
|
appEmbedDefault.render();
|
|
857
1107
|
await executeAfterWait(() => {
|
|
858
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1108
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
859
1109
|
});
|
|
860
1110
|
});
|
|
861
1111
|
test('should set newConnectionsExperience to true in url', async () => {
|
|
@@ -894,7 +1144,7 @@ describe('App embed tests', () => {
|
|
|
894
1144
|
});
|
|
895
1145
|
appEmbed.render();
|
|
896
1146
|
await executeAfterWait(() => {
|
|
897
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1147
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
898
1148
|
});
|
|
899
1149
|
});
|
|
900
1150
|
test('Should add showLiveboardVerifiedBadge flag to the iframe src', async () => {
|
|
@@ -904,7 +1154,7 @@ describe('App embed tests', () => {
|
|
|
904
1154
|
});
|
|
905
1155
|
appEmbed.render();
|
|
906
1156
|
await executeAfterWait(() => {
|
|
907
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1157
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
908
1158
|
});
|
|
909
1159
|
});
|
|
910
1160
|
test('Should add isLiveboardPermissionV2Enabled flag to the iframe src', async () => {
|
|
@@ -914,7 +1164,7 @@ describe('App embed tests', () => {
|
|
|
914
1164
|
});
|
|
915
1165
|
appEmbed.render();
|
|
916
1166
|
await executeAfterWait(() => {
|
|
917
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false${defaultParams}${defaultParamsPost}#/home`);
|
|
1167
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
918
1168
|
});
|
|
919
1169
|
});
|
|
920
1170
|
test('Should add default values of flags to the iframe src', async () => {
|
|
@@ -923,7 +1173,7 @@ describe('App embed tests', () => {
|
|
|
923
1173
|
});
|
|
924
1174
|
appEmbed.render();
|
|
925
1175
|
await executeAfterWait(() => {
|
|
926
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1176
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
927
1177
|
});
|
|
928
1178
|
});
|
|
929
1179
|
test('Should add modularHomeExperience flag to the iframe src', async () => {
|
|
@@ -933,7 +1183,7 @@ describe('App embed tests', () => {
|
|
|
933
1183
|
});
|
|
934
1184
|
appEmbed.render();
|
|
935
1185
|
await executeAfterWait(() => {
|
|
936
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`);
|
|
1186
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
937
1187
|
});
|
|
938
1188
|
});
|
|
939
1189
|
test('Should add hideHomepageLeftNav flag to the iframe src', async () => {
|
|
@@ -943,7 +1193,7 @@ describe('App embed tests', () => {
|
|
|
943
1193
|
});
|
|
944
1194
|
appEmbed.render();
|
|
945
1195
|
await executeAfterWait(() => {
|
|
946
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1196
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHomepageLeftNav=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
947
1197
|
});
|
|
948
1198
|
});
|
|
949
1199
|
test('Should add hideHamburger, hideObjectSearch, hideNotification flags to the iframe src', async () => {
|
|
@@ -955,7 +1205,7 @@ describe('App embed tests', () => {
|
|
|
955
1205
|
});
|
|
956
1206
|
appEmbed.render();
|
|
957
1207
|
await executeAfterWait(() => {
|
|
958
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1208
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
959
1209
|
});
|
|
960
1210
|
});
|
|
961
1211
|
test('Should not add when hideHamburger, hideObjectSearch, hideNotification values are not true to the iframe src', async () => {
|
|
@@ -967,65 +1217,14 @@ describe('App embed tests', () => {
|
|
|
967
1217
|
});
|
|
968
1218
|
appEmbed.render();
|
|
969
1219
|
await executeAfterWait(() => {
|
|
970
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1220
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
971
1221
|
});
|
|
972
1222
|
});
|
|
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
1223
|
test('Should add enableAskSage flag to the iframe src', async () => {
|
|
1025
1224
|
await testUrlParams({
|
|
1026
1225
|
...defaultViewConfig,
|
|
1027
1226
|
enableAskSage: true,
|
|
1028
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1227
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableAskSage=true&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1029
1228
|
});
|
|
1030
1229
|
test('Should add listpageVersion=v3 when listPageVersion is ListWithUXChanges to the iframe src', async () => {
|
|
1031
1230
|
await testUrlParams({
|
|
@@ -1033,31 +1232,30 @@ describe('App embed tests', () => {
|
|
|
1033
1232
|
discoveryExperience: {
|
|
1034
1233
|
listPageVersion: ListPage.ListWithUXChanges,
|
|
1035
1234
|
},
|
|
1036
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1235
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&listpageVersion=v3&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1037
1236
|
});
|
|
1038
|
-
test('Should
|
|
1237
|
+
test('Should send navigationVersion=v3 & homepageVersion=v3 by default when no discoveryExperience is provided', async () => {
|
|
1039
1238
|
await testUrlParams({
|
|
1040
1239
|
...defaultViewConfig,
|
|
1041
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1240
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1042
1241
|
});
|
|
1043
|
-
test('Should
|
|
1044
|
-
|
|
1242
|
+
test('Should not send modularHomeExperience param by default when not specified', async () => {
|
|
1243
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1045
1244
|
...defaultViewConfig,
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1245
|
+
});
|
|
1246
|
+
appEmbed.render();
|
|
1247
|
+
await executeAfterWait(() => {
|
|
1248
|
+
const url = new URL(getIFrameSrc());
|
|
1249
|
+
expect(url.searchParams.has('modularHomeExperience')).toBe(false);
|
|
1250
|
+
});
|
|
1051
1251
|
});
|
|
1052
1252
|
test('Should add listpageVersion=v3 combined with other discoveryExperience options to the iframe src', async () => {
|
|
1053
1253
|
await testUrlParams({
|
|
1054
1254
|
...defaultViewConfig,
|
|
1055
1255
|
discoveryExperience: {
|
|
1056
|
-
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
1057
|
-
homePage: HomePage.Modular,
|
|
1058
1256
|
listPageVersion: ListPage.ListWithUXChanges,
|
|
1059
1257
|
},
|
|
1060
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1258
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&listpageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1061
1259
|
});
|
|
1062
1260
|
test('Should add enablePendoHelp flag to the iframe src conditional on navbar', async () => {
|
|
1063
1261
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
@@ -1065,7 +1263,7 @@ describe('App embed tests', () => {
|
|
|
1065
1263
|
});
|
|
1066
1264
|
appEmbed.render();
|
|
1067
1265
|
await executeAfterWait(() => {
|
|
1068
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1266
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1069
1267
|
});
|
|
1070
1268
|
const noNavEmbed = new AppEmbed(getRootEl(), {
|
|
1071
1269
|
...defaultViewConfig,
|
|
@@ -1073,7 +1271,7 @@ describe('App embed tests', () => {
|
|
|
1073
1271
|
});
|
|
1074
1272
|
noNavEmbed.render();
|
|
1075
1273
|
await executeAfterWait(() => {
|
|
1076
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1274
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1077
1275
|
});
|
|
1078
1276
|
});
|
|
1079
1277
|
test('should set enableLiveboardDataCache to true in url', async () => {
|
|
@@ -1083,7 +1281,7 @@ describe('App embed tests', () => {
|
|
|
1083
1281
|
});
|
|
1084
1282
|
appEmbed.render();
|
|
1085
1283
|
await executeAfterWait(() => {
|
|
1086
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true${defaultParamsPost}#/home`);
|
|
1284
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
1087
1285
|
});
|
|
1088
1286
|
});
|
|
1089
1287
|
test('should set enableLiveboardDataCache to false in url', async () => {
|
|
@@ -1093,7 +1291,7 @@ describe('App embed tests', () => {
|
|
|
1093
1291
|
});
|
|
1094
1292
|
appEmbed.render();
|
|
1095
1293
|
await executeAfterWait(() => {
|
|
1096
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false${defaultParamsPost}#/home`);
|
|
1294
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
1097
1295
|
});
|
|
1098
1296
|
});
|
|
1099
1297
|
test('should not set enableLiveboardDataCache in url when not provided', async () => {
|
|
@@ -1112,7 +1310,7 @@ describe('App embed tests', () => {
|
|
|
1112
1310
|
});
|
|
1113
1311
|
await appEmbed.render();
|
|
1114
1312
|
await executeAfterWait(() => {
|
|
1115
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1313
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=objectSearch&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1116
1314
|
});
|
|
1117
1315
|
});
|
|
1118
1316
|
test('Should add HomePageSearchBarMode flag with ai answer to the iframe src', async () => {
|
|
@@ -1122,7 +1320,7 @@ describe('App embed tests', () => {
|
|
|
1122
1320
|
});
|
|
1123
1321
|
await appEmbed.render();
|
|
1124
1322
|
await executeAfterWait(() => {
|
|
1125
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1323
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=aiAnswer&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1126
1324
|
});
|
|
1127
1325
|
});
|
|
1128
1326
|
test('Should add HomePageSearchBarMode flag with none to the iframe src', async () => {
|
|
@@ -1132,7 +1330,7 @@ describe('App embed tests', () => {
|
|
|
1132
1330
|
});
|
|
1133
1331
|
await appEmbed.render();
|
|
1134
1332
|
await executeAfterWait(() => {
|
|
1135
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1333
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=none&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1136
1334
|
});
|
|
1137
1335
|
});
|
|
1138
1336
|
test('Should add dataPanelCustomGroupsAccordionInitialState flag to the iframe src', async () => {
|
|
@@ -1142,7 +1340,7 @@ describe('App embed tests', () => {
|
|
|
1142
1340
|
});
|
|
1143
1341
|
appEmbed.render();
|
|
1144
1342
|
await executeAfterWait(() => {
|
|
1145
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1343
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST&navigationVersion=v3&homepageVersion=v3${defaultParams}${defaultParamsPost}#/home`);
|
|
1146
1344
|
});
|
|
1147
1345
|
});
|
|
1148
1346
|
test('should register event handlers to adjust iframe height', async () => {
|
|
@@ -1194,7 +1392,7 @@ describe('App embed tests', () => {
|
|
|
1194
1392
|
});
|
|
1195
1393
|
await appEmbed.render();
|
|
1196
1394
|
appEmbed.navigateToPage(path);
|
|
1197
|
-
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1395
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1198
1396
|
});
|
|
1199
1397
|
test('navigateToPage with noReload should trigger the appropriate event', async () => {
|
|
1200
1398
|
mockMessageChannel();
|
|
@@ -1242,6 +1440,85 @@ describe('App embed tests', () => {
|
|
|
1242
1440
|
await appEmbed.render();
|
|
1243
1441
|
expect(logger.log).toHaveBeenCalledWith('Please call render before invoking this method');
|
|
1244
1442
|
});
|
|
1443
|
+
describe('overrideHistoryState flag', () => {
|
|
1444
|
+
test('navigateToPage with overrideHistoryState=true should trigger HostEvent.Navigate', async () => {
|
|
1445
|
+
mockMessageChannel();
|
|
1446
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1447
|
+
frameParams: {
|
|
1448
|
+
width: '100%',
|
|
1449
|
+
height: '100%',
|
|
1450
|
+
},
|
|
1451
|
+
overrideHistoryState: true,
|
|
1452
|
+
});
|
|
1453
|
+
await appEmbed.render();
|
|
1454
|
+
const iframe = getIFrameEl();
|
|
1455
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1456
|
+
appEmbed.navigateToPage(path, false);
|
|
1457
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
1458
|
+
type: HostEvent.Navigate,
|
|
1459
|
+
data: path,
|
|
1460
|
+
}), `http://${thoughtSpotHost}`, expect.anything());
|
|
1461
|
+
});
|
|
1462
|
+
test('navigateToPage with overrideHistoryState=true and path as number should trigger HostEvent.Navigate', async () => {
|
|
1463
|
+
mockMessageChannel();
|
|
1464
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1465
|
+
frameParams: {
|
|
1466
|
+
width: '100%',
|
|
1467
|
+
height: '100%',
|
|
1468
|
+
},
|
|
1469
|
+
overrideHistoryState: true,
|
|
1470
|
+
});
|
|
1471
|
+
await appEmbed.render();
|
|
1472
|
+
const iframe = getIFrameEl();
|
|
1473
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1474
|
+
appEmbed.navigateToPage(-1, false);
|
|
1475
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
1476
|
+
type: HostEvent.Navigate,
|
|
1477
|
+
data: -1,
|
|
1478
|
+
}), `http://${thoughtSpotHost}`, expect.anything());
|
|
1479
|
+
});
|
|
1480
|
+
test('navigateToPage with overrideHistoryState=false and noReload=false should update iframe src', async () => {
|
|
1481
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1482
|
+
frameParams: {
|
|
1483
|
+
width: '100%',
|
|
1484
|
+
height: '100%',
|
|
1485
|
+
},
|
|
1486
|
+
overrideHistoryState: false,
|
|
1487
|
+
});
|
|
1488
|
+
await appEmbed.render();
|
|
1489
|
+
appEmbed.navigateToPage(path, false);
|
|
1490
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1491
|
+
});
|
|
1492
|
+
test('navigateToPage with overrideHistoryState=undefined and noReload=false should update iframe src', async () => {
|
|
1493
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1494
|
+
frameParams: {
|
|
1495
|
+
width: '100%',
|
|
1496
|
+
height: '100%',
|
|
1497
|
+
},
|
|
1498
|
+
});
|
|
1499
|
+
await appEmbed.render();
|
|
1500
|
+
appEmbed.navigateToPage(path, false);
|
|
1501
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1502
|
+
});
|
|
1503
|
+
test('navigateToPage respects noReload priority over overrideHistoryState', async () => {
|
|
1504
|
+
mockMessageChannel();
|
|
1505
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1506
|
+
frameParams: {
|
|
1507
|
+
width: '100%',
|
|
1508
|
+
height: '100%',
|
|
1509
|
+
},
|
|
1510
|
+
overrideHistoryState: false,
|
|
1511
|
+
});
|
|
1512
|
+
await appEmbed.render();
|
|
1513
|
+
const iframe = getIFrameEl();
|
|
1514
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1515
|
+
appEmbed.navigateToPage(path, true);
|
|
1516
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
1517
|
+
type: HostEvent.Navigate,
|
|
1518
|
+
data: path,
|
|
1519
|
+
}), `http://${thoughtSpotHost}`, expect.anything());
|
|
1520
|
+
});
|
|
1521
|
+
});
|
|
1245
1522
|
});
|
|
1246
1523
|
describe('LazyLoadingForFullHeight functionality', () => {
|
|
1247
1524
|
let mockIFrame;
|
|
@@ -1305,6 +1582,175 @@ describe('App embed tests', () => {
|
|
|
1305
1582
|
expect(iframeSrc).toContain('isFullHeightPinboard=true');
|
|
1306
1583
|
}, 100);
|
|
1307
1584
|
});
|
|
1585
|
+
test('should default lazy loading flags to true when fullHeight is enabled', async () => {
|
|
1586
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1587
|
+
...defaultViewConfig,
|
|
1588
|
+
fullHeight: true,
|
|
1589
|
+
});
|
|
1590
|
+
expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBe(true);
|
|
1591
|
+
expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBe(true);
|
|
1592
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBe('500px 0px');
|
|
1593
|
+
await appEmbed.render();
|
|
1594
|
+
await executeAfterWait(() => {
|
|
1595
|
+
const iframeSrc = getIFrameSrc();
|
|
1596
|
+
expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
|
|
1597
|
+
expect(iframeSrc).toContain('isFullHeightPinboard=true');
|
|
1598
|
+
expect(iframeSrc).toContain('rootMarginForLazyLoad=500px%200px');
|
|
1599
|
+
}, 100);
|
|
1600
|
+
});
|
|
1601
|
+
test('should not default lazy loading flags when fullHeight is not enabled', async () => {
|
|
1602
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1603
|
+
...defaultViewConfig,
|
|
1604
|
+
});
|
|
1605
|
+
expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBeUndefined();
|
|
1606
|
+
expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
|
|
1607
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBeUndefined();
|
|
1608
|
+
});
|
|
1609
|
+
test('should not write the defaults back onto the caller view config', async () => {
|
|
1610
|
+
const callerViewConfig = {
|
|
1611
|
+
...defaultViewConfig,
|
|
1612
|
+
fullHeight: true,
|
|
1613
|
+
};
|
|
1614
|
+
new AppEmbed(getRootEl(), callerViewConfig);
|
|
1615
|
+
expect(callerViewConfig.lazyLoadingForFullHeight).toBeUndefined();
|
|
1616
|
+
expect(callerViewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
|
|
1617
|
+
expect(callerViewConfig.lazyLoadingMargin).toBeUndefined();
|
|
1618
|
+
});
|
|
1619
|
+
test('should not default lazy loading flags when fullHeight is explicitly false', async () => {
|
|
1620
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1621
|
+
...defaultViewConfig,
|
|
1622
|
+
fullHeight: false,
|
|
1623
|
+
});
|
|
1624
|
+
expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBeUndefined();
|
|
1625
|
+
expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
|
|
1626
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBeUndefined();
|
|
1627
|
+
});
|
|
1628
|
+
test('should default lazyLoadingMargin when lazyLoadingForFullHeight is set explicitly', async () => {
|
|
1629
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1630
|
+
...defaultViewConfig,
|
|
1631
|
+
fullHeight: true,
|
|
1632
|
+
lazyLoadingForFullHeight: true,
|
|
1633
|
+
});
|
|
1634
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBe(config.DEFAULT_LAZY_LOADING_MARGIN);
|
|
1635
|
+
await appEmbed.render();
|
|
1636
|
+
await executeAfterWait(() => {
|
|
1637
|
+
expect(getIFrameSrc()).toContain('rootMarginForLazyLoad=500px%200px');
|
|
1638
|
+
}, 100);
|
|
1639
|
+
});
|
|
1640
|
+
test('should let an explicit lazyLoadingMargin win over the default', async () => {
|
|
1641
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1642
|
+
...defaultViewConfig,
|
|
1643
|
+
fullHeight: true,
|
|
1644
|
+
lazyLoadingMargin: '250px',
|
|
1645
|
+
});
|
|
1646
|
+
await appEmbed.render();
|
|
1647
|
+
await executeAfterWait(() => {
|
|
1648
|
+
const iframeSrc = getIFrameSrc();
|
|
1649
|
+
expect(iframeSrc).toContain('rootMarginForLazyLoad=250px');
|
|
1650
|
+
expect(iframeSrc).not.toContain('rootMarginForLazyLoad=500px%200px');
|
|
1651
|
+
}, 100);
|
|
1652
|
+
});
|
|
1653
|
+
test('should drop an invalid lazyLoadingMargin and log an error', async () => {
|
|
1654
|
+
const loggerErrorSpy = jest.spyOn(logger, 'error').mockImplementation(() => undefined);
|
|
1655
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1656
|
+
...defaultViewConfig,
|
|
1657
|
+
fullHeight: true,
|
|
1658
|
+
lazyLoadingMargin: 'not-a-margin',
|
|
1659
|
+
});
|
|
1660
|
+
await appEmbed.render();
|
|
1661
|
+
await executeAfterWait(() => {
|
|
1662
|
+
const iframeSrc = getIFrameSrc();
|
|
1663
|
+
expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
|
|
1664
|
+
expect(iframeSrc).not.toContain('rootMarginForLazyLoad');
|
|
1665
|
+
expect(loggerErrorSpy).toHaveBeenCalledWith('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
|
|
1666
|
+
}, 100);
|
|
1667
|
+
});
|
|
1668
|
+
test('should track scrollable ancestors by default when only fullHeight is set', async () => {
|
|
1669
|
+
const scrollContainer = getRootEl();
|
|
1670
|
+
scrollContainer.style.overflow = 'auto';
|
|
1671
|
+
const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
|
|
1672
|
+
const resizeObserveSpy = jest.fn();
|
|
1673
|
+
const resizeDisconnectSpy = jest.fn();
|
|
1674
|
+
window.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
1675
|
+
observe: resizeObserveSpy,
|
|
1676
|
+
disconnect: resizeDisconnectSpy,
|
|
1677
|
+
}));
|
|
1678
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1679
|
+
...defaultViewConfig,
|
|
1680
|
+
fullHeight: true,
|
|
1681
|
+
});
|
|
1682
|
+
await appEmbed.render();
|
|
1683
|
+
await executeAfterWait(() => {
|
|
1684
|
+
expect(scrollContainerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
|
|
1685
|
+
expect(resizeObserveSpy).toHaveBeenCalledWith(scrollContainer);
|
|
1686
|
+
}, 100);
|
|
1687
|
+
appEmbed.destroy();
|
|
1688
|
+
expect(resizeDisconnectSpy).toHaveBeenCalled();
|
|
1689
|
+
scrollContainer.style.overflow = '';
|
|
1690
|
+
window.ResizeObserver = originalResizeObserver;
|
|
1691
|
+
});
|
|
1692
|
+
test('should skip ancestor tracking when enableScrollableContainerLazyLoading is false', async () => {
|
|
1693
|
+
const scrollContainer = getRootEl();
|
|
1694
|
+
scrollContainer.style.overflow = 'auto';
|
|
1695
|
+
const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
|
|
1696
|
+
const windowSpy = jest.spyOn(window, 'addEventListener');
|
|
1697
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1698
|
+
...defaultViewConfig,
|
|
1699
|
+
fullHeight: true,
|
|
1700
|
+
enableScrollableContainerLazyLoading: false,
|
|
1701
|
+
});
|
|
1702
|
+
await appEmbed.render();
|
|
1703
|
+
await executeAfterWait(() => {
|
|
1704
|
+
expect(windowSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
|
|
1705
|
+
expect(scrollContainerSpy).not.toHaveBeenCalledWith('scroll', expect.any(Function));
|
|
1706
|
+
}, 100);
|
|
1707
|
+
appEmbed.destroy();
|
|
1708
|
+
scrollContainer.style.overflow = '';
|
|
1709
|
+
});
|
|
1710
|
+
test('should wire the window scroll listener to the coordinates sender by default', async () => {
|
|
1711
|
+
const addEventListenerSpy = jest.spyOn(window, 'addEventListener');
|
|
1712
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1713
|
+
...defaultViewConfig,
|
|
1714
|
+
fullHeight: true,
|
|
1715
|
+
});
|
|
1716
|
+
const mockTrigger = jest
|
|
1717
|
+
.spyOn(appEmbed, 'trigger')
|
|
1718
|
+
.mockImplementation(() => Promise.resolve(undefined));
|
|
1719
|
+
await appEmbed.render();
|
|
1720
|
+
await executeAfterWait(() => {
|
|
1721
|
+
const scrollCall = addEventListenerSpy.mock.calls.find(([eventName, , capture]) => eventName === 'scroll' && capture === true);
|
|
1722
|
+
expect(scrollCall).toBeDefined();
|
|
1723
|
+
// Call the handler the way a real scroll event would.
|
|
1724
|
+
scrollCall[1]();
|
|
1725
|
+
expect(mockTrigger).toHaveBeenCalledWith(HostEvent.VisibleEmbedCoordinates, expect.objectContaining({ top: expect.any(Number) }));
|
|
1726
|
+
}, 100);
|
|
1727
|
+
appEmbed.destroy();
|
|
1728
|
+
addEventListenerSpy.mockRestore();
|
|
1729
|
+
});
|
|
1730
|
+
test('should remove listeners on destroy when the flags come from defaults', async () => {
|
|
1731
|
+
const removeEventListenerSpy = jest.spyOn(window, 'removeEventListener');
|
|
1732
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1733
|
+
...defaultViewConfig,
|
|
1734
|
+
fullHeight: true,
|
|
1735
|
+
});
|
|
1736
|
+
await appEmbed.render();
|
|
1737
|
+
appEmbed.destroy();
|
|
1738
|
+
expect(removeEventListenerSpy).toHaveBeenCalledWith('resize', expect.anything());
|
|
1739
|
+
expect(removeEventListenerSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
|
|
1740
|
+
removeEventListenerSpy.mockRestore();
|
|
1741
|
+
});
|
|
1742
|
+
test('should keep an explicit false for the lazy loading flags', async () => {
|
|
1743
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1744
|
+
...defaultViewConfig,
|
|
1745
|
+
fullHeight: true,
|
|
1746
|
+
lazyLoadingForFullHeight: false,
|
|
1747
|
+
enableScrollableContainerLazyLoading: false,
|
|
1748
|
+
lazyLoadingMargin: '0px',
|
|
1749
|
+
});
|
|
1750
|
+
expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBe(false);
|
|
1751
|
+
expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBe(false);
|
|
1752
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBe('0px');
|
|
1753
|
+
});
|
|
1308
1754
|
test('should not set lazyLoadingForEmbed when lazyLoadingForFullHeight is enabled but fullHeight is false', async () => {
|
|
1309
1755
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1310
1756
|
...defaultViewConfig,
|
|
@@ -1743,4 +2189,80 @@ describe('AppEmbed visualOverrides tests', () => {
|
|
|
1743
2189
|
await testVisualOverridesInEmbed(appEmbed, visualOverrides);
|
|
1744
2190
|
});
|
|
1745
2191
|
});
|
|
2192
|
+
describe('AppEmbed getEmbedParamsObject', () => {
|
|
2193
|
+
beforeEach(() => {
|
|
2194
|
+
cleanUp();
|
|
2195
|
+
jest.spyOn(TsEmbed.prototype, 'getAppInitData').mockResolvedValue({});
|
|
2196
|
+
});
|
|
2197
|
+
afterEach(() => {
|
|
2198
|
+
jest.restoreAllMocks();
|
|
2199
|
+
});
|
|
2200
|
+
test('getEmbedParams should use getEmbedParamsObject internally', async () => {
|
|
2201
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2202
|
+
...defaultViewConfig,
|
|
2203
|
+
fullHeight: true,
|
|
2204
|
+
});
|
|
2205
|
+
const getEmbedParamsObjectSpy = jest.spyOn(appEmbed, 'getEmbedParamsObject');
|
|
2206
|
+
await appEmbed.render();
|
|
2207
|
+
expect(getEmbedParamsObjectSpy).toHaveBeenCalled();
|
|
2208
|
+
});
|
|
2209
|
+
test('getEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', () => {
|
|
2210
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2211
|
+
...defaultViewConfig,
|
|
2212
|
+
fullHeight: true,
|
|
2213
|
+
});
|
|
2214
|
+
const params = appEmbed.getEmbedParamsObject();
|
|
2215
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
2216
|
+
expect(params.fullHeight).toBeUndefined();
|
|
2217
|
+
});
|
|
2218
|
+
test('getEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', () => {
|
|
2219
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2220
|
+
...defaultViewConfig,
|
|
2221
|
+
fullHeight: false,
|
|
2222
|
+
});
|
|
2223
|
+
const params = appEmbed.getEmbedParamsObject();
|
|
2224
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
2225
|
+
});
|
|
2226
|
+
test('getUpdateEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', async () => {
|
|
2227
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2228
|
+
...defaultViewConfig,
|
|
2229
|
+
fullHeight: true,
|
|
2230
|
+
});
|
|
2231
|
+
const params = await appEmbed.getUpdateEmbedParamsObject();
|
|
2232
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
2233
|
+
});
|
|
2234
|
+
test('getUpdateEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', async () => {
|
|
2235
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2236
|
+
...defaultViewConfig,
|
|
2237
|
+
fullHeight: false,
|
|
2238
|
+
});
|
|
2239
|
+
const params = await appEmbed.getUpdateEmbedParamsObject();
|
|
2240
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
2241
|
+
});
|
|
2242
|
+
});
|
|
2243
|
+
describe('AppEmbed updatedSpotterExperience tests', () => {
|
|
2244
|
+
beforeEach(() => {
|
|
2245
|
+
cleanUp();
|
|
2246
|
+
});
|
|
2247
|
+
test('should set updatedSpotterExperience to true in url', async () => {
|
|
2248
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2249
|
+
...defaultViewConfig,
|
|
2250
|
+
updatedSpotterExperience: true,
|
|
2251
|
+
});
|
|
2252
|
+
appEmbed.render();
|
|
2253
|
+
await executeAfterWait(() => {
|
|
2254
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
2255
|
+
});
|
|
2256
|
+
});
|
|
2257
|
+
test('should set updatedSpotterExperience to false in url', async () => {
|
|
2258
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
2259
|
+
...defaultViewConfig,
|
|
2260
|
+
updatedSpotterExperience: false,
|
|
2261
|
+
});
|
|
2262
|
+
appEmbed.render();
|
|
2263
|
+
await executeAfterWait(() => {
|
|
2264
|
+
expectUrlMatchesWithParams(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
2265
|
+
});
|
|
2266
|
+
});
|
|
2267
|
+
});
|
|
1746
2268
|
//# sourceMappingURL=app.spec.js.map
|