Skip to content

Commit

Permalink
[ACA-3426] - reverted method renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano authored and eromano committed Jun 22, 2020
1 parent 75b6c43 commit feb5204
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ export abstract class BaseQueryBuilderService {
ranges: { [id: string]: SearchRange } = {};

constructor(protected appConfig: AppConfigService, protected alfrescoApiService: AlfrescoApiService) {
this.setUpConfiguration();
this.resetToDefaults();
}

public abstract loadConfiguration(): SearchConfiguration;

public abstract isFilterServiceActive(): boolean;

public setUpConfiguration() {
public resetToDefaults() {
const currentConfig = this.loadConfiguration();
this.setUpSearchConfiguration(currentConfig);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ describe('SearchFilterComponent', () => {

it('should not show the disabled widget', async(() => {
appConfigService.config.search = { categories: disabledCategories };
queryBuilder.setUpConfiguration();
queryBuilder.resetToDefaults();

fixture.detectChanges();
fixture.whenStable().then(() => {
Expand All @@ -748,7 +748,7 @@ describe('SearchFilterComponent', () => {

it('should show the widget in expanded mode', async(() => {
appConfigService.config.search = { categories: expandedCategories };
queryBuilder.setUpConfiguration();
queryBuilder.resetToDefaults();

fixture.detectChanges();
fixture.whenStable().then(() => {
Expand All @@ -769,7 +769,7 @@ describe('SearchFilterComponent', () => {

it('should show the widgets only if configured', async(() => {
appConfigService.config.search = { categories: simpleCategories };
queryBuilder.setUpConfiguration();
queryBuilder.resetToDefaults();

fixture.detectChanges();
fixture.whenStable().then(() => {
Expand All @@ -784,7 +784,7 @@ describe('SearchFilterComponent', () => {
it('should be update the search query when name changed', async( async () => {
spyOn(queryBuilder, 'update').and.stub();
appConfigService.config.search = searchFilter;
queryBuilder.setUpConfiguration();
queryBuilder.resetToDefaults();

fixture.detectChanges();
await fixture.whenStable();
Expand All @@ -805,7 +805,7 @@ describe('SearchFilterComponent', () => {
it('should show the long facet options list with pagination', () => {
const panel = '[data-automation-id="expansion-panel-Size facet queries"]';
appConfigService.config.search = searchFilter;
queryBuilder.setUpConfiguration();
queryBuilder.resetToDefaults();

fixture.detectChanges();
queryBuilder.executed.next(<any> mockSearchResult);
Expand Down Expand Up @@ -871,7 +871,7 @@ describe('SearchFilterComponent', () => {
delete filter.facetQueries;

appConfigService.config.search = filter;
queryBuilder.setUpConfiguration();
queryBuilder.resetToDefaults();

fixture.detectChanges();
queryBuilder.executed.next(<any> mockSearchResult);
Expand All @@ -884,7 +884,7 @@ describe('SearchFilterComponent', () => {
it('should search the facets options and select it', () => {
const panel = '[data-automation-id="expansion-panel-Size facet queries"]';
appConfigService.config.search = searchFilter;
queryBuilder.setUpConfiguration();
queryBuilder.resetToDefaults();
fixture.detectChanges();
queryBuilder.executed.next(<any> mockSearchResult);
fixture.detectChanges();
Expand Down Expand Up @@ -930,7 +930,7 @@ describe('SearchFilterComponent', () => {
const panel1 = '[data-automation-id="expansion-panel-Size facet queries"]';
const panel2 = '[data-automation-id="expansion-panel-Type facet queries"]';
appConfigService.config.search = searchFilter;
queryBuilder.setUpConfiguration();
queryBuilder.resetToDefaults();
fixture.detectChanges();
queryBuilder.executed.next(<any> mockSearchResult);
fixture.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('SearchHeaderQueryBuilder', () => {
expect(builder.categories.length).toBe(0);
expect(builder.filterQueries.length).toBe(0);

builder.setUpConfiguration();
builder.resetToDefaults();

expect(builder.categories.length).toBe(2);
expect(builder.filterQueries.length).toBe(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('SearchQueryBuilder', () => {
expect(builder.categories.length).toBe(0);
expect(builder.filterQueries.length).toBe(0);

builder.setUpConfiguration();
builder.resetToDefaults();

expect(builder.categories.length).toBe(2);
expect(builder.filterQueries.length).toBe(2);
Expand Down

0 comments on commit feb5204

Please sign in to comment.