@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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const app_1 = require("./app");
|
|
5
|
+
const conversation_1 = require("./conversation");
|
|
5
6
|
const index_1 = require("../index");
|
|
6
7
|
const types_1 = require("../types");
|
|
7
8
|
const test_utils_1 = require("../test/test-utils");
|
|
@@ -100,7 +101,7 @@ describe('App embed tests', () => {
|
|
|
100
101
|
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), defaultViewConfig);
|
|
101
102
|
appEmbed.render();
|
|
102
103
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
103
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
104
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
104
105
|
});
|
|
105
106
|
});
|
|
106
107
|
test('should hide the primary nav bar', async () => {
|
|
@@ -110,7 +111,7 @@ describe('App embed tests', () => {
|
|
|
110
111
|
});
|
|
111
112
|
appEmbed.render();
|
|
112
113
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
113
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
114
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
114
115
|
});
|
|
115
116
|
});
|
|
116
117
|
test('should hide the help and profile buttons from nav bar', async () => {
|
|
@@ -120,7 +121,7 @@ describe('App embed tests', () => {
|
|
|
120
121
|
});
|
|
121
122
|
appEmbed.render();
|
|
122
123
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
123
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
124
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
124
125
|
});
|
|
125
126
|
});
|
|
126
127
|
test('should hide the application switcher button from nav bar', async () => {
|
|
@@ -130,7 +131,7 @@ describe('App embed tests', () => {
|
|
|
130
131
|
});
|
|
131
132
|
appEmbed.render();
|
|
132
133
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
133
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
134
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
134
135
|
});
|
|
135
136
|
});
|
|
136
137
|
test('should hide the org switcher button from nav bar', async () => {
|
|
@@ -140,7 +141,7 @@ describe('App embed tests', () => {
|
|
|
140
141
|
});
|
|
141
142
|
appEmbed.render();
|
|
142
143
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
143
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
144
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
144
145
|
});
|
|
145
146
|
});
|
|
146
147
|
describe('should render the correct routes for pages', () => {
|
|
@@ -153,6 +154,8 @@ describe('App embed tests', () => {
|
|
|
153
154
|
[app_1.Page.Home]: 'home',
|
|
154
155
|
[app_1.Page.SpotIQ]: 'insights/results',
|
|
155
156
|
[app_1.Page.Monitor]: 'insights/monitor-alerts',
|
|
157
|
+
[app_1.Page.Collections]: 'collections',
|
|
158
|
+
[app_1.Page.LiveboardSchedules]: 'home/liveboard-schedules',
|
|
156
159
|
};
|
|
157
160
|
const pageIds = Object.keys(pageRouteMap);
|
|
158
161
|
for (let i = 0; i < pageIds.length; i++) {
|
|
@@ -165,7 +168,7 @@ describe('App embed tests', () => {
|
|
|
165
168
|
});
|
|
166
169
|
appEmbed.render();
|
|
167
170
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
168
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
|
|
171
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
|
|
169
172
|
cleanUp();
|
|
170
173
|
});
|
|
171
174
|
});
|
|
@@ -179,6 +182,8 @@ describe('App embed tests', () => {
|
|
|
179
182
|
[app_1.Page.Home]: 'home',
|
|
180
183
|
[app_1.Page.SpotIQ]: 'home/spotiq-analysis',
|
|
181
184
|
[app_1.Page.Monitor]: 'home/monitor-alerts',
|
|
185
|
+
[app_1.Page.Collections]: 'collections',
|
|
186
|
+
[app_1.Page.LiveboardSchedules]: 'home/liveboard-schedules',
|
|
182
187
|
};
|
|
183
188
|
const pageIdsForModularHomes = Object.keys(pageRouteMapForModularHome);
|
|
184
189
|
for (let i = 0; i < pageIdsForModularHomes.length; i++) {
|
|
@@ -192,7 +197,7 @@ describe('App embed tests', () => {
|
|
|
192
197
|
});
|
|
193
198
|
appEmbed.render();
|
|
194
199
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
195
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
|
|
200
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
|
|
196
201
|
cleanUp();
|
|
197
202
|
});
|
|
198
203
|
});
|
|
@@ -205,7 +210,7 @@ describe('App embed tests', () => {
|
|
|
205
210
|
});
|
|
206
211
|
appEmbed.render();
|
|
207
212
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
208
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/foo/bar`);
|
|
213
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/foo/bar`);
|
|
209
214
|
});
|
|
210
215
|
});
|
|
211
216
|
test('should apply runtime filters', async () => {
|
|
@@ -223,7 +228,7 @@ describe('App embed tests', () => {
|
|
|
223
228
|
});
|
|
224
229
|
appEmbed.render();
|
|
225
230
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
226
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
231
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&col1=sales&op1=EQ&val1=1000&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
227
232
|
});
|
|
228
233
|
});
|
|
229
234
|
test('should not append runtime filters in URL if excludeRuntimeFiltersfromURL is true', async () => {
|
|
@@ -241,7 +246,7 @@ describe('App embed tests', () => {
|
|
|
241
246
|
});
|
|
242
247
|
appEmbed.render();
|
|
243
248
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
244
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
249
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
245
250
|
});
|
|
246
251
|
});
|
|
247
252
|
test('should append runtime filters in URL if excludeRuntimeFiltersfromURL is undefined', async () => {
|
|
@@ -260,7 +265,7 @@ describe('App embed tests', () => {
|
|
|
260
265
|
appEmbed.render();
|
|
261
266
|
const runtimeFilter = 'col1=sales&op1=EQ&val1=1000';
|
|
262
267
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
263
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`);
|
|
268
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}&${runtimeFilter}#/home`);
|
|
264
269
|
});
|
|
265
270
|
});
|
|
266
271
|
test('should disable and hide actions', async () => {
|
|
@@ -273,7 +278,7 @@ describe('App embed tests', () => {
|
|
|
273
278
|
});
|
|
274
279
|
appEmbed.render();
|
|
275
280
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
276
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&${test_utils_1.defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${types_1.Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`);
|
|
281
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${test_utils_1.defaultParamsWithoutHiddenActions}&disableAction=[%22save%22,%22update%22]&disableHint=Access%20denied&hideAction=[%22${types_1.Action.ReportError}%22,%22download%22]${defaultParamsPost}#/home`);
|
|
277
282
|
});
|
|
278
283
|
});
|
|
279
284
|
test('should set enable2ColumnLayout to true in url', async () => {
|
|
@@ -283,7 +288,17 @@ describe('App embed tests', () => {
|
|
|
283
288
|
});
|
|
284
289
|
appEmbed.render();
|
|
285
290
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
286
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`);
|
|
291
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
test('should set isLiveboardAlwaysOn12ColLayout to true in url', async () => {
|
|
295
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
296
|
+
...defaultViewConfig,
|
|
297
|
+
isLiveboardAlwaysOn12ColLayout: true,
|
|
298
|
+
});
|
|
299
|
+
appEmbed.render();
|
|
300
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
301
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardAlwaysOn12ColLayout=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
287
302
|
});
|
|
288
303
|
});
|
|
289
304
|
test('should set coverAndFilterOptionInPDF to false in url', async () => {
|
|
@@ -293,7 +308,7 @@ describe('App embed tests', () => {
|
|
|
293
308
|
});
|
|
294
309
|
appEmbed.render();
|
|
295
310
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
296
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false${defaultParamsPost}#/home`);
|
|
311
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
297
312
|
});
|
|
298
313
|
});
|
|
299
314
|
test('should set isLiveboardStylingAndGroupingEnabled to true in url (deprecated, use isLiveboardMasterpiecesEnabled)', async () => {
|
|
@@ -303,7 +318,17 @@ describe('App embed tests', () => {
|
|
|
303
318
|
});
|
|
304
319
|
appEmbed.render();
|
|
305
320
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
306
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true${defaultParamsPost}#/home`);
|
|
321
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
test('should set liveboardGutter in url', async () => {
|
|
325
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
326
|
+
...defaultViewConfig,
|
|
327
|
+
liveboardGutter: 8,
|
|
328
|
+
});
|
|
329
|
+
appEmbed.render();
|
|
330
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
331
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&liveboardGutter=8&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
307
332
|
});
|
|
308
333
|
});
|
|
309
334
|
test('should set isThisPeriodInDateFiltersEnabled to true in url', async () => {
|
|
@@ -313,7 +338,7 @@ describe('App embed tests', () => {
|
|
|
313
338
|
});
|
|
314
339
|
appEmbed.render();
|
|
315
340
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
316
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true${defaultParamsPost}#/home`);
|
|
341
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
317
342
|
});
|
|
318
343
|
});
|
|
319
344
|
test('should set enableHomepageAnnouncement to true in url', async () => {
|
|
@@ -323,14 +348,14 @@ describe('App embed tests', () => {
|
|
|
323
348
|
});
|
|
324
349
|
appEmbed.render();
|
|
325
350
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
326
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true${defaultParamsPost}#/home`);
|
|
351
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
327
352
|
});
|
|
328
353
|
});
|
|
329
354
|
test('should set enableHomepageAnnouncement to false in url when not provided in AppViewConfig', async () => {
|
|
330
355
|
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), defaultViewConfig);
|
|
331
356
|
appEmbed.render();
|
|
332
357
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
333
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false${defaultParamsPost}#/home`);
|
|
358
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
334
359
|
});
|
|
335
360
|
});
|
|
336
361
|
test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
|
|
@@ -340,7 +365,7 @@ describe('App embed tests', () => {
|
|
|
340
365
|
});
|
|
341
366
|
appEmbed.render();
|
|
342
367
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
343
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`);
|
|
368
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
344
369
|
});
|
|
345
370
|
});
|
|
346
371
|
test('should set isWYSIWYGLiveboardPDFEnabled to true in url', async () => {
|
|
@@ -350,16 +375,16 @@ describe('App embed tests', () => {
|
|
|
350
375
|
});
|
|
351
376
|
appEmbed.render();
|
|
352
377
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
353
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true${defaultParamsPost}#/home`);
|
|
378
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
354
379
|
});
|
|
355
380
|
});
|
|
356
|
-
test('should
|
|
381
|
+
test('should not set isWYSIWYGLiveboardPDFEnabled in url by default', async () => {
|
|
357
382
|
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
358
383
|
...defaultViewConfig,
|
|
359
384
|
});
|
|
360
385
|
appEmbed.render();
|
|
361
386
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
362
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
387
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
363
388
|
});
|
|
364
389
|
});
|
|
365
390
|
test('should set isLinkParametersEnabled to true in url', async () => {
|
|
@@ -369,7 +394,7 @@ describe('App embed tests', () => {
|
|
|
369
394
|
});
|
|
370
395
|
appEmbed.render();
|
|
371
396
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
372
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true${defaultParamsPost}#/home`);
|
|
397
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
373
398
|
});
|
|
374
399
|
});
|
|
375
400
|
test('should set isLinkParametersEnabled to false in url', async () => {
|
|
@@ -379,7 +404,7 @@ describe('App embed tests', () => {
|
|
|
379
404
|
});
|
|
380
405
|
appEmbed.render();
|
|
381
406
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
382
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false${defaultParamsPost}#/home`);
|
|
407
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
383
408
|
});
|
|
384
409
|
});
|
|
385
410
|
test('Should add homepageVersion=v4 and updatedSpotterChatPrompt=true when homePage is Focused to the iframe src', async () => {
|
|
@@ -388,7 +413,7 @@ describe('App embed tests', () => {
|
|
|
388
413
|
discoveryExperience: {
|
|
389
414
|
homePage: app_1.HomePage.Focused,
|
|
390
415
|
},
|
|
391
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
416
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
392
417
|
});
|
|
393
418
|
test('Should respect explicit updatedSpotterChatPrompt=false even when homePage is Focused', async () => {
|
|
394
419
|
await testUrlParams({
|
|
@@ -397,7 +422,7 @@ describe('App embed tests', () => {
|
|
|
397
422
|
homePage: app_1.HomePage.Focused,
|
|
398
423
|
},
|
|
399
424
|
updatedSpotterChatPrompt: false,
|
|
400
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
425
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v4&updatedSpotterChatPrompt=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
401
426
|
});
|
|
402
427
|
test('should set isLiveboardXLSXCSVDownloadEnabled to true in url', async () => {
|
|
403
428
|
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
@@ -406,7 +431,7 @@ describe('App embed tests', () => {
|
|
|
406
431
|
});
|
|
407
432
|
appEmbed.render();
|
|
408
433
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
409
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`);
|
|
434
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
410
435
|
});
|
|
411
436
|
});
|
|
412
437
|
test('should set updatedSpotterChatPrompt to true in url', async () => {
|
|
@@ -416,7 +441,7 @@ describe('App embed tests', () => {
|
|
|
416
441
|
});
|
|
417
442
|
appEmbed.render();
|
|
418
443
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
419
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true${defaultParamsPost}#/home`);
|
|
444
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
420
445
|
});
|
|
421
446
|
});
|
|
422
447
|
test('should set updatedSpotterChatPrompt to false in url', async () => {
|
|
@@ -426,7 +451,46 @@ describe('App embed tests', () => {
|
|
|
426
451
|
});
|
|
427
452
|
appEmbed.render();
|
|
428
453
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
429
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false${defaultParamsPost}#/home`);
|
|
454
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
test('should set showSpotterRadiance to true in url', async () => {
|
|
458
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
459
|
+
...defaultViewConfig,
|
|
460
|
+
showSpotterRadiance: true,
|
|
461
|
+
});
|
|
462
|
+
appEmbed.render();
|
|
463
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
464
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=true${defaultParamsPost}#/home`);
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
test('should set showSpotterRadiance to false in url', async () => {
|
|
468
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
469
|
+
...defaultViewConfig,
|
|
470
|
+
showSpotterRadiance: false,
|
|
471
|
+
});
|
|
472
|
+
appEmbed.render();
|
|
473
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
474
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&showSpotterRadiance=false${defaultParamsPost}#/home`);
|
|
475
|
+
});
|
|
476
|
+
});
|
|
477
|
+
test('should set defaultQueryMode to research in url', async () => {
|
|
478
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
479
|
+
...defaultViewConfig,
|
|
480
|
+
defaultQueryMode: conversation_1.SpotterQueryMode.RESEARCH,
|
|
481
|
+
});
|
|
482
|
+
appEmbed.render();
|
|
483
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
484
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&defaultQueryMode=research${defaultParamsPost}#/home`);
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
test('should not set defaultQueryMode in url when unset', async () => {
|
|
488
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
489
|
+
...defaultViewConfig,
|
|
490
|
+
});
|
|
491
|
+
appEmbed.render();
|
|
492
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
493
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false${defaultParamsPost}#/home`);
|
|
430
494
|
});
|
|
431
495
|
});
|
|
432
496
|
test('should set hideToolResponseCardBranding to true in url via spotterChatConfig', async () => {
|
|
@@ -438,7 +502,36 @@ describe('App embed tests', () => {
|
|
|
438
502
|
});
|
|
439
503
|
appEmbed.render();
|
|
440
504
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
441
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true${defaultParamsPost}#/home`);
|
|
505
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
test('should set spotterDataSources to a list of Model GUIDs in url', async () => {
|
|
509
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
510
|
+
...defaultViewConfig,
|
|
511
|
+
spotterDataSources: ['model-guid-123', 'model-guid-456'],
|
|
512
|
+
});
|
|
513
|
+
appEmbed.render();
|
|
514
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
515
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterDataSources=${encodeURIComponent(JSON.stringify(['model-guid-123', 'model-guid-456']))}${defaultParamsPost}#/home`);
|
|
516
|
+
});
|
|
517
|
+
});
|
|
518
|
+
test('should not add spotterDataSources to url when not provided', async () => {
|
|
519
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
520
|
+
...defaultViewConfig,
|
|
521
|
+
});
|
|
522
|
+
appEmbed.render();
|
|
523
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
524
|
+
expect((0, test_utils_1.getIFrameSrc)()).not.toContain('spotterDataSources');
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
test('should not add spotterDataSources to url when empty array', async () => {
|
|
528
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
529
|
+
...defaultViewConfig,
|
|
530
|
+
spotterDataSources: [],
|
|
531
|
+
});
|
|
532
|
+
appEmbed.render();
|
|
533
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
534
|
+
expect((0, test_utils_1.getIFrameSrc)()).not.toContain('spotterDataSources');
|
|
442
535
|
});
|
|
443
536
|
});
|
|
444
537
|
test('should include spotterVizConfig in APP_INIT embedParams when spotterViz is provided', async () => {
|
|
@@ -478,6 +571,33 @@ describe('App embed tests', () => {
|
|
|
478
571
|
});
|
|
479
572
|
});
|
|
480
573
|
});
|
|
574
|
+
test('should include starterPrompts in APP_INIT embedParams', async () => {
|
|
575
|
+
const starterPrompts = {
|
|
576
|
+
enable: true,
|
|
577
|
+
quick: {
|
|
578
|
+
label: 'Quick',
|
|
579
|
+
questions: [
|
|
580
|
+
{ label: 'Q1', prompt: 'P1' },
|
|
581
|
+
{ label: 'Q2', prompt: 'P2' },
|
|
582
|
+
],
|
|
583
|
+
},
|
|
584
|
+
research: { label: 'Research' },
|
|
585
|
+
};
|
|
586
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
587
|
+
...defaultViewConfig,
|
|
588
|
+
spotterChatConfig: { starterPrompts },
|
|
589
|
+
});
|
|
590
|
+
(0, test_utils_1.mockMessageChannel)();
|
|
591
|
+
appEmbed.render();
|
|
592
|
+
const mockPort = { postMessage: jest.fn() };
|
|
593
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
594
|
+
(0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
595
|
+
});
|
|
596
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
597
|
+
expect(mockPort.postMessage.mock.calls[0][0].data.embedParams.starterPrompts)
|
|
598
|
+
.toEqual(starterPrompts);
|
|
599
|
+
});
|
|
600
|
+
});
|
|
481
601
|
test('should pass brandHeadline through spotterVizConfig in APP_INIT', async () => {
|
|
482
602
|
const spotterViz = { brandName: 'MyBrand', brandHeadline: "Hi, there! I'm" };
|
|
483
603
|
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
@@ -548,6 +668,83 @@ describe('App embed tests', () => {
|
|
|
548
668
|
});
|
|
549
669
|
});
|
|
550
670
|
});
|
|
671
|
+
test('should forward spotterChatPinConfig nested in spotterSidebarConfig in APP_INIT', async () => {
|
|
672
|
+
const spotterChatPinConfig = {
|
|
673
|
+
enabled: true,
|
|
674
|
+
pinLabel: 'Pin to top',
|
|
675
|
+
unpinLabel: 'Unpin',
|
|
676
|
+
};
|
|
677
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
678
|
+
...defaultViewConfig,
|
|
679
|
+
spotterSidebarConfig: {
|
|
680
|
+
enablePastConversationsSidebar: true,
|
|
681
|
+
spotterChatPinConfig,
|
|
682
|
+
},
|
|
683
|
+
});
|
|
684
|
+
(0, test_utils_1.mockMessageChannel)();
|
|
685
|
+
appEmbed.render();
|
|
686
|
+
const mockPort = { postMessage: jest.fn() };
|
|
687
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
688
|
+
(0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
689
|
+
});
|
|
690
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
691
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
692
|
+
type: types_1.EmbedEvent.APP_INIT,
|
|
693
|
+
data: expect.objectContaining({
|
|
694
|
+
embedParams: expect.objectContaining({
|
|
695
|
+
spotterSidebarConfig: expect.objectContaining({
|
|
696
|
+
spotterChatPinConfig,
|
|
697
|
+
}),
|
|
698
|
+
}),
|
|
699
|
+
}),
|
|
700
|
+
});
|
|
701
|
+
});
|
|
702
|
+
});
|
|
703
|
+
test('should include spotterShareConversationConfig in APP_INIT embedParams when provided', async () => {
|
|
704
|
+
const spotterShareConversationConfig = {
|
|
705
|
+
enableShareConversation: true,
|
|
706
|
+
spotterShareLabel: 'Share',
|
|
707
|
+
spotterShareModalTitle: 'Share conversation',
|
|
708
|
+
};
|
|
709
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
710
|
+
...defaultViewConfig,
|
|
711
|
+
spotterShareConversationConfig,
|
|
712
|
+
});
|
|
713
|
+
(0, test_utils_1.mockMessageChannel)();
|
|
714
|
+
appEmbed.render();
|
|
715
|
+
const mockPort = { postMessage: jest.fn() };
|
|
716
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
717
|
+
(0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
718
|
+
});
|
|
719
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
720
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
721
|
+
type: types_1.EmbedEvent.APP_INIT,
|
|
722
|
+
data: expect.objectContaining({
|
|
723
|
+
embedParams: expect.objectContaining({
|
|
724
|
+
spotterShareConversationConfig,
|
|
725
|
+
}),
|
|
726
|
+
}),
|
|
727
|
+
});
|
|
728
|
+
});
|
|
729
|
+
});
|
|
730
|
+
test('should not include spotterShareConversationConfig in APP_INIT when not provided', async () => {
|
|
731
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
732
|
+
...defaultViewConfig,
|
|
733
|
+
});
|
|
734
|
+
(0, test_utils_1.mockMessageChannel)();
|
|
735
|
+
appEmbed.render();
|
|
736
|
+
const mockPort = { postMessage: jest.fn() };
|
|
737
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
738
|
+
(0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
|
|
739
|
+
});
|
|
740
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
741
|
+
const callArgs = mockPort.postMessage.mock.calls[0][0];
|
|
742
|
+
expect(callArgs.type).toBe(types_1.EmbedEvent.APP_INIT);
|
|
743
|
+
if (callArgs.data.embedParams) {
|
|
744
|
+
expect(callArgs.data.embedParams.spotterShareConversationConfig).toBeUndefined();
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
});
|
|
551
748
|
test('should set toolResponseCardBrandingLabel in url via spotterChatConfig', async () => {
|
|
552
749
|
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
553
750
|
...defaultViewConfig,
|
|
@@ -557,7 +754,7 @@ describe('App embed tests', () => {
|
|
|
557
754
|
});
|
|
558
755
|
appEmbed.render();
|
|
559
756
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
560
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand${defaultParamsPost}#/home`);
|
|
757
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
561
758
|
});
|
|
562
759
|
});
|
|
563
760
|
test('should set spotterFileUploadEnabled to true in url', async () => {
|
|
@@ -567,7 +764,7 @@ describe('App embed tests', () => {
|
|
|
567
764
|
});
|
|
568
765
|
appEmbed.render();
|
|
569
766
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
570
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true${defaultParamsPost}#/home`);
|
|
767
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
571
768
|
});
|
|
572
769
|
});
|
|
573
770
|
test('should set enableStarterPrompts to true in url', async () => {
|
|
@@ -577,7 +774,41 @@ describe('App embed tests', () => {
|
|
|
577
774
|
});
|
|
578
775
|
appEmbed.render();
|
|
579
776
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
580
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true${defaultParamsPost}#/home`);
|
|
777
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
778
|
+
});
|
|
779
|
+
});
|
|
780
|
+
test('should set openSpotterOnLiveboardByDefault to true in url', async () => {
|
|
781
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
782
|
+
...defaultViewConfig,
|
|
783
|
+
spotterChatConfig: { openSpotterOnLiveboardByDefault: true },
|
|
784
|
+
});
|
|
785
|
+
appEmbed.render();
|
|
786
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
787
|
+
(0, test_utils_1.expectUrlToHaveParamsWithValues)((0, test_utils_1.getIFrameSrc)(), {
|
|
788
|
+
openSpotterOnLiveboardByDefault: 'true',
|
|
789
|
+
});
|
|
790
|
+
});
|
|
791
|
+
});
|
|
792
|
+
test('should set openSpotterOnLiveboardByDefault to false when explicitly disabled', async () => {
|
|
793
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
794
|
+
...defaultViewConfig,
|
|
795
|
+
spotterChatConfig: { openSpotterOnLiveboardByDefault: false },
|
|
796
|
+
});
|
|
797
|
+
appEmbed.render();
|
|
798
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
799
|
+
(0, test_utils_1.expectUrlToHaveParamsWithValues)((0, test_utils_1.getIFrameSrc)(), {
|
|
800
|
+
openSpotterOnLiveboardByDefault: 'false',
|
|
801
|
+
});
|
|
802
|
+
});
|
|
803
|
+
});
|
|
804
|
+
test('should not set openSpotterOnLiveboardByDefault when it is not configured', async () => {
|
|
805
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
806
|
+
...defaultViewConfig,
|
|
807
|
+
spotterChatConfig: { enableStarterPrompts: true },
|
|
808
|
+
});
|
|
809
|
+
appEmbed.render();
|
|
810
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
811
|
+
expect((0, test_utils_1.getIFrameSrc)()).not.toContain('openSpotterOnLiveboardByDefault');
|
|
581
812
|
});
|
|
582
813
|
});
|
|
583
814
|
test('should set spotterFileUploadFileTypes in url', async () => {
|
|
@@ -599,7 +830,7 @@ describe('App embed tests', () => {
|
|
|
599
830
|
});
|
|
600
831
|
appEmbed.render();
|
|
601
832
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
602
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false${defaultParamsPost}#/home`);
|
|
833
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
603
834
|
});
|
|
604
835
|
});
|
|
605
836
|
test('should set isGranularXLSXCSVSchedulesEnabled to true in url', async () => {
|
|
@@ -609,7 +840,7 @@ describe('App embed tests', () => {
|
|
|
609
840
|
});
|
|
610
841
|
appEmbed.render();
|
|
611
842
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
612
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true${defaultParamsPost}#/home`);
|
|
843
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
613
844
|
});
|
|
614
845
|
});
|
|
615
846
|
test('should set isGranularXLSXCSVSchedulesEnabled to false in url', async () => {
|
|
@@ -619,7 +850,7 @@ describe('App embed tests', () => {
|
|
|
619
850
|
});
|
|
620
851
|
appEmbed.render();
|
|
621
852
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
622
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false${defaultParamsPost}#/home`);
|
|
853
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
623
854
|
});
|
|
624
855
|
});
|
|
625
856
|
test('should set isCentralizedLiveboardFilterUXEnabled to true in url', async () => {
|
|
@@ -629,7 +860,7 @@ describe('App embed tests', () => {
|
|
|
629
860
|
});
|
|
630
861
|
appEmbed.render();
|
|
631
862
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
632
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true${defaultParamsPost}#/home`);
|
|
863
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
633
864
|
});
|
|
634
865
|
});
|
|
635
866
|
test('should set isCentralizedLiveboardFilterUXEnabled to false in url', async () => {
|
|
@@ -639,7 +870,36 @@ describe('App embed tests', () => {
|
|
|
639
870
|
});
|
|
640
871
|
appEmbed.render();
|
|
641
872
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
642
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false${defaultParamsPost}#/home`);
|
|
873
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
874
|
+
});
|
|
875
|
+
});
|
|
876
|
+
test('should set isScopedLiveboardFilteringEnabled to true in url', async () => {
|
|
877
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
878
|
+
...defaultViewConfig,
|
|
879
|
+
isScopedLiveboardFilteringEnabled: true,
|
|
880
|
+
});
|
|
881
|
+
appEmbed.render();
|
|
882
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
883
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=true${defaultParamsPost}#/home`);
|
|
884
|
+
});
|
|
885
|
+
});
|
|
886
|
+
test('should set isScopedLiveboardFilteringEnabled to false in url', async () => {
|
|
887
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
888
|
+
...defaultViewConfig,
|
|
889
|
+
isScopedLiveboardFilteringEnabled: false,
|
|
890
|
+
});
|
|
891
|
+
appEmbed.render();
|
|
892
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
893
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isScopedLiveboardFilteringEnabled=false${defaultParamsPost}#/home`);
|
|
894
|
+
});
|
|
895
|
+
});
|
|
896
|
+
test('should not set isScopedLiveboardFilteringEnabled in url when undefined', async () => {
|
|
897
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
898
|
+
...defaultViewConfig,
|
|
899
|
+
});
|
|
900
|
+
appEmbed.render();
|
|
901
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
902
|
+
expect((0, test_utils_1.getIFrameSrc)()).not.toContain('isScopedLiveboardFilteringEnabled');
|
|
643
903
|
});
|
|
644
904
|
});
|
|
645
905
|
test('Should add the tag to the iframe src', async () => {
|
|
@@ -650,7 +910,7 @@ describe('App embed tests', () => {
|
|
|
650
910
|
});
|
|
651
911
|
appEmbed.render();
|
|
652
912
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
653
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}&tag=Finance${defaultParamsPost}#/home`);
|
|
913
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}&tag=Finance${defaultParamsPost}#/home`);
|
|
654
914
|
});
|
|
655
915
|
});
|
|
656
916
|
test('Should add the hideTagFilterChips true to the iframe src', async () => {
|
|
@@ -661,7 +921,7 @@ describe('App embed tests', () => {
|
|
|
661
921
|
});
|
|
662
922
|
appEmbed.render();
|
|
663
923
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
664
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`);
|
|
924
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`);
|
|
665
925
|
});
|
|
666
926
|
});
|
|
667
927
|
test('Should add the hideTagFilterChips false to the iframe src', async () => {
|
|
@@ -672,7 +932,7 @@ describe('App embed tests', () => {
|
|
|
672
932
|
});
|
|
673
933
|
appEmbed.render();
|
|
674
934
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
675
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`);
|
|
935
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`);
|
|
676
936
|
});
|
|
677
937
|
});
|
|
678
938
|
test('Should not add hideTagFilterChips if it is undefined', async () => {
|
|
@@ -682,7 +942,7 @@ describe('App embed tests', () => {
|
|
|
682
942
|
});
|
|
683
943
|
appEmbed.render();
|
|
684
944
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
685
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
945
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
686
946
|
});
|
|
687
947
|
});
|
|
688
948
|
test('Should add showMaskedFilterChip true to the iframe src', async () => {
|
|
@@ -693,7 +953,7 @@ describe('App embed tests', () => {
|
|
|
693
953
|
});
|
|
694
954
|
appEmbed.render();
|
|
695
955
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
696
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
956
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
697
957
|
});
|
|
698
958
|
});
|
|
699
959
|
test('Should add showMaskedFilterChip false to the iframe src', async () => {
|
|
@@ -704,7 +964,7 @@ describe('App embed tests', () => {
|
|
|
704
964
|
});
|
|
705
965
|
appEmbed.render();
|
|
706
966
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
707
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
967
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
708
968
|
});
|
|
709
969
|
});
|
|
710
970
|
test('Should add default showMaskedFilterChip false when not specified', async () => {
|
|
@@ -714,7 +974,7 @@ describe('App embed tests', () => {
|
|
|
714
974
|
});
|
|
715
975
|
appEmbed.render();
|
|
716
976
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
717
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
977
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showMaskedFilterChip=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
718
978
|
});
|
|
719
979
|
});
|
|
720
980
|
test('Should add isLiveboardMasterpiecesEnabled true to the iframe src', async () => {
|
|
@@ -725,7 +985,7 @@ describe('App embed tests', () => {
|
|
|
725
985
|
});
|
|
726
986
|
appEmbed.render();
|
|
727
987
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
728
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
988
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
729
989
|
});
|
|
730
990
|
});
|
|
731
991
|
test('Should add isLiveboardMasterpiecesEnabled false to the iframe src', async () => {
|
|
@@ -736,17 +996,7 @@ describe('App embed tests', () => {
|
|
|
736
996
|
});
|
|
737
997
|
appEmbed.render();
|
|
738
998
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
739
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
740
|
-
});
|
|
741
|
-
});
|
|
742
|
-
test('Should add default isLiveboardMasterpiecesEnabled false when not specified', async () => {
|
|
743
|
-
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
744
|
-
...defaultViewConfig,
|
|
745
|
-
showPrimaryNavbar: false,
|
|
746
|
-
});
|
|
747
|
-
appEmbed.render();
|
|
748
|
-
await (0, test_utils_1.executeAfterWait)(() => {
|
|
749
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
999
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardMasterpiecesEnabled=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
750
1000
|
});
|
|
751
1001
|
});
|
|
752
1002
|
test('Should add newChartsLibrary true to the iframe src', async () => {
|
|
@@ -757,7 +1007,7 @@ describe('App embed tests', () => {
|
|
|
757
1007
|
});
|
|
758
1008
|
appEmbed.render();
|
|
759
1009
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
760
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1010
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
761
1011
|
});
|
|
762
1012
|
});
|
|
763
1013
|
test('Should add newChartsLibrary false to the iframe src', async () => {
|
|
@@ -768,7 +1018,7 @@ describe('App embed tests', () => {
|
|
|
768
1018
|
});
|
|
769
1019
|
appEmbed.render();
|
|
770
1020
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
771
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1021
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&muzeChartPhase1EnabledGA=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
772
1022
|
});
|
|
773
1023
|
});
|
|
774
1024
|
test('Should not add newChartsLibrary to the iframe src when not specified', async () => {
|
|
@@ -778,7 +1028,7 @@ describe('App embed tests', () => {
|
|
|
778
1028
|
});
|
|
779
1029
|
appEmbed.render();
|
|
780
1030
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
781
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1031
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
782
1032
|
});
|
|
783
1033
|
});
|
|
784
1034
|
test('Should add enableSearchAssist flagto the iframe src', async () => {
|
|
@@ -788,7 +1038,7 @@ describe('App embed tests', () => {
|
|
|
788
1038
|
});
|
|
789
1039
|
appEmbed.render();
|
|
790
1040
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
791
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1041
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableSearchAssist=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
792
1042
|
});
|
|
793
1043
|
});
|
|
794
1044
|
test('Should add enableDataPanelV2 flag to the iframe src', async () => {
|
|
@@ -798,7 +1048,7 @@ describe('App embed tests', () => {
|
|
|
798
1048
|
});
|
|
799
1049
|
appEmbed.render();
|
|
800
1050
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
801
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1051
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
802
1052
|
});
|
|
803
1053
|
});
|
|
804
1054
|
test('Should add isLiveboardHeaderSticky flag to the iframe src', async () => {
|
|
@@ -808,7 +1058,7 @@ describe('App embed tests', () => {
|
|
|
808
1058
|
});
|
|
809
1059
|
appEmbed.render();
|
|
810
1060
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
811
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1061
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
812
1062
|
});
|
|
813
1063
|
});
|
|
814
1064
|
test('Should add isLiveboardCompactHeaderEnabled flag to the iframe src', async () => {
|
|
@@ -818,7 +1068,7 @@ describe('App embed tests', () => {
|
|
|
818
1068
|
});
|
|
819
1069
|
appEmbed.render();
|
|
820
1070
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
821
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1071
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderV2Enabled=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
822
1072
|
});
|
|
823
1073
|
});
|
|
824
1074
|
test('Should add showLiveboardReverifyBanner flag to the iframe src', async () => {
|
|
@@ -828,7 +1078,7 @@ describe('App embed tests', () => {
|
|
|
828
1078
|
});
|
|
829
1079
|
appEmbed.render();
|
|
830
1080
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
831
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1081
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardReverifyBanner=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
832
1082
|
});
|
|
833
1083
|
});
|
|
834
1084
|
test('Should add isUnifiedSearchExperienceEnabled flag to the iframe src', async () => {
|
|
@@ -839,7 +1089,7 @@ describe('App embed tests', () => {
|
|
|
839
1089
|
});
|
|
840
1090
|
appEmbedTrue.render();
|
|
841
1091
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
842
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1092
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
843
1093
|
});
|
|
844
1094
|
appEmbedTrue.destroy();
|
|
845
1095
|
// Case 2: explicitly false
|
|
@@ -849,7 +1099,7 @@ describe('App embed tests', () => {
|
|
|
849
1099
|
});
|
|
850
1100
|
appEmbedFalse.render();
|
|
851
1101
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
852
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1102
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
853
1103
|
});
|
|
854
1104
|
appEmbedFalse.destroy();
|
|
855
1105
|
// Case 3: not provided — defaults to false
|
|
@@ -858,7 +1108,7 @@ describe('App embed tests', () => {
|
|
|
858
1108
|
});
|
|
859
1109
|
appEmbedDefault.render();
|
|
860
1110
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
861
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1111
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
862
1112
|
});
|
|
863
1113
|
});
|
|
864
1114
|
test('should set newConnectionsExperience to true in url', async () => {
|
|
@@ -897,7 +1147,7 @@ describe('App embed tests', () => {
|
|
|
897
1147
|
});
|
|
898
1148
|
appEmbed.render();
|
|
899
1149
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
900
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1150
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideIrrelevantFiltersAtTabLevel=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
901
1151
|
});
|
|
902
1152
|
});
|
|
903
1153
|
test('Should add showLiveboardVerifiedBadge flag to the iframe src', async () => {
|
|
@@ -907,7 +1157,7 @@ describe('App embed tests', () => {
|
|
|
907
1157
|
});
|
|
908
1158
|
appEmbed.render();
|
|
909
1159
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
910
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1160
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&showLiveboardVerifiedBadge=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
911
1161
|
});
|
|
912
1162
|
});
|
|
913
1163
|
test('Should add isLiveboardPermissionV2Enabled flag to the iframe src', async () => {
|
|
@@ -917,7 +1167,7 @@ describe('App embed tests', () => {
|
|
|
917
1167
|
});
|
|
918
1168
|
appEmbed.render();
|
|
919
1169
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
920
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1170
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
921
1171
|
});
|
|
922
1172
|
});
|
|
923
1173
|
test('Should add default values of flags to the iframe src', async () => {
|
|
@@ -926,7 +1176,7 @@ describe('App embed tests', () => {
|
|
|
926
1176
|
});
|
|
927
1177
|
appEmbed.render();
|
|
928
1178
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
929
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1179
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardHeaderSticky=true&hideLiveboardHeader=false&showLiveboardDescription=true&showLiveboardTitle=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
930
1180
|
});
|
|
931
1181
|
});
|
|
932
1182
|
test('Should add modularHomeExperience flag to the iframe src', async () => {
|
|
@@ -936,7 +1186,7 @@ describe('App embed tests', () => {
|
|
|
936
1186
|
});
|
|
937
1187
|
appEmbed.render();
|
|
938
1188
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
939
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1189
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
940
1190
|
});
|
|
941
1191
|
});
|
|
942
1192
|
test('Should add hideHomepageLeftNav flag to the iframe src', async () => {
|
|
@@ -946,7 +1196,7 @@ describe('App embed tests', () => {
|
|
|
946
1196
|
});
|
|
947
1197
|
appEmbed.render();
|
|
948
1198
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
949
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1199
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHomepageLeftNav=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
950
1200
|
});
|
|
951
1201
|
});
|
|
952
1202
|
test('Should add hideHamburger, hideObjectSearch, hideNotification flags to the iframe src', async () => {
|
|
@@ -958,7 +1208,7 @@ describe('App embed tests', () => {
|
|
|
958
1208
|
});
|
|
959
1209
|
appEmbed.render();
|
|
960
1210
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
961
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1211
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&hideHamburger=true&hideObjectSearch=true&hideNotification=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
962
1212
|
});
|
|
963
1213
|
});
|
|
964
1214
|
test('Should not add when hideHamburger, hideObjectSearch, hideNotification values are not true to the iframe src', async () => {
|
|
@@ -970,65 +1220,14 @@ describe('App embed tests', () => {
|
|
|
970
1220
|
});
|
|
971
1221
|
appEmbed.render();
|
|
972
1222
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
973
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1223
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
974
1224
|
});
|
|
975
1225
|
});
|
|
976
|
-
test('Should add navigationVersion=v3 when primaryNavbarVersion is Sliding to the iframe src', async () => {
|
|
977
|
-
await testUrlParams({
|
|
978
|
-
...defaultViewConfig,
|
|
979
|
-
discoveryExperience: {
|
|
980
|
-
primaryNavbarVersion: app_1.PrimaryNavbarVersion.Sliding,
|
|
981
|
-
homePage: app_1.HomePage.Modular,
|
|
982
|
-
},
|
|
983
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
984
|
-
});
|
|
985
|
-
test('Should not add navigationVersion=v3 when primaryNavbarVersion is not added to the iframe src', async () => {
|
|
986
|
-
await testUrlParams({
|
|
987
|
-
...defaultViewConfig,
|
|
988
|
-
discoveryExperience: {
|
|
989
|
-
homePage: app_1.HomePage.Modular,
|
|
990
|
-
},
|
|
991
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
992
|
-
});
|
|
993
|
-
test('Should add navigationVersion=v3 & modularHomeExperience=true when primaryNavbarVersion is Sliding to the iframe src', async () => {
|
|
994
|
-
await testUrlParams({
|
|
995
|
-
...defaultViewConfig,
|
|
996
|
-
// homePage v2 config not included under discoveryExperience
|
|
997
|
-
discoveryExperience: {
|
|
998
|
-
primaryNavbarVersion: app_1.PrimaryNavbarVersion.Sliding,
|
|
999
|
-
},
|
|
1000
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1001
|
-
});
|
|
1002
|
-
test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when Sliding and ModularWithStylingChanges configured in the iframe src', async () => {
|
|
1003
|
-
await testUrlParams({
|
|
1004
|
-
...defaultViewConfig,
|
|
1005
|
-
discoveryExperience: {
|
|
1006
|
-
primaryNavbarVersion: app_1.PrimaryNavbarVersion.Sliding,
|
|
1007
|
-
homePage: app_1.HomePage.ModularWithStylingChanges,
|
|
1008
|
-
},
|
|
1009
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1010
|
-
});
|
|
1011
|
-
test('Should add homepageVersion=v3 & navigationVersion=v3 & modularHomeExperience=true when homePage is ModularWithStylingChanges to the iframe src', async () => {
|
|
1012
|
-
await testUrlParams({
|
|
1013
|
-
...defaultViewConfig,
|
|
1014
|
-
// primaryNavbarVersion is not included under
|
|
1015
|
-
// discoveryExperience, then it set navigationVersion=v2 and
|
|
1016
|
-
// modularHomeExperience=false.
|
|
1017
|
-
discoveryExperience: {
|
|
1018
|
-
homePage: app_1.HomePage.ModularWithStylingChanges,
|
|
1019
|
-
},
|
|
1020
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1021
|
-
});
|
|
1022
|
-
test('Should add navigationVersion=v2 when primaryNavbarVersion is not added to the iframe src', async () => {
|
|
1023
|
-
await testUrlParams({
|
|
1024
|
-
...defaultViewConfig,
|
|
1025
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1026
|
-
});
|
|
1027
1226
|
test('Should add enableAskSage flag to the iframe src', async () => {
|
|
1028
1227
|
await testUrlParams({
|
|
1029
1228
|
...defaultViewConfig,
|
|
1030
1229
|
enableAskSage: true,
|
|
1031
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1230
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableAskSage=true&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1032
1231
|
});
|
|
1033
1232
|
test('Should add listpageVersion=v3 when listPageVersion is ListWithUXChanges to the iframe src', async () => {
|
|
1034
1233
|
await testUrlParams({
|
|
@@ -1036,31 +1235,30 @@ describe('App embed tests', () => {
|
|
|
1036
1235
|
discoveryExperience: {
|
|
1037
1236
|
listPageVersion: app_1.ListPage.ListWithUXChanges,
|
|
1038
1237
|
},
|
|
1039
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1238
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&listpageVersion=v3&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1040
1239
|
});
|
|
1041
|
-
test('Should
|
|
1240
|
+
test('Should send navigationVersion=v3 & homepageVersion=v3 by default when no discoveryExperience is provided', async () => {
|
|
1042
1241
|
await testUrlParams({
|
|
1043
1242
|
...defaultViewConfig,
|
|
1044
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1243
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1045
1244
|
});
|
|
1046
|
-
test('Should
|
|
1047
|
-
|
|
1245
|
+
test('Should not send modularHomeExperience param by default when not specified', async () => {
|
|
1246
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1048
1247
|
...defaultViewConfig,
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1248
|
+
});
|
|
1249
|
+
appEmbed.render();
|
|
1250
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1251
|
+
const url = new URL((0, test_utils_1.getIFrameSrc)());
|
|
1252
|
+
expect(url.searchParams.has('modularHomeExperience')).toBe(false);
|
|
1253
|
+
});
|
|
1054
1254
|
});
|
|
1055
1255
|
test('Should add listpageVersion=v3 combined with other discoveryExperience options to the iframe src', async () => {
|
|
1056
1256
|
await testUrlParams({
|
|
1057
1257
|
...defaultViewConfig,
|
|
1058
1258
|
discoveryExperience: {
|
|
1059
|
-
primaryNavbarVersion: app_1.PrimaryNavbarVersion.Sliding,
|
|
1060
|
-
homePage: app_1.HomePage.Modular,
|
|
1061
1259
|
listPageVersion: app_1.ListPage.ListWithUXChanges,
|
|
1062
1260
|
},
|
|
1063
|
-
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1261
|
+
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&listpageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1064
1262
|
});
|
|
1065
1263
|
test('Should add enablePendoHelp flag to the iframe src conditional on navbar', async () => {
|
|
1066
1264
|
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
@@ -1068,7 +1266,7 @@ describe('App embed tests', () => {
|
|
|
1068
1266
|
});
|
|
1069
1267
|
appEmbed.render();
|
|
1070
1268
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1071
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1269
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1072
1270
|
});
|
|
1073
1271
|
const noNavEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1074
1272
|
...defaultViewConfig,
|
|
@@ -1076,7 +1274,7 @@ describe('App embed tests', () => {
|
|
|
1076
1274
|
});
|
|
1077
1275
|
noNavEmbed.render();
|
|
1078
1276
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1079
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1277
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1080
1278
|
});
|
|
1081
1279
|
});
|
|
1082
1280
|
test('should set enableLiveboardDataCache to true in url', async () => {
|
|
@@ -1086,7 +1284,7 @@ describe('App embed tests', () => {
|
|
|
1086
1284
|
});
|
|
1087
1285
|
appEmbed.render();
|
|
1088
1286
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1089
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true${defaultParamsPost}#/home`);
|
|
1287
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
1090
1288
|
});
|
|
1091
1289
|
});
|
|
1092
1290
|
test('should set enableLiveboardDataCache to false in url', async () => {
|
|
@@ -1096,7 +1294,7 @@ describe('App embed tests', () => {
|
|
|
1096
1294
|
});
|
|
1097
1295
|
appEmbed.render();
|
|
1098
1296
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1099
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false${defaultParamsPost}#/home`);
|
|
1297
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
1100
1298
|
});
|
|
1101
1299
|
});
|
|
1102
1300
|
test('should not set enableLiveboardDataCache in url when not provided', async () => {
|
|
@@ -1115,7 +1313,7 @@ describe('App embed tests', () => {
|
|
|
1115
1313
|
});
|
|
1116
1314
|
await appEmbed.render();
|
|
1117
1315
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1118
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1316
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=objectSearch&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1119
1317
|
});
|
|
1120
1318
|
});
|
|
1121
1319
|
test('Should add HomePageSearchBarMode flag with ai answer to the iframe src', async () => {
|
|
@@ -1125,7 +1323,7 @@ describe('App embed tests', () => {
|
|
|
1125
1323
|
});
|
|
1126
1324
|
await appEmbed.render();
|
|
1127
1325
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1128
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1326
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=aiAnswer&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1129
1327
|
});
|
|
1130
1328
|
});
|
|
1131
1329
|
test('Should add HomePageSearchBarMode flag with none to the iframe src', async () => {
|
|
@@ -1135,7 +1333,7 @@ describe('App embed tests', () => {
|
|
|
1135
1333
|
});
|
|
1136
1334
|
await appEmbed.render();
|
|
1137
1335
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1138
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1336
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&homePageSearchBarMode=none&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1139
1337
|
});
|
|
1140
1338
|
});
|
|
1141
1339
|
test('Should add dataPanelCustomGroupsAccordionInitialState flag to the iframe src', async () => {
|
|
@@ -1145,7 +1343,7 @@ describe('App embed tests', () => {
|
|
|
1145
1343
|
});
|
|
1146
1344
|
appEmbed.render();
|
|
1147
1345
|
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1148
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&
|
|
1346
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST&navigationVersion=v3&homepageVersion=v3${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
|
|
1149
1347
|
});
|
|
1150
1348
|
});
|
|
1151
1349
|
test('should register event handlers to adjust iframe height', async () => {
|
|
@@ -1197,7 +1395,7 @@ describe('App embed tests', () => {
|
|
|
1197
1395
|
});
|
|
1198
1396
|
await appEmbed.render();
|
|
1199
1397
|
appEmbed.navigateToPage(path);
|
|
1200
|
-
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${test_utils_1.defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1398
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&navigationVersion=v3&homepageVersion=v3&${test_utils_1.defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1201
1399
|
});
|
|
1202
1400
|
test('navigateToPage with noReload should trigger the appropriate event', async () => {
|
|
1203
1401
|
(0, test_utils_1.mockMessageChannel)();
|
|
@@ -1245,6 +1443,85 @@ describe('App embed tests', () => {
|
|
|
1245
1443
|
await appEmbed.render();
|
|
1246
1444
|
expect(logger_1.logger.log).toHaveBeenCalledWith('Please call render before invoking this method');
|
|
1247
1445
|
});
|
|
1446
|
+
describe('overrideHistoryState flag', () => {
|
|
1447
|
+
test('navigateToPage with overrideHistoryState=true should trigger HostEvent.Navigate', async () => {
|
|
1448
|
+
(0, test_utils_1.mockMessageChannel)();
|
|
1449
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1450
|
+
frameParams: {
|
|
1451
|
+
width: '100%',
|
|
1452
|
+
height: '100%',
|
|
1453
|
+
},
|
|
1454
|
+
overrideHistoryState: true,
|
|
1455
|
+
});
|
|
1456
|
+
await appEmbed.render();
|
|
1457
|
+
const iframe = (0, test_utils_1.getIFrameEl)();
|
|
1458
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1459
|
+
appEmbed.navigateToPage(path, false);
|
|
1460
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
1461
|
+
type: types_1.HostEvent.Navigate,
|
|
1462
|
+
data: path,
|
|
1463
|
+
}), `http://${thoughtSpotHost}`, expect.anything());
|
|
1464
|
+
});
|
|
1465
|
+
test('navigateToPage with overrideHistoryState=true and path as number should trigger HostEvent.Navigate', async () => {
|
|
1466
|
+
(0, test_utils_1.mockMessageChannel)();
|
|
1467
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1468
|
+
frameParams: {
|
|
1469
|
+
width: '100%',
|
|
1470
|
+
height: '100%',
|
|
1471
|
+
},
|
|
1472
|
+
overrideHistoryState: true,
|
|
1473
|
+
});
|
|
1474
|
+
await appEmbed.render();
|
|
1475
|
+
const iframe = (0, test_utils_1.getIFrameEl)();
|
|
1476
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1477
|
+
appEmbed.navigateToPage(-1, false);
|
|
1478
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
1479
|
+
type: types_1.HostEvent.Navigate,
|
|
1480
|
+
data: -1,
|
|
1481
|
+
}), `http://${thoughtSpotHost}`, expect.anything());
|
|
1482
|
+
});
|
|
1483
|
+
test('navigateToPage with overrideHistoryState=false and noReload=false should update iframe src', async () => {
|
|
1484
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1485
|
+
frameParams: {
|
|
1486
|
+
width: '100%',
|
|
1487
|
+
height: '100%',
|
|
1488
|
+
},
|
|
1489
|
+
overrideHistoryState: false,
|
|
1490
|
+
});
|
|
1491
|
+
await appEmbed.render();
|
|
1492
|
+
appEmbed.navigateToPage(path, false);
|
|
1493
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${test_utils_1.defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1494
|
+
});
|
|
1495
|
+
test('navigateToPage with overrideHistoryState=undefined and noReload=false should update iframe src', async () => {
|
|
1496
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1497
|
+
frameParams: {
|
|
1498
|
+
width: '100%',
|
|
1499
|
+
height: '100%',
|
|
1500
|
+
},
|
|
1501
|
+
});
|
|
1502
|
+
await appEmbed.render();
|
|
1503
|
+
appEmbed.navigateToPage(path, false);
|
|
1504
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${test_utils_1.defaultParamsForPinboardEmbed}${defaultParamsPost}#/${path}`);
|
|
1505
|
+
});
|
|
1506
|
+
test('navigateToPage respects noReload priority over overrideHistoryState', async () => {
|
|
1507
|
+
(0, test_utils_1.mockMessageChannel)();
|
|
1508
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1509
|
+
frameParams: {
|
|
1510
|
+
width: '100%',
|
|
1511
|
+
height: '100%',
|
|
1512
|
+
},
|
|
1513
|
+
overrideHistoryState: false,
|
|
1514
|
+
});
|
|
1515
|
+
await appEmbed.render();
|
|
1516
|
+
const iframe = (0, test_utils_1.getIFrameEl)();
|
|
1517
|
+
iframe.contentWindow.postMessage = jest.fn();
|
|
1518
|
+
appEmbed.navigateToPage(path, true);
|
|
1519
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
1520
|
+
type: types_1.HostEvent.Navigate,
|
|
1521
|
+
data: path,
|
|
1522
|
+
}), `http://${thoughtSpotHost}`, expect.anything());
|
|
1523
|
+
});
|
|
1524
|
+
});
|
|
1248
1525
|
});
|
|
1249
1526
|
describe('LazyLoadingForFullHeight functionality', () => {
|
|
1250
1527
|
let mockIFrame;
|
|
@@ -1308,6 +1585,175 @@ describe('App embed tests', () => {
|
|
|
1308
1585
|
expect(iframeSrc).toContain('isFullHeightPinboard=true');
|
|
1309
1586
|
}, 100);
|
|
1310
1587
|
});
|
|
1588
|
+
test('should default lazy loading flags to true when fullHeight is enabled', async () => {
|
|
1589
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1590
|
+
...defaultViewConfig,
|
|
1591
|
+
fullHeight: true,
|
|
1592
|
+
});
|
|
1593
|
+
expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBe(true);
|
|
1594
|
+
expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBe(true);
|
|
1595
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBe('500px 0px');
|
|
1596
|
+
await appEmbed.render();
|
|
1597
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1598
|
+
const iframeSrc = (0, test_utils_1.getIFrameSrc)();
|
|
1599
|
+
expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
|
|
1600
|
+
expect(iframeSrc).toContain('isFullHeightPinboard=true');
|
|
1601
|
+
expect(iframeSrc).toContain('rootMarginForLazyLoad=500px%200px');
|
|
1602
|
+
}, 100);
|
|
1603
|
+
});
|
|
1604
|
+
test('should not default lazy loading flags when fullHeight is not enabled', async () => {
|
|
1605
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1606
|
+
...defaultViewConfig,
|
|
1607
|
+
});
|
|
1608
|
+
expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBeUndefined();
|
|
1609
|
+
expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
|
|
1610
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBeUndefined();
|
|
1611
|
+
});
|
|
1612
|
+
test('should not write the defaults back onto the caller view config', async () => {
|
|
1613
|
+
const callerViewConfig = {
|
|
1614
|
+
...defaultViewConfig,
|
|
1615
|
+
fullHeight: true,
|
|
1616
|
+
};
|
|
1617
|
+
new app_1.AppEmbed((0, test_utils_1.getRootEl)(), callerViewConfig);
|
|
1618
|
+
expect(callerViewConfig.lazyLoadingForFullHeight).toBeUndefined();
|
|
1619
|
+
expect(callerViewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
|
|
1620
|
+
expect(callerViewConfig.lazyLoadingMargin).toBeUndefined();
|
|
1621
|
+
});
|
|
1622
|
+
test('should not default lazy loading flags when fullHeight is explicitly false', async () => {
|
|
1623
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1624
|
+
...defaultViewConfig,
|
|
1625
|
+
fullHeight: false,
|
|
1626
|
+
});
|
|
1627
|
+
expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBeUndefined();
|
|
1628
|
+
expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBeUndefined();
|
|
1629
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBeUndefined();
|
|
1630
|
+
});
|
|
1631
|
+
test('should default lazyLoadingMargin when lazyLoadingForFullHeight is set explicitly', async () => {
|
|
1632
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1633
|
+
...defaultViewConfig,
|
|
1634
|
+
fullHeight: true,
|
|
1635
|
+
lazyLoadingForFullHeight: true,
|
|
1636
|
+
});
|
|
1637
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBe(config.DEFAULT_LAZY_LOADING_MARGIN);
|
|
1638
|
+
await appEmbed.render();
|
|
1639
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1640
|
+
expect((0, test_utils_1.getIFrameSrc)()).toContain('rootMarginForLazyLoad=500px%200px');
|
|
1641
|
+
}, 100);
|
|
1642
|
+
});
|
|
1643
|
+
test('should let an explicit lazyLoadingMargin win over the default', async () => {
|
|
1644
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1645
|
+
...defaultViewConfig,
|
|
1646
|
+
fullHeight: true,
|
|
1647
|
+
lazyLoadingMargin: '250px',
|
|
1648
|
+
});
|
|
1649
|
+
await appEmbed.render();
|
|
1650
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1651
|
+
const iframeSrc = (0, test_utils_1.getIFrameSrc)();
|
|
1652
|
+
expect(iframeSrc).toContain('rootMarginForLazyLoad=250px');
|
|
1653
|
+
expect(iframeSrc).not.toContain('rootMarginForLazyLoad=500px%200px');
|
|
1654
|
+
}, 100);
|
|
1655
|
+
});
|
|
1656
|
+
test('should drop an invalid lazyLoadingMargin and log an error', async () => {
|
|
1657
|
+
const loggerErrorSpy = jest.spyOn(logger_1.logger, 'error').mockImplementation(() => undefined);
|
|
1658
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1659
|
+
...defaultViewConfig,
|
|
1660
|
+
fullHeight: true,
|
|
1661
|
+
lazyLoadingMargin: 'not-a-margin',
|
|
1662
|
+
});
|
|
1663
|
+
await appEmbed.render();
|
|
1664
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1665
|
+
const iframeSrc = (0, test_utils_1.getIFrameSrc)();
|
|
1666
|
+
expect(iframeSrc).toContain('isLazyLoadingForEmbedEnabled=true');
|
|
1667
|
+
expect(iframeSrc).not.toContain('rootMarginForLazyLoad');
|
|
1668
|
+
expect(loggerErrorSpy).toHaveBeenCalledWith('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
|
|
1669
|
+
}, 100);
|
|
1670
|
+
});
|
|
1671
|
+
test('should track scrollable ancestors by default when only fullHeight is set', async () => {
|
|
1672
|
+
const scrollContainer = (0, test_utils_1.getRootEl)();
|
|
1673
|
+
scrollContainer.style.overflow = 'auto';
|
|
1674
|
+
const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
|
|
1675
|
+
const resizeObserveSpy = jest.fn();
|
|
1676
|
+
const resizeDisconnectSpy = jest.fn();
|
|
1677
|
+
window.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
1678
|
+
observe: resizeObserveSpy,
|
|
1679
|
+
disconnect: resizeDisconnectSpy,
|
|
1680
|
+
}));
|
|
1681
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1682
|
+
...defaultViewConfig,
|
|
1683
|
+
fullHeight: true,
|
|
1684
|
+
});
|
|
1685
|
+
await appEmbed.render();
|
|
1686
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1687
|
+
expect(scrollContainerSpy).toHaveBeenCalledWith('scroll', expect.any(Function));
|
|
1688
|
+
expect(resizeObserveSpy).toHaveBeenCalledWith(scrollContainer);
|
|
1689
|
+
}, 100);
|
|
1690
|
+
appEmbed.destroy();
|
|
1691
|
+
expect(resizeDisconnectSpy).toHaveBeenCalled();
|
|
1692
|
+
scrollContainer.style.overflow = '';
|
|
1693
|
+
window.ResizeObserver = originalResizeObserver;
|
|
1694
|
+
});
|
|
1695
|
+
test('should skip ancestor tracking when enableScrollableContainerLazyLoading is false', async () => {
|
|
1696
|
+
const scrollContainer = (0, test_utils_1.getRootEl)();
|
|
1697
|
+
scrollContainer.style.overflow = 'auto';
|
|
1698
|
+
const scrollContainerSpy = jest.spyOn(scrollContainer, 'addEventListener');
|
|
1699
|
+
const windowSpy = jest.spyOn(window, 'addEventListener');
|
|
1700
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1701
|
+
...defaultViewConfig,
|
|
1702
|
+
fullHeight: true,
|
|
1703
|
+
enableScrollableContainerLazyLoading: false,
|
|
1704
|
+
});
|
|
1705
|
+
await appEmbed.render();
|
|
1706
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1707
|
+
expect(windowSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
|
|
1708
|
+
expect(scrollContainerSpy).not.toHaveBeenCalledWith('scroll', expect.any(Function));
|
|
1709
|
+
}, 100);
|
|
1710
|
+
appEmbed.destroy();
|
|
1711
|
+
scrollContainer.style.overflow = '';
|
|
1712
|
+
});
|
|
1713
|
+
test('should wire the window scroll listener to the coordinates sender by default', async () => {
|
|
1714
|
+
const addEventListenerSpy = jest.spyOn(window, 'addEventListener');
|
|
1715
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1716
|
+
...defaultViewConfig,
|
|
1717
|
+
fullHeight: true,
|
|
1718
|
+
});
|
|
1719
|
+
const mockTrigger = jest
|
|
1720
|
+
.spyOn(appEmbed, 'trigger')
|
|
1721
|
+
.mockImplementation(() => Promise.resolve(undefined));
|
|
1722
|
+
await appEmbed.render();
|
|
1723
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
1724
|
+
const scrollCall = addEventListenerSpy.mock.calls.find(([eventName, , capture]) => eventName === 'scroll' && capture === true);
|
|
1725
|
+
expect(scrollCall).toBeDefined();
|
|
1726
|
+
// Call the handler the way a real scroll event would.
|
|
1727
|
+
scrollCall[1]();
|
|
1728
|
+
expect(mockTrigger).toHaveBeenCalledWith(types_1.HostEvent.VisibleEmbedCoordinates, expect.objectContaining({ top: expect.any(Number) }));
|
|
1729
|
+
}, 100);
|
|
1730
|
+
appEmbed.destroy();
|
|
1731
|
+
addEventListenerSpy.mockRestore();
|
|
1732
|
+
});
|
|
1733
|
+
test('should remove listeners on destroy when the flags come from defaults', async () => {
|
|
1734
|
+
const removeEventListenerSpy = jest.spyOn(window, 'removeEventListener');
|
|
1735
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1736
|
+
...defaultViewConfig,
|
|
1737
|
+
fullHeight: true,
|
|
1738
|
+
});
|
|
1739
|
+
await appEmbed.render();
|
|
1740
|
+
appEmbed.destroy();
|
|
1741
|
+
expect(removeEventListenerSpy).toHaveBeenCalledWith('resize', expect.anything());
|
|
1742
|
+
expect(removeEventListenerSpy).toHaveBeenCalledWith('scroll', expect.anything(), true);
|
|
1743
|
+
removeEventListenerSpy.mockRestore();
|
|
1744
|
+
});
|
|
1745
|
+
test('should keep an explicit false for the lazy loading flags', async () => {
|
|
1746
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1747
|
+
...defaultViewConfig,
|
|
1748
|
+
fullHeight: true,
|
|
1749
|
+
lazyLoadingForFullHeight: false,
|
|
1750
|
+
enableScrollableContainerLazyLoading: false,
|
|
1751
|
+
lazyLoadingMargin: '0px',
|
|
1752
|
+
});
|
|
1753
|
+
expect(appEmbed.viewConfig.lazyLoadingForFullHeight).toBe(false);
|
|
1754
|
+
expect(appEmbed.viewConfig.enableScrollableContainerLazyLoading).toBe(false);
|
|
1755
|
+
expect(appEmbed.viewConfig.lazyLoadingMargin).toBe('0px');
|
|
1756
|
+
});
|
|
1311
1757
|
test('should not set lazyLoadingForEmbed when lazyLoadingForFullHeight is enabled but fullHeight is false', async () => {
|
|
1312
1758
|
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
1313
1759
|
...defaultViewConfig,
|
|
@@ -1746,4 +2192,80 @@ describe('AppEmbed visualOverrides tests', () => {
|
|
|
1746
2192
|
await (0, test_utils_1.testVisualOverridesInEmbed)(appEmbed, visualOverrides);
|
|
1747
2193
|
});
|
|
1748
2194
|
});
|
|
2195
|
+
describe('AppEmbed getEmbedParamsObject', () => {
|
|
2196
|
+
beforeEach(() => {
|
|
2197
|
+
cleanUp();
|
|
2198
|
+
jest.spyOn(ts_embed_1.TsEmbed.prototype, 'getAppInitData').mockResolvedValue({});
|
|
2199
|
+
});
|
|
2200
|
+
afterEach(() => {
|
|
2201
|
+
jest.restoreAllMocks();
|
|
2202
|
+
});
|
|
2203
|
+
test('getEmbedParams should use getEmbedParamsObject internally', async () => {
|
|
2204
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
2205
|
+
...defaultViewConfig,
|
|
2206
|
+
fullHeight: true,
|
|
2207
|
+
});
|
|
2208
|
+
const getEmbedParamsObjectSpy = jest.spyOn(appEmbed, 'getEmbedParamsObject');
|
|
2209
|
+
await appEmbed.render();
|
|
2210
|
+
expect(getEmbedParamsObjectSpy).toHaveBeenCalled();
|
|
2211
|
+
});
|
|
2212
|
+
test('getEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', () => {
|
|
2213
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
2214
|
+
...defaultViewConfig,
|
|
2215
|
+
fullHeight: true,
|
|
2216
|
+
});
|
|
2217
|
+
const params = appEmbed.getEmbedParamsObject();
|
|
2218
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
2219
|
+
expect(params.fullHeight).toBeUndefined();
|
|
2220
|
+
});
|
|
2221
|
+
test('getEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', () => {
|
|
2222
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
2223
|
+
...defaultViewConfig,
|
|
2224
|
+
fullHeight: false,
|
|
2225
|
+
});
|
|
2226
|
+
const params = appEmbed.getEmbedParamsObject();
|
|
2227
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
2228
|
+
});
|
|
2229
|
+
test('getUpdateEmbedParamsObject should contain isFullHeightPinboard when fullHeight is true', async () => {
|
|
2230
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
2231
|
+
...defaultViewConfig,
|
|
2232
|
+
fullHeight: true,
|
|
2233
|
+
});
|
|
2234
|
+
const params = await appEmbed.getUpdateEmbedParamsObject();
|
|
2235
|
+
expect(params.isFullHeightPinboard).toBe(true);
|
|
2236
|
+
});
|
|
2237
|
+
test('getUpdateEmbedParamsObject should not contain isFullHeightPinboard when fullHeight is false', async () => {
|
|
2238
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
2239
|
+
...defaultViewConfig,
|
|
2240
|
+
fullHeight: false,
|
|
2241
|
+
});
|
|
2242
|
+
const params = await appEmbed.getUpdateEmbedParamsObject();
|
|
2243
|
+
expect(params.isFullHeightPinboard).toBeUndefined();
|
|
2244
|
+
});
|
|
2245
|
+
});
|
|
2246
|
+
describe('AppEmbed updatedSpotterExperience tests', () => {
|
|
2247
|
+
beforeEach(() => {
|
|
2248
|
+
cleanUp();
|
|
2249
|
+
});
|
|
2250
|
+
test('should set updatedSpotterExperience to true in url', async () => {
|
|
2251
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
2252
|
+
...defaultViewConfig,
|
|
2253
|
+
updatedSpotterExperience: true,
|
|
2254
|
+
});
|
|
2255
|
+
appEmbed.render();
|
|
2256
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
2257
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=true&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
2258
|
+
});
|
|
2259
|
+
});
|
|
2260
|
+
test('should set updatedSpotterExperience to false in url', async () => {
|
|
2261
|
+
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
|
|
2262
|
+
...defaultViewConfig,
|
|
2263
|
+
updatedSpotterExperience: false,
|
|
2264
|
+
});
|
|
2265
|
+
appEmbed.render();
|
|
2266
|
+
await (0, test_utils_1.executeAfterWait)(() => {
|
|
2267
|
+
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterExperience=false&navigationVersion=v3&homepageVersion=v3${defaultParamsPost}#/home`);
|
|
2268
|
+
});
|
|
2269
|
+
});
|
|
2270
|
+
});
|
|
1749
2271
|
//# sourceMappingURL=app.spec.js.map
|