Skip to content

Commit

Permalink
[ACS-8502] missing alignment for menu and search button
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikiwanekhyland committed Aug 6, 2024
1 parent 522efd5 commit 88d5c4e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/core/src/lib/search-text/search-text-input.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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'));
Expand Down Expand Up @@ -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'));
Expand Down Expand Up @@ -285,7 +291,7 @@ describe('SearchTextInputComponent', () => {
describe('Clear button', () => {
beforeEach(fakeAsync(() => {
fixture.detectChanges();
component.subscriptAnimationState.value = 'active';
setAnimationStateActive();
fixture.detectChanges();
tick(200);
}));
Expand Down

0 comments on commit 88d5c4e

Please sign in to comment.