From 16523c3c9043b47f1a7e8bd461a801dea3508e14 Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Fri, 16 Sep 2022 10:27:40 +0200 Subject: [PATCH] [#1816][CST-6565] Clearified expectation of test --- src/app/shared/cookies/browser-klaro.service.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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}));