@@ -520,63 +520,75 @@ describe('input-number with affixes or addons', () => {
520520 } ) ;
521521
522522 it ( 'should be apply affix classes' , ( ) => {
523- expect ( component . withAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper' ) ;
523+ expect ( component . withPropAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper' ) ;
524+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper' ) ;
524525 } ) ;
525526
526527 it ( 'should be apply addon classes' , ( ) => {
527- expect ( component . withAddons ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-group-wrapper' ) ;
528+ expect ( component . withPropAddons ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-group-wrapper' ) ;
529+ expect ( component . withContentAddons ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-group-wrapper' ) ;
528530 } ) ;
529531
530532 it ( 'should be apply mix classes' , ( ) => {
531- expect ( component . withMix ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-group-wrapper' ) ;
532- expect ( component . withMix ( ) . nativeElement . querySelector ( '.ant-input-number-affix-wrapper' ) ) . toBeTruthy ( ) ;
533+ expect ( component . withPropMix ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-group-wrapper' ) ;
534+ expect ( component . withContentMix ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-group-wrapper' ) ;
535+ expect ( component . withPropMix ( ) . nativeElement . querySelector ( '.ant-input-number-affix-wrapper' ) ) . toBeTruthy ( ) ;
536+ expect ( component . withContentMix ( ) . nativeElement . querySelector ( '.ant-input-number-affix-wrapper' ) ) . toBeTruthy ( ) ;
533537 } ) ;
534538
535539 it ( 'should be apply disabled class' , ( ) => {
536540 component . disabled = true ;
537541 fixture . detectChanges ( ) ;
538- expect ( component . withAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper-disabled' ) ;
542+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper-disabled' ) ;
539543 } ) ;
540544
541545 it ( 'should be apply readonly class' , ( ) => {
542546 component . readonly = true ;
543547 fixture . detectChanges ( ) ;
544- expect ( component . withAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper-readonly' ) ;
548+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper-readonly' ) ;
545549 } ) ;
546550
547551 it ( 'should be apply borderless class' , ( ) => {
548552 component . bordered = false ;
549553 fixture . detectChanges ( ) ;
550- expect ( component . withAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper-borderless' ) ;
554+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . toContain (
555+ 'ant-input-number-affix-wrapper-borderless'
556+ ) ;
551557 } ) ;
552558
553559 describe ( 'should be apply nzVariant class' , ( ) => {
554560 it ( 'filled' , ( ) => {
555561 fixture . detectChanges ( ) ;
556- expect ( component . withAffixes ( ) . nativeElement . classList ) . not . toContain ( 'ant-input-number-affix-wrapper-filled' ) ;
562+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . not . toContain (
563+ 'ant-input-number-affix-wrapper-filled'
564+ ) ;
557565 component . variant = 'filled' ;
558566 fixture . detectChanges ( ) ;
559- expect ( component . withAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper-filled' ) ;
567+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper-filled' ) ;
560568 } ) ;
561569
562570 it ( 'borderless' , ( ) => {
563571 fixture . detectChanges ( ) ;
564- expect ( component . withAffixes ( ) . nativeElement . classList ) . not . toContain (
572+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . not . toContain (
565573 'ant-input-number-affix-wrapper-borderless'
566574 ) ;
567575 component . variant = 'borderless' ;
568576 fixture . detectChanges ( ) ;
569- expect ( component . withAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper-borderless' ) ;
577+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . toContain (
578+ 'ant-input-number-affix-wrapper-borderless'
579+ ) ;
570580 } ) ;
571581
572582 it ( 'underlined' , ( ) => {
573583 fixture . detectChanges ( ) ;
574- expect ( component . withAffixes ( ) . nativeElement . classList ) . not . toContain (
584+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . not . toContain (
575585 'ant-input-number-affix-wrapper-borderless'
576586 ) ;
577587 component . variant = 'underlined' ;
578588 fixture . detectChanges ( ) ;
579- expect ( component . withAffixes ( ) . nativeElement . classList ) . toContain ( 'ant-input-number-affix-wrapper-underlined' ) ;
589+ expect ( component . withContentAffixes ( ) . nativeElement . classList ) . toContain (
590+ 'ant-input-number-affix-wrapper-underlined'
591+ ) ;
580592 } ) ;
581593 } ) ;
582594} ) ;
@@ -637,7 +649,17 @@ class InputNumberTestComponent {
637649 imports : [ NzInputNumberModule ] ,
638650 template : `
639651 <nz-input-number
640- #withAffixes
652+ #withPropAffixes
653+ nzPrefix="Prefix"
654+ nzSuffix="Suffix"
655+ [nzDisabled]="disabled"
656+ [nzReadOnly]="readonly"
657+ [nzBordered]="bordered"
658+ [nzVariant]="variant"
659+ />
660+
661+ <nz-input-number
662+ #withContentAffixes
641663 [nzDisabled]="disabled"
642664 [nzReadOnly]="readonly"
643665 [nzBordered]="bordered"
@@ -648,7 +670,17 @@ class InputNumberTestComponent {
648670 </nz-input-number>
649671
650672 <nz-input-number
651- #withAddons
673+ #withPropAddons
674+ nzAddonBefore="Before"
675+ nzAddonAfter="After"
676+ [nzDisabled]="disabled"
677+ [nzReadOnly]="readonly"
678+ [nzBordered]="bordered"
679+ [nzVariant]="variant"
680+ />
681+
682+ <nz-input-number
683+ #withContentAddons
652684 [nzDisabled]="disabled"
653685 [nzReadOnly]="readonly"
654686 [nzBordered]="bordered"
@@ -659,7 +691,19 @@ class InputNumberTestComponent {
659691 </nz-input-number>
660692
661693 <nz-input-number
662- #withMix
694+ #withPropMix
695+ nzPrefix="Prefix"
696+ nzSuffix="Suffix"
697+ nzAddonBefore="Before"
698+ nzAddonAfter="After"
699+ [nzDisabled]="disabled"
700+ [nzReadOnly]="readonly"
701+ [nzBordered]="bordered"
702+ [nzVariant]="variant"
703+ />
704+
705+ <nz-input-number
706+ #withContentMix
663707 [nzDisabled]="disabled"
664708 [nzReadOnly]="readonly"
665709 [nzBordered]="bordered"
@@ -678,7 +722,10 @@ class InputNumberWithAffixesAndAddonsTestComponent {
678722 bordered = true ;
679723 variant : NzVariant = 'outlined' ;
680724
681- withAffixes = viewChild . required ( 'withAffixes' , { read : ElementRef } ) ;
682- withAddons = viewChild . required ( 'withAddons' , { read : ElementRef } ) ;
683- withMix = viewChild . required ( 'withMix' , { read : ElementRef } ) ;
725+ readonly withPropAffixes = viewChild . required ( 'withPropAffixes' , { read : ElementRef } ) ;
726+ readonly withContentAffixes = viewChild . required ( 'withContentAffixes' , { read : ElementRef } ) ;
727+ readonly withPropAddons = viewChild . required ( 'withPropAddons' , { read : ElementRef } ) ;
728+ readonly withContentAddons = viewChild . required ( 'withContentAddons' , { read : ElementRef } ) ;
729+ readonly withPropMix = viewChild . required ( 'withPropMix' , { read : ElementRef } ) ;
730+ readonly withContentMix = viewChild . required ( 'withContentMix' , { read : ElementRef } ) ;
684731}
0 commit comments