@@ -275,6 +275,21 @@ describe('select', () => {
275275 expect ( selectElement . classList ) . toContain ( 'ant-select-disabled' ) ;
276276 expect ( selectElement . querySelector ( 'input' ) ! . getAttribute ( 'disabled' ) ) . toBe ( '' ) ;
277277 } ) ) ;
278+ it ( 'should nzTitle works' , fakeAsync ( ( ) => {
279+ component . listOfOption = [
280+ { nzValue : '1' , nzLabel : '1' } ,
281+ { nzValue : '2' , nzLabel : '2' , nzTitle : '-' } ,
282+ { nzValue : '3' , nzLabel : '3' , nzTitle : null }
283+ ] ;
284+ component . nzOpen = true ;
285+ fixture . detectChanges ( ) ;
286+ flush ( ) ;
287+ fixture . detectChanges ( ) ;
288+ console . log ( document . querySelectorAll ( 'nz-option-item' ) ) ;
289+ expect ( ( document . querySelectorAll ( 'nz-option-item' ) [ 0 ] as HTMLElement ) ?. title ) . toBe ( '1' ) ;
290+ expect ( ( document . querySelectorAll ( 'nz-option-item' ) [ 1 ] as HTMLElement ) ?. title ) . toBe ( '-' ) ;
291+ expect ( ( document . querySelectorAll ( 'nz-option-item' ) [ 2 ] as HTMLElement ) ?. title ) . toBeFalsy ( ) ;
292+ } ) ) ;
278293
279294 it ( 'should select option by enter' , fakeAsync ( ( ) => {
280295 const flushChanges = ( ) : void => {
@@ -1554,6 +1569,7 @@ describe('select', () => {
15541569 *ngFor="let o of listOfOption"
15551570 [nzValue]="o.nzValue"
15561571 [nzLabel]="o.nzLabel"
1572+ [nzTitle]="o.nzTitle"
15571573 [nzDisabled]="o.nzDisabled"
15581574 [nzHide]="o.nzHide"
15591575 ></nz-option>
@@ -1562,6 +1578,7 @@ describe('select', () => {
15621578 *ngFor="let o of group.children"
15631579 [nzValue]="o.nzValue"
15641580 [nzLabel]="o.nzLabel"
1581+ [nzTitle]="o.nzTitle"
15651582 [nzDisabled]="o.nzDisabled"
15661583 [nzHide]="o.nzHide"
15671584 ></nz-option>
0 commit comments