@@ -36,7 +36,7 @@ import {
3636 dispatchKeyboardEvent ,
3737 dispatchMouseEvent
3838} from 'ng-zorro-antd/core/testing' ;
39- import { NzSafeAny , NzStatus } from 'ng-zorro-antd/core/types' ;
39+ import { NzSafeAny , NzStatus , NzVariant } from 'ng-zorro-antd/core/types' ;
4040import { NzFormModule } from 'ng-zorro-antd/form' ;
4141import { provideNzIconsTesting } from 'ng-zorro-antd/icon/testing' ;
4242import { NzSelectItemComponent } from 'ng-zorro-antd/select' ;
@@ -227,6 +227,30 @@ describe('cascader', () => {
227227 expect ( cascader . nativeElement . querySelector ( '.ant-select-clear' ) ) . toBeNull ( ) ;
228228 } ) ;
229229
230+ describe ( 'should variant works' , ( ) => {
231+ it ( 'filled' , ( ) => {
232+ fixture . detectChanges ( ) ;
233+ expect ( cascader . nativeElement . classList ) . not . toContain ( 'ant-select-filled' ) ;
234+ testComponent . nzVariant = 'filled' ;
235+ fixture . detectChanges ( ) ;
236+ expect ( cascader . nativeElement . classList ) . toContain ( 'ant-select-filled' ) ;
237+ } ) ;
238+ it ( 'borderless' , ( ) => {
239+ fixture . detectChanges ( ) ;
240+ expect ( cascader . nativeElement . classList ) . not . toContain ( 'ant-select-borderless' ) ;
241+ testComponent . nzVariant = 'borderless' ;
242+ fixture . detectChanges ( ) ;
243+ expect ( cascader . nativeElement . classList ) . toContain ( 'ant-select-borderless' ) ;
244+ } ) ;
245+ it ( 'underlined' , ( ) => {
246+ fixture . detectChanges ( ) ;
247+ expect ( cascader . nativeElement . classList ) . not . toContain ( 'ant-select-underlined' ) ;
248+ testComponent . nzVariant = 'underlined' ;
249+ fixture . detectChanges ( ) ;
250+ expect ( cascader . nativeElement . classList ) . toContain ( 'ant-select-underlined' ) ;
251+ } ) ;
252+ } ) ;
253+
230254 it ( 'should open work' , ( ) => {
231255 fixture . detectChanges ( ) ;
232256 expect ( cascader . nativeElement . classList ) . not . toContain ( 'ant-select-open' ) ;
@@ -2408,6 +2432,7 @@ const options5: NzSafeAny[] = [];
24082432 [nzValueProperty]="nzValueProperty"
24092433 [nzBackdrop]="nzBackdrop"
24102434 [nzPlacement]="nzPlacement"
2435+ [nzVariant]="nzVariant"
24112436 (ngModelChange)="onValueChanges($event)"
24122437 (nzVisibleChange)="onVisibleChange($event)"
24132438 (nzClear)="onClear()"
@@ -2451,6 +2476,7 @@ export class NzDemoCascaderDefaultComponent {
24512476 nzExpandIcon = 'right' ;
24522477 nzBackdrop = false ;
24532478 nzPlacement : NzCascaderPlacement = 'bottomLeft' ;
2479+ nzVariant : NzVariant = 'outlined' ;
24542480
24552481 onVisibleChange = jasmine . createSpy < ( visible : boolean ) => void > ( 'open change' ) ;
24562482 onValueChanges = jasmine . createSpy ( 'value change' ) ;
0 commit comments