forked from hazza/dspace-angular
site search should not adopt existing URL query string parameters (#2818)
src/app/search-navbar: do not merge existing query params Do not merge existing query params when using site search from MyDSpace workflow.
This commit is contained in:
@@ -88,7 +88,7 @@ describe('SearchNavbarComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
}));
|
}));
|
||||||
it('to search page with empty query', () => {
|
it('to search page with empty query', () => {
|
||||||
const extras: NavigationExtras = { queryParams: { query: '' }, queryParamsHandling: 'merge' };
|
const extras: NavigationExtras = { queryParams: { query: '' } };
|
||||||
expect(component.onSubmit).toHaveBeenCalledWith({ query: '' });
|
expect(component.onSubmit).toHaveBeenCalledWith({ query: '' });
|
||||||
expect(router.navigate).toHaveBeenCalledWith(['search'], extras);
|
expect(router.navigate).toHaveBeenCalledWith(['search'], extras);
|
||||||
});
|
});
|
||||||
@@ -113,7 +113,7 @@ describe('SearchNavbarComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
}));
|
}));
|
||||||
it('to search page with query', async () => {
|
it('to search page with query', async () => {
|
||||||
const extras: NavigationExtras = { queryParams: { query: 'test' }, queryParamsHandling: 'merge' };
|
const extras: NavigationExtras = { queryParams: { query: 'test' } };
|
||||||
expect(component.onSubmit).toHaveBeenCalledWith({ query: 'test' });
|
expect(component.onSubmit).toHaveBeenCalledWith({ query: 'test' });
|
||||||
|
|
||||||
expect(router.navigate).toHaveBeenCalledWith(['search'], extras);
|
expect(router.navigate).toHaveBeenCalledWith(['search'], extras);
|
||||||
|
@@ -66,8 +66,7 @@ export class SearchNavbarComponent {
|
|||||||
this.searchForm.reset();
|
this.searchForm.reset();
|
||||||
|
|
||||||
this.router.navigate(linkToNavigateTo, {
|
this.router.navigate(linkToNavigateTo, {
|
||||||
queryParams: queryParams,
|
queryParams: queryParams
|
||||||
queryParamsHandling: 'merge'
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user