Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/embed/ts-embed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,29 @@ describe('Unit test case for ts embed', () => {
jest.spyOn(authInstance, 'postLoginService').mockResolvedValue(true);
});

describe('Vaidate iframe properties', () => {
beforeAll(() => {
init({
thoughtSpotHost: 'tshost',
authType: AuthType.None,
});
});

test('should set proper allow policies', 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();
const policiesAdded = iframe.allow.split(' ');
policiesAdded.forEach((policy) => {
expect(policy.endsWith(';')).toBe(true);
});
});
});
});

describe('AuthExpire embedEvent in cookieless authentication authType', () => {
beforeAll(() => {
jest.spyOn(authInstance, 'doCookielessTokenAuth').mockResolvedValueOnce(true);
Expand Down
2 changes: 1 addition & 1 deletion src/embed/ts-embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ export class TsEmbed {
iFrame.mozallowfullscreen = true;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
iFrame.allow = 'clipboard-read; clipboard-write fullscreen';
iFrame.allow = 'clipboard-read; clipboard-write; fullscreen;';

const {
height: frameHeight,
Expand Down
Loading