Skip to content

Commit

Permalink
#191: review #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Awerkow-Schäfer, Dmitri committed Aug 17, 2018
1 parent d60303b commit 9c61991
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 0 additions & 9 deletions test/specs/core/core_oil.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as CoreTagManagement from '../../../src/scripts/core/core_tag_managemen
import { waitsForAndRuns } from '../../test-utils/utils_wait';
import { resetOil } from '../../test-utils/utils_reset';
import { triggerEvent } from '../../test-utils/utils_events';
import { EVENT_NAME_OIL_SHOWN } from '../../../src/scripts/core/core_constants';

describe('core_oil', () => {

Expand Down Expand Up @@ -110,12 +109,4 @@ describe('core_oil', () => {
},
2000);
});

fit('should not execute oil_shown event if gdpr_applies_globally is false', (done) => {
spyOn(CoreUtils, 'sendEventToHostSite').and.callThrough();
initOilLayer({"gdpr_applies_globally": false});

expect(CoreUtils.sendEventToHostSite).not.toHaveBeenCalledWith(EVENT_NAME_OIL_SHOWN);
done();
});
});
12 changes: 12 additions & 0 deletions test/specs/userview/userview_modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { resetOil } from '../../test-utils/utils_reset';
import * as AdvancedSettingsStandard from '../../../src/scripts/userview/view/oil.advanced.settings.standard';
import * as AdvancedSettingsTabs from '../../../src/scripts/userview/view/oil.advanced.settings.tabs';
import * as CoreLog from '../../../src/scripts/core/core_log';
import * as CoreConfig from '../../../src/scripts/core/core_config';
import * as CoreUtils from '../../../src/scripts/core/core_utils';
import {EVENT_NAME_OIL_SHOWN} from '../../../src/scripts/core/core_constants';

describe('the user view modal aka the oil layer wrapper', () => {

Expand Down Expand Up @@ -116,6 +119,15 @@ describe('the user view modal aka the oil layer wrapper', () => {
expect(CoreLog.logError).toHaveBeenCalled();
expect(CoreLog.logError.calls.mostRecent().args[0]).toMatch(/^Found unknown CPC type 'invalidCpcType'/)
});

it('should not execute oil_shown event if gdpr_applies is FALSE', (done) => {
spyOn(CoreConfig, 'gdprApplies').and.returnValue(false);
spyOn(CoreUtils, 'sendEventToHostSite').and.callThrough();

renderOil({optIn: false, advancedSettings: true});
expect(CoreUtils.sendEventToHostSite).not.toHaveBeenCalledWith(EVENT_NAME_OIL_SHOWN);
done();
});
});

function expectTimeoutNotStarted() {
Expand Down

0 comments on commit 9c61991

Please sign in to comment.