import { CookieService } from 'ngx-cookie'; import { ApiParamInfoService } from '@shared/services/data/api-param-info.service'; import { CookiesService } from '../../services/cookies/cookies.service'; import { LanguageService } from '@shared/services/router-language/route-language.service'; export const ui = null; export const accessibility = null; describe('Cart', () => { describe('ApiParamInfoService', () => { let userCookieServiceMock: jasmine.SpyObj; let userLanguageServiceMock: jasmine.SpyObj; let apiParamInfoService: ApiParamInfoService; let cookiesService: CookiesService; beforeEach(() => { userCookieServiceMock = jasmine.createSpyObj('CookieService', ['get']); userLanguageServiceMock = jasmine.createSpyObj('LanguageService', ['get', 'getLanguage']); cookiesService = new CookiesService(userCookieServiceMock, 'docker'); apiParamInfoService = new ApiParamInfoService(cookiesService, userLanguageServiceMock); }); it('should have method `getApiParamInfo` been called', () => { apiParamInfoService.getApiParamInfo(); expect(apiParamInfoService.getApiParamInfo).toBeDefined(); }); it('should have method `getApiParamInfo` been called with return values', () => { const data = { cartId: null, catalogVersion: 'Online', customerId: 'anonymous', full: 'FULL', full_spa: 'FULL_SPA', lang: undefined, localizedPOS: '9999', relationship: 'certona', scheme: 'home1_rr', trackingId: 'test' }; const apiInfo = apiParamInfoService.getApiParamInfo(); expect(apiInfo).toEqual(data); expect(apiParamInfoService.getApiParamInfo).toBeDefined(); }); }); });