Skip to content
Snippets Groups Projects
Commit d47b4d4b authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-5793 Fix searchbar focus' (#618) from OZG-5793-fix-focus into master

parents d7006024 f7423e26
Branches
Tags
No related merge requests found
...@@ -167,7 +167,7 @@ describe('VorgangSearchComponent', () => { ...@@ -167,7 +167,7 @@ describe('VorgangSearchComponent', () => {
}); });
describe('ngOnInit', () => { describe('ngOnInit', () => {
it('should set focus if path is "/alle/search"', () => { it('should set focus if path ends with "/search"', () => {
component.focus = jest.fn(); component.focus = jest.fn();
routerEvents.next(new NavigationEnd(1, '/alle/search', '')); routerEvents.next(new NavigationEnd(1, '/alle/search', ''));
...@@ -176,7 +176,7 @@ describe('VorgangSearchComponent', () => { ...@@ -176,7 +176,7 @@ describe('VorgangSearchComponent', () => {
expect(component.focus).toHaveBeenCalled(); expect(component.focus).toHaveBeenCalled();
}); });
it('should not set focus if path is not "/alle/search"', () => { it('should not set focus if path does not end with "/search"', () => {
component.focus = jest.fn(); component.focus = jest.fn();
routerEvents.next(new NavigationEnd(1, '/alle', '')); routerEvents.next(new NavigationEnd(1, '/alle', ''));
......
...@@ -36,7 +36,7 @@ export function getEmpfaenger(vorgangWithEingangResource: VorgangWithEingangReso ...@@ -36,7 +36,7 @@ export function getEmpfaenger(vorgangWithEingangResource: VorgangWithEingangReso
} }
export function isVorgangSearchRoute(navigationEnd: NavigationEnd): boolean { export function isVorgangSearchRoute(navigationEnd: NavigationEnd): boolean {
return navigationEnd.url === '/alle/search'; return navigationEnd.url.endsWith('/search');
} }
function getVorname(vorgangWithEingangResource: VorgangWithEingangResource): string { function getVorname(vorgangWithEingangResource: VorgangWithEingangResource): string {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment