[ACS-4985] Added test cases for SearchFilterTabbedComponent. Added test case placeholders for SearchDateRangeAdvancedComponent

This commit is contained in:
swapnil.verma
2023-07-27 11:14:48 +05:30
committed by Jatin_Chugh
parent 9a37bd239d
commit 164a5a5e4a
2 changed files with 49 additions and 17 deletions
@@ -3,21 +3,53 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SearchDateRangeAdvancedComponent } from './search-date-range-advanced.component'; import { SearchDateRangeAdvancedComponent } from './search-date-range-advanced.component';
describe('SearchDateRangeAdvancedComponent', () => { describe('SearchDateRangeAdvancedComponent', () => {
let component: SearchDateRangeAdvancedComponent; let component: SearchDateRangeAdvancedComponent;
let fixture: ComponentFixture<SearchDateRangeAdvancedComponent>; let fixture: ComponentFixture<SearchDateRangeAdvancedComponent>;
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ SearchDateRangeAdvancedComponent ] declarations: [SearchDateRangeAdvancedComponent]
}) })
.compileComponents(); .compileComponents();
fixture = TestBed.createComponent(SearchDateRangeAdvancedComponent); fixture = TestBed.createComponent(SearchDateRangeAdvancedComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it('should not set any date filter in context when Anytime option is selected', () => {
expect(component).toBeTruthy();
}); });
it('should set proper date filter in context when In the last option is selected', () => {
});
it('should not set any date filter in context when In the last option is selected, but no value is provided', () => {
});
it('should set proper date filter in context when Between option is selected', () => {
});
it('should not set any date filter in context when Between option is selected, but no value is provided in the dates', () => {
});
it('should clear context when widget is reset', () => {
});
it('should update display label with proper text when In the last/Between option is selected and values are properly set', () => {
});
it('should set values if initial value is provided', () => {
});
it('should not allow selecting a date after the current date when Between option is selected', () => {
});
}); });
@@ -5,7 +5,7 @@ import { By } from '@angular/platform-browser';
import { ContentTestingModule } from '../../../testing/content.testing.module'; import { ContentTestingModule } from '../../../testing/content.testing.module';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
xdescribe('SearchFilterTabbedComponent', () => { describe('SearchFilterTabbedComponent', () => {
let component: SearchFilterTabbedComponent; let component: SearchFilterTabbedComponent;
let fixture: ComponentFixture<SearchFilterTabbedComponent>; let fixture: ComponentFixture<SearchFilterTabbedComponent>;
@@ -57,8 +57,8 @@ xdescribe('SearchFilterTabbedComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
function getButtonByDataAutomationId(buttonDataAutomtaionId: string) { function getButtonByDataAutomationId(buttonDataAutomationId: string) {
return fixture.debugElement.query(By.css(`[data-automation-id="${buttonDataAutomtaionId}"]`)).nativeElement; return fixture.debugElement.query(By.css(`[data-automation-id="${buttonDataAutomationId}"]`)).nativeElement;
} }
it('should update displayLabel when inner widgets display label is updated', async () => { it('should update displayLabel when inner widgets display label is updated', async () => {