[ACS-4985] Added test cases for SearchDateRangeAdvancedTabbedComponent. Moved pending logic from template to typescript

This commit is contained in:
swapnil.verma
2023-07-27 11:14:48 +05:30
committed by Jatin_Chugh
parent 131b2bcb52
commit 0b8a4d9f0f
4 changed files with 9 additions and 10 deletions
@@ -16,7 +16,7 @@
<button mat-button color="primary" data-automation-id="date-range-advanced-btn-clear" (click)="reset()">
{{ 'SEARCH.FILTER.ACTIONS.CLEAR' | translate }}
</button>
<button mat-button color="primary" data-automation-id="date-range-advanced-btn-apply" [disabled]="hasValidValue()" (click)="submitValues()">
<button mat-button color="primary" data-automation-id="date-range-advanced-btn-apply" [disabled]="!hasValidValue()" (click)="submitValues()">
{{ 'SEARCH.FILTER.ACTIONS.APPLY' | translate }}
</button>
</div>
@@ -82,7 +82,6 @@ describe('SearchDateRangeAdvancedTabbedComponent', () => {
]
});
fixture = TestBed.createComponent(SearchDateRangeAdvancedTabbedComponent);
component = fixture.componentInstance;
component.id = 'dateRangeAdvanced';
component.context = {
@@ -184,4 +184,12 @@ export class SearchDateRangeAdvancedTabbedComponent implements SearchWidget, OnI
onDateRangedValueChanged(value: Partial<SearchDateRangeAdvanced>, field: string) {
this.value[field] = value;
}
onFieldsChanged(fields: string[]) {
this.fields = fields;
}
onDisplayLabelsByFieldsTranslated(displayedLabelsByField: { [p: string]: string }) {
this.displayedLabelsByField = displayedLabelsByField;
}
}
@@ -1,8 +0,0 @@
import { SearchFilterTabDirective } from './search-filter-tab.directive';
describe('SearchFilterTabDirective', () => {
it('should create an instance', () => {
const directive = new SearchFilterTabDirective();
expect(directive).toBeTruthy();
});
});