Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACA-3426] - reverted method renaming #5803

Merged
merged 1 commit into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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