From 88d5c4e63360f5b39b36072fd66e19c59c09d00a Mon Sep 17 00:00:00 2001 From: DominikIwanek Date: Tue, 6 Aug 2024 19:44:31 +0200 Subject: [PATCH] [ACS-8502] missing alignment for menu and search button --- .../search-text-input.component.spec.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/core/src/lib/search-text/search-text-input.component.spec.ts b/lib/core/src/lib/search-text/search-text-input.component.spec.ts index 12f91fb789f..5a2c91a1a6c 100644 --- a/lib/core/src/lib/search-text/search-text-input.component.spec.ts +++ b/lib/core/src/lib/search-text/search-text-input.component.spec.ts @@ -45,6 +45,12 @@ describe('SearchTextInputComponent', () => { afterEach(() => { fixture.destroy(); }); + /** + * Sets subscriptAnimationState as active + */ + function setAnimationStateActive(): void { + component.subscriptAnimationState.value = 'active'; + } describe('component rendering', () => { it('should display a search input field when specified', async () => { @@ -88,7 +94,7 @@ describe('SearchTextInputComponent', () => { }); it('should NOT display a autocomplete list control when configured not to', fakeAsync(() => { - component.subscriptAnimationState.value = 'active'; + setAnimationStateActive(); fixture.detectChanges(); tick(100); @@ -119,7 +125,7 @@ describe('SearchTextInputComponent', () => { })); it('Search button should not change the input state too often', fakeAsync(() => { - component.subscriptAnimationState.value = 'active'; + setAnimationStateActive(); fixture.detectChanges(); tick(100); @@ -144,7 +150,7 @@ describe('SearchTextInputComponent', () => { it('Search bar should close when user press ESC button', fakeAsync(() => { const inputDebugElement = debugElement.query(By.css('#adf-control-input')); - component.subscriptAnimationState.value = 'active'; + setAnimationStateActive(); fixture.detectChanges(); tick(100); @@ -185,7 +191,7 @@ describe('SearchTextInputComponent', () => { it('should have positive transform translateX set when inactive and direction is ltr', fakeAsync(() => { userPreferencesService.setWithoutStore('textOrientation', 'ltr'); - component.subscriptAnimationState.value = 'active'; + setAnimationStateActive(); fixture.detectChanges(); const searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); @@ -216,7 +222,7 @@ describe('SearchTextInputComponent', () => { it('should have negative transform translateX set when inactive and direction is rtl', fakeAsync(() => { userPreferencesService.setWithoutStore('textOrientation', 'rtl'); - component.subscriptAnimationState.value = 'active'; + setAnimationStateActive(); fixture.detectChanges(); const searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); @@ -285,7 +291,7 @@ describe('SearchTextInputComponent', () => { describe('Clear button', () => { beforeEach(fakeAsync(() => { fixture.detectChanges(); - component.subscriptAnimationState.value = 'active'; + setAnimationStateActive(); fixture.detectChanges(); tick(200); }));