Skip to content

Commit

Permalink
SCAL-230365 - Added a min height to the iframe (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhanu-thoughtspot authored Jan 2, 2025
1 parent 2ba7f7c commit 319f5a7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/embed/ts-embed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
3 changes: 3 additions & 0 deletions src/embed/ts-embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 319f5a7

Please sign in to comment.