Skip to content

Commit

Permalink
FEC-14189: lint fix in test files
Browse files Browse the repository at this point in the history
  • Loading branch information
MosheMaorKaltura committed Oct 27, 2024
1 parent 612c100 commit 0af124d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tests/e2e/common/utils/kaltura-params.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,24 +391,32 @@ describe('testReferrerLogic', () => {
});

it('referrer on parent', () => {
sandbox.stub(window, 'parent').get(() => {return { document : {URL : 'parentRef'}}});
sandbox.stub(window, 'parent').get(() => {
return { document: { URL: 'parentRef' } };
});
getReferrer().should.equal('parentRef');
});

it('no referrer on parent and backend supplied referrer', () => {
sandbox.stub(window, 'parent').get(() => {return { document : {URL : undefined}}});
sandbox.stub(window, 'originalRequestReferrer').get(() => "backendRef");
sandbox.stub(window, 'parent').get(() => {
return { document: { URL: undefined } };
});
sandbox.stub(window, 'originalRequestReferrer').get(() => 'backendRef');
getReferrer().should.equal('backendRef');
});

it('if parent referrer contains kaltura.com and backend supplied referrer', () => {
sandbox.stub(window, 'parent').get(() => {return { document : {URL : 'bla.kaltura.com'}}});
sandbox.stub(window, 'originalRequestReferrer').get(() => "test-kaltura.com");
sandbox.stub(window, 'parent').get(() => {
return { document: { URL: 'bla.kaltura.com' } };
});
sandbox.stub(window, 'originalRequestReferrer').get(() => 'test-kaltura.com');
getReferrer().should.equal('test-kaltura.com');
});

it('if parent referrer contains kaltura.com and backend does not supplied referrer', () => {
sandbox.stub(window, 'parent').get(() => {return { document : {URL : 'bla.kaltura.com'}}});
sandbox.stub(window, 'parent').get(() => {
return { document: { URL: 'bla.kaltura.com' } };
});
sandbox.stub(document, 'referrer').get(() => 'localRef');
sandbox.stub(window, 'originalRequestReferrer').get(() => undefined);
getReferrer().should.equal('localRef');
Expand Down

0 comments on commit 0af124d

Please sign in to comment.