[#1816][CST-6565] Clearified expectation of test

This commit is contained in:
Vincenzo Mecca
2022-09-16 10:27:40 +02:00
parent 3cc4b96ff4
commit 16523c3c90

View File

@@ -269,10 +269,14 @@ describe('BrowserKlaroService', () => {
spyOn((service as any), 'initializeUser'); spyOn((service as any), 'initializeUser');
spyOn(service, 'translateConfiguration'); spyOn(service, 'translateConfiguration');
}); });
it('should not filter any configuration', () => { it('should not filter googleAnalytics when servicesToHide are empty', () => {
const filteredConfig = (service as any).filterConfigServices([]); const filteredConfig = (service as any).filterConfigServices([]);
expect(filteredConfig).toContain(jasmine.objectContaining({name: googleAnalytics})); 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', () => { it('should have been initialized with googleAnalytics', () => {
service.initialize(); service.initialize();
expect(service.klaroConfig.services).toContain(jasmine.objectContaining({name: googleAnalytics})); expect(service.klaroConfig.services).toContain(jasmine.objectContaining({name: googleAnalytics}));