@thoughtspot/visual-embed-sdk
Version:
ThoughtSpot Embed SDK
904 lines • 94.3 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const app_1 = require("./app");
const index_1 = require("../index");
const types_1 = require("../types");
const test_utils_1 = require("../test/test-utils");
const config = tslib_1.__importStar(require("../config"));
const ts_embed_1 = require("./ts-embed");
const logger_1 = require("../utils/logger");
const auth = tslib_1.__importStar(require("../auth"));
const defaultViewConfig = {
frameParams: {
width: 1280,
height: 720,
},
};
const thoughtSpotHost = 'tshost';
const defaultParamsPost = '';
// Helper function to create and render AppEmbed with config
const createAndRenderAppEmbed = async (viewConfig) => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), viewConfig);
appEmbed.render();
return appEmbed;
};
// Helper function to test URL parameters
const testUrlParams = async (viewConfig, expectedUrl) => {
await createAndRenderAppEmbed(viewConfig);
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), expectedUrl);
});
};
// Helper function to test setIframeHeightForNonEmbedLiveboard behavior
const testSetIframeHeightBehavior = (currentPath, shouldBeCalled) => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
fullHeight: true,
});
const spySetIFrameHeight = shouldBeCalled
? jest.spyOn(appEmbed, 'setIFrameHeight').mockImplementation(jest.fn())
: jest.spyOn(appEmbed, 'setIFrameHeight');
appEmbed.render();
appEmbed.setIframeHeightForNonEmbedLiveboard({
data: { currentPath },
type: 'Route',
});
if (shouldBeCalled) {
expect(spySetIFrameHeight).toHaveBeenCalled();
}
else {
expect(spySetIFrameHeight).not.toHaveBeenCalled();
}
};
// Helper function to create mock iframe with default getBoundingClientRect
const createMockIFrame = (rect = {
top: 100,
left: 150,
bottom: 600,
right: 800,
width: 650,
height: 500,
}) => {
const mockIFrame = document.createElement('iframe');
mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue(rect);
return mockIFrame;
};
// Helper function to setup iframe creation spy
const setupIFrameCreationSpy = (mockIFrame) => {
jest.spyOn(document, 'createElement').mockImplementation((tagName) => {
if (tagName === 'iframe') {
return mockIFrame;
}
return document.createElement(tagName);
});
};
const originalResizeObserver = window.ResizeObserver;
beforeAll(() => {
(0, index_1.init)({
thoughtSpotHost,
authType: types_1.AuthType.None,
});
jest.spyOn(auth, 'postLoginService').mockImplementation(() => Promise.resolve(undefined));
window.ResizeObserver =
window.ResizeObserver ||
jest.fn().mockImplementation(() => ({
disconnect: jest.fn(),
observe: jest.fn(),
unobserve: jest.fn(),
}));
});
const cleanUp = () => {
document.body.innerHTML = (0, test_utils_1.getDocumentBody)();
window.ResizeObserver = originalResizeObserver;
};
describe('App embed tests', () => {
beforeEach(() => {
cleanUp();
});
test('should render home page by default', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), defaultViewConfig);
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('should hide the primary nav bar', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('should hide the help and profile buttons from nav bar', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
disableProfileAndHelp: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('should hide the application switcher button from nav bar', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
hideApplicationSwitcher: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&applicationSwitcherHidden=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('should hide the org switcher button from nav bar', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
hideOrgSwitcher: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&orgSwitcherHidden=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
describe('should render the correct routes for pages', () => {
const pageRouteMap = {
[app_1.Page.Search]: 'answer',
[app_1.Page.Answers]: 'answers',
[app_1.Page.Pinboards]: 'pinboards',
[app_1.Page.Liveboards]: 'pinboards',
[app_1.Page.Data]: 'data/tables',
[app_1.Page.Home]: 'home',
[app_1.Page.SpotIQ]: 'insights/results',
[app_1.Page.Monitor]: 'insights/monitor-alerts',
};
const pageIds = Object.keys(pageRouteMap);
for (let i = 0; i < pageIds.length; i++) {
const pageId = pageIds[i];
test(`${pageId}`, async () => {
const route = pageRouteMap[pageId];
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
pageId: pageId,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
cleanUp();
});
});
}
const pageRouteMapForModularHome = {
[app_1.Page.Search]: 'answer',
[app_1.Page.Answers]: 'home/answers',
[app_1.Page.Pinboards]: 'home/liveboards',
[app_1.Page.Liveboards]: 'home/liveboards',
[app_1.Page.Data]: 'data/tables',
[app_1.Page.Home]: 'home',
[app_1.Page.SpotIQ]: 'home/spotiq-analysis',
[app_1.Page.Monitor]: 'home/monitor-alerts',
};
const pageIdsForModularHomes = Object.keys(pageRouteMapForModularHome);
for (let i = 0; i < pageIdsForModularHomes.length; i++) {
const pageIdsForModularHome = pageIdsForModularHomes[i];
test(`${pageIdsForModularHome}`, async () => {
const route = pageRouteMapForModularHome[pageIdsForModularHome];
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
modularHomeExperience: true,
pageId: pageIdsForModularHome,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/${route}`);
cleanUp();
});
});
}
});
test('should navigate to a path', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
path: 'foo/bar',
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('should apply runtime filters', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: true,
runtimeFilters: [
{
columnName: 'sales',
operator: types_1.RuntimeFilterOp.EQ,
values: [1000],
},
],
excludeRuntimeFiltersfromURL: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('should not append runtime filters in URL if excludeRuntimeFiltersfromURL is true', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: true,
runtimeFilters: [
{
columnName: 'sales',
operator: types_1.RuntimeFilterOp.EQ,
values: [1000],
},
],
excludeRuntimeFiltersfromURL: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('should append runtime filters in URL if excludeRuntimeFiltersfromURL is undefined', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: true,
runtimeFilters: [
{
columnName: 'sales',
operator: types_1.RuntimeFilterOp.EQ,
values: [1000],
},
],
excludeRuntimeFiltersfromURL: undefined,
});
appEmbed.render();
const runtimeFilter = 'col1=sales&op1=EQ&val1=1000';
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('should disable and hide actions', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: true,
disabledActions: [types_1.Action.Save, types_1.Action.Update],
disabledActionReason: 'Access denied',
hiddenActions: [types_1.Action.Download],
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('should set enable2ColumnLayout to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
enable2ColumnLayout: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`);
});
});
test('should set coverAndFilterOptionInPDF to false in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
coverAndFilterOptionInPDF: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&arePdfCoverFilterPageCheckboxesEnabled=false${defaultParamsPost}#/home`);
});
});
test('should set isLiveboardStylingAndGroupingEnabled to true in url (deprecated, use isLiveboardMasterpiecesEnabled)', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isLiveboardStylingAndGroupingEnabled: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardStylingAndGroupingEnabled=true${defaultParamsPost}#/home`);
});
});
test('should set isThisPeriodInDateFiltersEnabled to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isThisPeriodInDateFiltersEnabled: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isThisPeriodInDateFiltersEnabled=true${defaultParamsPost}#/home`);
});
});
test('should set enableHomepageAnnouncement to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
enableHomepageAnnouncement: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=true${defaultParamsPost}#/home`);
});
});
test('should set enableHomepageAnnouncement to false in url when not provided in AppViewConfig', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), defaultViewConfig);
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false${defaultParamsPost}#/home`);
});
});
test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isPNGInScheduledEmailsEnabled: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`);
});
});
test('should set isWYSIWYGLiveboardPDFEnabled to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isContinuousLiveboardPDFEnabled: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true${defaultParamsPost}#/home`);
});
});
test('should disable isWYSIWYGLiveboardPDFEnabled by default in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=false${defaultParamsPost}#/home`);
});
});
test('should set isLinkParametersEnabled to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isLinkParametersEnabled: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true${defaultParamsPost}#/home`);
});
});
test('should set isLinkParametersEnabled to false in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isLinkParametersEnabled: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false${defaultParamsPost}#/home`);
});
});
test('Should add homepageVersion=v4 and updatedSpotterChatPrompt=true when homePage is Focused to the iframe src', async () => {
await testUrlParams({
...defaultViewConfig,
discoveryExperience: {
homePage: app_1.HomePage.Focused,
},
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
test('Should respect explicit updatedSpotterChatPrompt=false even when homePage is Focused', async () => {
await testUrlParams({
...defaultViewConfig,
discoveryExperience: {
homePage: app_1.HomePage.Focused,
},
updatedSpotterChatPrompt: false,
}, `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
test('should set isLiveboardXLSXCSVDownloadEnabled to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isLiveboardXLSXCSVDownloadEnabled: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`);
});
});
test('should set updatedSpotterChatPrompt to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
updatedSpotterChatPrompt: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true${defaultParamsPost}#/home`);
});
});
test('should set updatedSpotterChatPrompt to false in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
updatedSpotterChatPrompt: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false${defaultParamsPost}#/home`);
});
});
test('should set hideToolResponseCardBranding to true in url via spotterChatConfig', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
spotterChatConfig: {
hideToolResponseCardBranding: true,
},
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&hideToolResponseCardBranding=true${defaultParamsPost}#/home`);
});
});
test('should include spotterVizConfig in APP_INIT embedParams when spotterViz is provided', async () => {
const spotterViz = {
brandName: 'MyBrand',
brandHeadline: "Hi, there! I'm",
description: 'Ask questions about your data',
inputChatPlaceholder: 'Ask a question...',
hideStarterPrompts: false,
customStarterPrompts: [
{
id: '001',
displayText: 'Show revenue by region',
fullPrompt: 'Show revenue by region',
},
{ id: '002', displayText: 'Top customers', fullPrompt: 'Top customers by sales' },
],
};
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
spotterViz,
});
(0, test_utils_1.mockMessageChannel)();
appEmbed.render();
const mockPort = { postMessage: jest.fn() };
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
});
await (0, test_utils_1.executeAfterWait)(() => {
expect(mockPort.postMessage).toHaveBeenCalledWith({
type: types_1.EmbedEvent.APP_INIT,
data: expect.objectContaining({
embedParams: expect.objectContaining({
spotterVizConfig: spotterViz,
}),
}),
});
});
});
test('should pass brandHeadline through spotterVizConfig in APP_INIT', async () => {
const spotterViz = { brandName: 'MyBrand', brandHeadline: "Hi, there! I'm" };
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
spotterViz,
});
(0, test_utils_1.mockMessageChannel)();
appEmbed.render();
const mockPort = { postMessage: jest.fn() };
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
});
await (0, test_utils_1.executeAfterWait)(() => {
expect(mockPort.postMessage).toHaveBeenCalledWith({
type: types_1.EmbedEvent.APP_INIT,
data: expect.objectContaining({
embedParams: expect.objectContaining({
spotterVizConfig: expect.objectContaining({
brandHeadline: "Hi, there! I'm",
}),
}),
}),
});
});
});
test('should not include spotterVizConfig in APP_INIT when spotterViz is not provided', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
});
(0, test_utils_1.mockMessageChannel)();
appEmbed.render();
const mockPort = { postMessage: jest.fn() };
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
});
await (0, test_utils_1.executeAfterWait)(() => {
const callArgs = mockPort.postMessage.mock.calls[0][0];
expect(callArgs.type).toBe(types_1.EmbedEvent.APP_INIT);
if (callArgs.data.embedParams) {
expect(callArgs.data.embedParams.spotterVizConfig).toBeUndefined();
}
});
});
test('should include spotterVizConfig alongside spotterSidebarConfig in APP_INIT', async () => {
const spotterViz = { brandName: 'MyBrand' };
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
spotterViz,
spotterSidebarConfig: { enablePastConversationsSidebar: true },
});
(0, test_utils_1.mockMessageChannel)();
appEmbed.render();
const mockPort = { postMessage: jest.fn() };
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.postMessageToParent)((0, test_utils_1.getIFrameEl)().contentWindow, { type: types_1.EmbedEvent.APP_INIT, data: {} }, mockPort);
});
await (0, test_utils_1.executeAfterWait)(() => {
expect(mockPort.postMessage).toHaveBeenCalledWith({
type: types_1.EmbedEvent.APP_INIT,
data: expect.objectContaining({
embedParams: expect.objectContaining({
spotterVizConfig: spotterViz,
spotterSidebarConfig: expect.objectContaining({
enablePastConversationsSidebar: true,
}),
}),
}),
});
});
});
test('should set toolResponseCardBrandingLabel in url via spotterChatConfig', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
spotterChatConfig: {
toolResponseCardBrandingLabel: 'MyBrand',
},
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&toolResponseCardBrandingLabel=MyBrand${defaultParamsPost}#/home`);
});
});
test('should set spotterFileUploadEnabled to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
spotterChatConfig: { spotterFileUploadEnabled: true },
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&spotterFileUploadEnabled=true${defaultParamsPost}#/home`);
});
});
test('should set enableStarterPrompts to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
spotterChatConfig: { enableStarterPrompts: true },
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableStarterPrompts=true${defaultParamsPost}#/home`);
});
});
test('should set spotterFileUploadFileTypes in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
spotterChatConfig: { spotterFileUploadFileTypes: { types: ['image/png', 'application/pdf'] } },
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlToHaveParamsWithValues)((0, test_utils_1.getIFrameSrc)(), {
spotterFileUploadFileTypes: JSON.stringify({ types: ['image/png', 'application/pdf'] }),
});
});
});
test('should set isLiveboardXLSXCSVDownloadEnabled to false in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isLiveboardXLSXCSVDownloadEnabled: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=false${defaultParamsPost}#/home`);
});
});
test('should set isGranularXLSXCSVSchedulesEnabled to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isGranularXLSXCSVSchedulesEnabled: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=true${defaultParamsPost}#/home`);
});
});
test('should set isGranularXLSXCSVSchedulesEnabled to false in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isGranularXLSXCSVSchedulesEnabled: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isGranularXLSXCSVSchedulesEnabled=false${defaultParamsPost}#/home`);
});
});
test('should set isCentralizedLiveboardFilterUXEnabled to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isCentralizedLiveboardFilterUXEnabled: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true${defaultParamsPost}#/home`);
});
});
test('should set isCentralizedLiveboardFilterUXEnabled to false in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isCentralizedLiveboardFilterUXEnabled: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false${defaultParamsPost}#/home`);
});
});
test('Should add the tag to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
tag: 'Finance',
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add the hideTagFilterChips true to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
hideTagFilterChips: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add the hideTagFilterChips false to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
hideTagFilterChips: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should not add hideTagFilterChips if it is undefined', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('Should add showMaskedFilterChip true to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
showMaskedFilterChip: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add showMaskedFilterChip false to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
showMaskedFilterChip: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add default showMaskedFilterChip false when not specified', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add isLiveboardMasterpiecesEnabled true to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
isLiveboardMasterpiecesEnabled: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add isLiveboardMasterpiecesEnabled false to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
isLiveboardMasterpiecesEnabled: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add default isLiveboardMasterpiecesEnabled false when not specified', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add newChartsLibrary true to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
newChartsLibrary: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add newChartsLibrary false to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
newChartsLibrary: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should not add newChartsLibrary to the iframe src when not specified', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showPrimaryNavbar: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('Should add enableSearchAssist flagto the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
enableSearchAssist: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add enableDataPanelV2 flag to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
dataPanelV2: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add isLiveboardHeaderSticky flag to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isLiveboardHeaderSticky: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add isLiveboardCompactHeaderEnabled flag to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isLiveboardCompactHeaderEnabled: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add showLiveboardReverifyBanner flag to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
showLiveboardReverifyBanner: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add isUnifiedSearchExperienceEnabled flag to the iframe src', async () => {
// Case 1: explicitly true
const appEmbedTrue = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isUnifiedSearchExperienceEnabled: true,
});
appEmbedTrue.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
appEmbedTrue.destroy();
// Case 2: explicitly false
const appEmbedFalse = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
isUnifiedSearchExperienceEnabled: false,
});
appEmbedFalse.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
appEmbedFalse.destroy();
// Case 3: not provided — defaults to false
const appEmbedDefault = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
});
appEmbedDefault.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('should set newConnectionsExperience to true in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
newConnectionsExperience: true,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&newConnectionsExperience=true${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('should set newConnectionsExperience to false in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
newConnectionsExperience: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&newConnectionsExperience=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('should disable connection new experience by default in url', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(0, test_utils_1.expectUrlMatchesWithParams)((0, test_utils_1.getIFrameSrc)(), `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${test_utils_1.defaultParams}${defaultParamsPost}#/home`);
});
});
test('Should add hideIrrelevantFiltersAtTabLevel flag to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl)(), {
...defaultViewConfig,
hideIrrelevantChipsInLiveboardTabs: false,
});
appEmbed.render();
await (0, test_utils_1.executeAfterWait)(() => {
(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`);
});
});
test('Should add showLiveboardVerifiedBadge flag to the iframe src', async () => {
const appEmbed = new app_1.AppEmbed((0, test_utils_1.getRootEl