Skip to content

Commit 597ddfc

Browse files
committed
chore(dateRange): Adding test and fixing import
1 parent 554e0f8 commit 597ddfc

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

projects/igniteui-angular/src/lib/date-range-picker/date-range-picker-inputs.common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { IgxSuffixDirective } from '../directives/suffix/suffix.directive';
1111
import { IgxButtonDirective } from '../directives/button/button.directive';
1212
import { IgxPrefixDirective } from '../directives/prefix/prefix.directive';
1313
import { NgTemplateOutlet } from '@angular/common';
14-
import { IgxPickerToggleComponent } from 'igniteui-angular';
14+
import { IgxPickerToggleComponent } from '../date-common/public_api';
1515

1616
/** Represents a range between two dates. */
1717
export interface DateRange {

projects/igniteui-angular/src/lib/date-range-picker/date-range-picker.component.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,20 @@ describe('IgxDateRangePicker', () => {
14141414
expect(inputGroupsStart.children[0].children[0].classes[CSS_CLASS_ICON]).toBeTruthy();
14151415
});
14161416

1417+
it('should render default toggle icon and templated icon via igx-picker-toggle - two inputs', () => {
1418+
fixture = TestBed.createComponent(DateRangeTwoInputsTestComponent);
1419+
fixture.detectChanges();
1420+
1421+
const inputGroupsStartCollection = fixture.debugElement.queryAll(By.css(CSS_CLASS_INPUT_START));
1422+
1423+
expect(inputGroupsStartCollection[0].children[0].nativeElement.innerText).toBe('calendar_view_day');
1424+
// has igx-picker-toggle so +1 child level
1425+
expect(inputGroupsStartCollection[0].children[0].children[0].classes[CSS_CLASS_ICON]).toBeTruthy();
1426+
1427+
expect(inputGroupsStartCollection[1].children[0].nativeElement.innerText).toBe(DEFAULT_ICON_TEXT);
1428+
expect(inputGroupsStartCollection[1].children[0].classes[CSS_CLASS_ICON]).toBeTruthy();
1429+
});
1430+
14171431
it('should be able to set toggle icon', () => {
14181432
const prefixIconText = 'flight_takeoff';
14191433
const suffixIconText = 'flight_land';

0 commit comments

Comments
 (0)