#1080 Resolve Merge Conflicts

This commit is contained in:
Sebastian
2020-09-25 11:48:14 +02:00
parent 5cf9eced6b
commit d5a3fd47a7
4 changed files with 13 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ import {
TestBed,
fakeAsync,
tick,
flush,
} from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { SearchStateFacade } from '@shelf-store';
@@ -57,6 +58,10 @@ class MockSearchStateFacade {
clearResult() {}
clearError() {}
getPendingselectedFilter$() {
return of({});
}
}
fdescribe('#SearchInputComponent', () => {
@@ -133,22 +138,24 @@ fdescribe('#SearchInputComponent', () => {
expect(navigationService.navigateToResultList).not.toHaveBeenCalled();
});
it('should set up navigation after triggering a search', async () => {
it('should set up navigation after triggering a search', fakeAsync(async () => {
shelfSearchService.search.and.returnValue(Promise.resolve());
await component.triggerSearch({ type: 'search', value: 'Testsuche' });
fixture.detectChanges();
tick(300);
flush();
expect(navigationService.navigateToResultList).toHaveBeenCalled();
});
}));
it('should update the searchbar when the pending input changes', fakeAsync(() => {
spyOnProperty(facade, 'pendingInput$').and.returnValue(of('Testsuche'));
component.ngAfterViewInit();
component.ngOnInit();
tick();
fixture.detectChanges();
tick(300);
expect(component.searchbar.setInputValue).toHaveBeenCalledWith('Testsuche');
}));

View File

@@ -32,7 +32,6 @@ import {
withLatestFrom,
startWith,
take,
delay,
} from 'rxjs/operators';
import { SHELF_SCROLL_INDEX } from 'apps/sales/src/app/core/utils/app.constants';
import { ShelfSearchbarComponent } from '../../../components';
@@ -298,7 +297,7 @@ export class ShelfSearchInputComponent
private setUpIsLoadingListener() {
this.searchStateFacade.fetching$
.pipe(takeUntil(this.destroy$), delay(250))
.pipe(takeUntil(this.destroy$), debounceTime(250))
.subscribe((isFetching) => {
this.showAutocompleteResults$.next(!isFetching);
});

View File

@@ -5,12 +5,8 @@ import { Store as NgxsStore, NgxsModule } from '@ngxs/store';
import {
primaryFiltersMock,
mockFilters,
} from 'apps/sales/src/app/modules/shelf/shared/mockdata';
import {
primaryFiltersMock,
mockFilters,
primaryFiltersMockWithSelected,
selectFiltersMockWithSelected$,
primaryFiltersMockWithSelected,
} from 'apps/sales/src/app/modules/shelf/shared/mockdata';
import { PrimaryFilterOption } from 'apps/sales/src/app/modules/shelf/defs';
import { of, Observable, Subject } from 'rxjs';
@@ -256,9 +252,6 @@ fdescribe('SearchFacade', () => {
describe('setPendingInput', () => {
beforeEach(() => {
spyOn(facade, 'getProcessId').and.returnValue(
new Promise((resolve) => resolve(id))
);
spyOn(facade, 'setPendingInput').and.callThrough();
spyOn(store, 'dispatch').and.callThrough();
});

View File

@@ -5,12 +5,7 @@ import * as actions from './search.actions';
import * as selectors from './search.selectors';
import { switchMap, filter, map, first, tap } from 'rxjs/operators';
import { SharedSelectors } from 'apps/sales/src/app/core/store/selectors/shared.selectors';
import { asyncScheduler, combineLatest, Subject } from 'rxjs';
import {
selectFiltersToFiltersDictionary,
primaryFiltersToFiltersDictionary,
} from './mappers';
import { combineLatest } from 'rxjs';
import { combineLatest, Subject } from 'rxjs';
import {
selectFiltersToFiltersDictionary,
primaryFiltersToFiltersDictionary,