diff --git a/src/app/shared/cookies/browser-klaro.service.spec.ts b/src/app/shared/cookies/browser-klaro.service.spec.ts index f0736a2560..5806148d94 100644 --- a/src/app/shared/cookies/browser-klaro.service.spec.ts +++ b/src/app/shared/cookies/browser-klaro.service.spec.ts @@ -269,10 +269,14 @@ describe('BrowserKlaroService', () => { spyOn((service as any), 'initializeUser'); spyOn(service, 'translateConfiguration'); }); - it('should not filter any configuration', () => { + it('should not filter googleAnalytics when servicesToHide are empty', () => { const filteredConfig = (service as any).filterConfigServices([]); expect(filteredConfig).toContain(jasmine.objectContaining({name: googleAnalytics})); }); + it('should filter services using names passed as servicesToHide', () => { + const filteredConfig = (service as any).filterConfigServices([googleAnalytics]); + expect(filteredConfig).not.toContain(jasmine.objectContaining({name: googleAnalytics})); + }); it('should have been initialized with googleAnalytics', () => { service.initialize(); expect(service.klaroConfig.services).toContain(jasmine.objectContaining({name: googleAnalytics}));