From f9b96dc6d57729c765afacb80985c1bf4b6b13d6 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Wed, 3 Apr 2019 18:41:26 +0200 Subject: [PATCH] fixed test --- .../search-facet-option.component.spec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts b/src/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts index 279ce0f97a..f44dc0f69f 100644 --- a/src/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts +++ b/src/app/+search-page/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts @@ -19,9 +19,10 @@ import { By } from '@angular/platform-browser'; describe('SearchFacetOptionComponent', () => { let comp: SearchFacetOptionComponent; let fixture: ComponentFixture; - const filterName1 = 'test name'; + const filterName1 = 'testname'; const value1 = 'testvalue1'; const value2 = 'test2'; + const operator = 'equals'; const value3 = 'another value3'; const mockFilterConfig = Object.assign(new SearchFilterConfig(), { name: filterName1, @@ -36,7 +37,7 @@ describe('SearchFacetOptionComponent', () => { label: value2, value: value2, count: 20, - search: '' + search: `http://test.org/api/discover/search/objects?f.${filterName1}=${value2},${operator}` }; const searchLink = '/search'; @@ -91,12 +92,12 @@ describe('SearchFacetOptionComponent', () => { fixture.detectChanges(); }); - describe('when the updateAddParams method is called wih a value', () => { + describe('when the updateAddParams method is called with a value', () => { it('should update the addQueryParams with the new parameter values', () => { comp.addQueryParams = {}; (comp as any).updateAddParams(selectedValues); expect(comp.addQueryParams).toEqual({ - [mockFilterConfig.paramName]: [value1, value.value], + [mockFilterConfig.paramName]: [value1, `${value2},${operator}`], page: 1 }); });