Skip to content

Commit 88dfc82

Browse files
author
Andrea Barbasso
committed
[DEV-1727] disable klaro if Cypress is running
1 parent 34fe873 commit 88dfc82

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/app/shared/cookies/browser-klaro.service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { deepClone, Operation } from 'fast-json-patch';
1616
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
1717
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
1818
import { CAPTCHA_NAME } from '../../core/google-recaptcha/google-recaptcha.service';
19+
import { NativeWindowRef, NativeWindowService, } from '../../core/services/window.service';
1920
import isEqual from 'lodash/isEqual';
2021

2122
/**
@@ -96,6 +97,7 @@ export class BrowserKlaroService extends KlaroService {
9697
private configService: ConfigurationDataService,
9798
private cookieService: CookieService,
9899
@Inject(LAZY_KLARO) private lazyKlaro: Promise<any>,
100+
@Inject(NativeWindowService) private _window: NativeWindowRef,
99101
) {
100102
super();
101103
}
@@ -189,7 +191,11 @@ export class BrowserKlaroService extends KlaroService {
189191
*/
190192
this.translateConfiguration();
191193

192-
this.klaroConfig.services = this.filterConfigServices(servicesToHide);
194+
if (this._window?.nativeWindow?.Cypress) {
195+
this.klaroConfig.services = [];
196+
} else {
197+
this.klaroConfig.services = this.filterConfigServices(servicesToHide);
198+
}
193199
this.lazyKlaro.then(({ setup }) => {
194200
setup(this.klaroConfig);
195201
this.initialized = true;

0 commit comments

Comments
 (0)