diff --git a/src/embed/ts-embed.spec.ts b/src/embed/ts-embed.spec.ts index bbb1b6dd..41deed13 100644 --- a/src/embed/ts-embed.spec.ts +++ b/src/embed/ts-embed.spec.ts @@ -126,6 +126,19 @@ describe('Unit test case for ts embed', () => { }); }); }); + + test('should set proper height, width and min-height to iframe', async () => { + // we dont have origin specific policies so just checking if + // policies are ending with ; + const searchEmbed = new SearchEmbed(getRootEl(), defaultViewConfig); + searchEmbed.render(); + await executeAfterWait(() => { + const iframe = getIFrameEl(); + expect(iframe.style.width).toBe(`${defaultViewConfig.frameParams.width}px`); + expect(iframe.style.height).toBe(`${defaultViewConfig.frameParams.height}px`); + expect(iframe.style.minHeight).toBe(`${defaultViewConfig.frameParams.height}px`); + }); + }); }); describe('AuthExpire embedEvent in cookieless authentication authType', () => { diff --git a/src/embed/ts-embed.ts b/src/embed/ts-embed.ts index 31ccb6d3..f7398de1 100644 --- a/src/embed/ts-embed.ts +++ b/src/embed/ts-embed.ts @@ -594,6 +594,9 @@ export class TsEmbed { iFrame.style.width = `${width}`; iFrame.style.height = `${height}`; + // Set minimum height to the frame so that, + // scaling down on the fullheight doesn't make it too small. + iFrame.style.minHeight = `${height}`; iFrame.style.border = '0'; iFrame.name = 'ThoughtSpot Embedded Analytics'; return iFrame;