[ACS-4985] Resolved PR review comments

This commit is contained in:
swapnil.verma
2023-07-27 11:14:48 +05:30
committed by Jatin_Chugh
parent 05f2524967
commit b16fd58243
6 changed files with 32 additions and 12 deletions
@@ -62,7 +62,7 @@ export class MockSearchDateRangeAdvancedComponent {
@Output()
valid = new EventEmitter<boolean>();
}
describe('SearchDateRangeAdvancedTabbedComponent', () => {
fdescribe('SearchDateRangeAdvancedTabbedComponent', () => {
let component: SearchDateRangeAdvancedTabbedComponent;
let fixture: ComponentFixture<SearchDateRangeAdvancedTabbedComponent>;
let betweenMockData: SearchDateRangeAdvanced;
@@ -63,13 +63,12 @@ describe('SearchDateRangeAdvancedComponent', () => {
fixture.detectChanges();
};
const selectDropdownOption = async (itemId: string) => {
const selectDropdownOption = (itemId: string) => {
const matSelect = fixture.debugElement.query(By.css('[data-automation-id="date-range-advanced-in-last-dropdown"]')).nativeElement;
matSelect.click();
fixture.detectChanges();
const matOption = fixture.debugElement.query(By.css(`[data-automation-id="${itemId}"]`)).nativeElement;
matOption.click();
await fixture.whenStable();
fixture.detectChanges();
};
@@ -177,4 +177,27 @@ export class SearchDateRangeAdvancedComponent implements OnInit, OnDestroy {
return true;
}
}
// dateChanged(event: Event, formControl: FormControl<Date | null>) {
// clearTimeout(this.dateChangeDebounce);
// this.dateChangeDebounce = window.setTimeout(() => {
// if (!event?.target['value']) {
// formControl.errors.required = true;
// formControl.errors.dateFormatInvalid = false;
// } else {
// const date = parse(event.target['value'], this.datePickerFormat, new Date());
// if(!isValid(date)) {
// formControl.errors.dateFormatInvalid = true;
// } else {
// formControl.errors.dateFormatInvalid = false;
// formControl.setValue(date);
// }
// }
// }, 500);
// }
onLastDateValueChanged(event: Event) {
let value: string = event.target['value'];
event.target['value'] = value.replace(/[-.]*0*([1-9]*[0-9]*)/g, '$1');
}
}
@@ -18,8 +18,7 @@ adf-search-filter-tabbed {
display: none;
}
.mat-tab-body.mat-tab-body-active .mat-tab-body-content {
display: block;
visibility: visible !important;
.mat-ink-bar {
display: none;
}
}
@@ -20,12 +20,12 @@ import { TranslateModule } from '@ngx-translate/core';
import { ContentTestingModule } from '../../../testing/content.testing.module';
import { SearchFilterTabbedComponent } from './search-filter-tabbed.component';
describe('SearchFilterTabbedComponent', () => {
fdescribe('SearchFilterTabbedComponent', () => {
let component: SearchFilterTabbedComponent;
let fixture: ComponentFixture<SearchFilterTabbedComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [SearchFilterTabbedComponent],
imports: [
TranslateModule.forRoot(),
@@ -49,7 +49,7 @@ describe('SearchFilterTabbedComponent', () => {
});
it ('should emit a single combined value to display when multiple display values are provided', () => {
spyOn(component.valuesToDisplayCombined, 'emit');
spyOn(component.valuesToDisplayCombined, 'emit');
component.settings = {
field: 'testField1, testField2, testField3',
displayedLabelsByField: {
@@ -87,7 +87,7 @@ describe('SearchFilterTabbedComponent', () => {
});
it('should emit an array of fields when all the fields are provided in a combined string via settings', () => {
spyOn(component.fieldsChanged, 'emit');
spyOn(component.fieldsChanged, 'emit');
component.settings = {
field: 'testField1, testField2, testField3'
};
@@ -57,7 +57,6 @@ export class SearchWidgetContainerComponent implements OnInit, OnDestroy, OnChan
@Input()
value: any;
componentRef: ComponentRef<any>;
constructor(