diff --git a/projects/kit/components/combo-box/combo-box.template.html b/projects/kit/components/combo-box/combo-box.template.html index f27be3d535b6..5441682405e2 100644 --- a/projects/kit/components/combo-box/combo-box.template.html +++ b/projects/kit/components/combo-box/combo-box.template.html @@ -13,7 +13,7 @@ [invalid]="computedInvalid" [nativeId]="nativeId" [readOnly]="readOnly" - [iconContent]="icon" + [iconContent]="arrow ? icon : ''" [disabled]="computedDisabled" [focusable]="computedFocusable" [value]="nativeValue" diff --git a/projects/kit/components/combo-box/test/combo-box.component.spec.ts b/projects/kit/components/combo-box/test/combo-box.component.spec.ts index c8d999c652da..f72c6b2a93f4 100644 --- a/projects/kit/components/combo-box/test/combo-box.component.spec.ts +++ b/projects/kit/components/combo-box/test/combo-box.component.spec.ts @@ -1,6 +1,7 @@ import {Component, DebugElement, ViewChild} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {FormControl, ReactiveFormsModule} from '@angular/forms'; +import {By} from '@angular/platform-browser'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import { TUI_DEFAULT_IDENTITY_MATCHER, @@ -15,7 +16,11 @@ import { TuiSizeS, TuiTextfieldControllerModule, } from '@taiga-ui/core'; -import {TuiDataListWrapperModule} from '@taiga-ui/kit/components'; +import { + TUI_ARROW, + TUI_ARROW_MODE, + TuiDataListWrapperModule, +} from '@taiga-ui/kit/components'; import {configureTestSuite, NativeInputPO, PageObject} from '@taiga-ui/testing'; import {TuiComboBoxComponent} from '../combo-box.component'; @@ -106,6 +111,12 @@ describe('ComboBox', () => { TuiDataListWrapperModule, ], declarations: [TestComponent], + providers: [ + { + provide: TUI_ARROW_MODE, + useValue: {interactive: TUI_ARROW, disabled: ''}, + }, + ], }); }); @@ -205,6 +216,18 @@ describe('ComboBox', () => { expect(testComponent.component.open).toEqual(true); }); }); + + describe('readonly state', () => { + beforeEach(() => { + testComponent.readOnly = true; + fixture.detectChanges(); + }); + + it('should be no icon', () => { + fixture.debugElement.query(By.css('.t-icon')); + expect(fixture.debugElement.query(By.css('.t-icon'))).toBeFalsy(); + }); + }); }); function getValue(): DebugElement | null {