@@ -90,6 +90,52 @@ describe('divider', () => {
90
90
expect ( context . comp . nzVariant ) . toEqual ( 'solid' ) ;
91
91
} ) ;
92
92
} ) ;
93
+
94
+ describe ( '#nzPlain' , ( ) => {
95
+ for ( const value of [ true , false ] ) {
96
+ it ( `[${ value } ]` , ( ) => {
97
+ context . comp . nzPlain = value ;
98
+ fixture . detectChanges ( ) ;
99
+ expect ( dl . query ( By . css ( '.ant-divider-plain' ) ) != null ) . toBe ( value ) ;
100
+ } ) ;
101
+ }
102
+ } ) ;
103
+
104
+ describe ( '#nzSize' , ( ) => {
105
+ it ( 'should not have size class by default' , ( ) => {
106
+ fixture . detectChanges ( ) ;
107
+ const el = dl . query ( By . css ( '.ant-divider' ) ) ! . nativeElement as HTMLElement ;
108
+ expect ( el . classList . contains ( 'ant-divider-sm' ) ) . toBe ( false ) ;
109
+ expect ( el . classList . contains ( 'ant-divider-md' ) ) . toBe ( false ) ;
110
+ expect ( el . classList . contains ( 'ant-divider-lg' ) ) . toBe ( false ) ;
111
+ } ) ;
112
+
113
+ ( [ 'small' , 'middle' , 'large' ] as const ) . forEach ( size => {
114
+ it ( `with ${ size } ` , ( ) => {
115
+ context . comp . nzSize = size ;
116
+ fixture . detectChanges ( ) ;
117
+ const el = dl . query ( By . css ( '.ant-divider' ) ) ! . nativeElement as HTMLElement ;
118
+ expect ( el . classList . contains ( 'ant-divider-sm' ) ) . toBe ( size === 'small' ) ;
119
+ expect ( el . classList . contains ( 'ant-divider-md' ) ) . toBe ( size === 'middle' ) ;
120
+ // Large size does not have a specific class; ensure no lg class is added
121
+ expect ( el . classList . contains ( 'ant-divider-lg' ) ) . toBe ( false ) ;
122
+ } ) ;
123
+ } ) ;
124
+ } ) ;
125
+
126
+ describe ( '#with text class' , ( ) => {
127
+ it ( 'should have ant-divider-with-text when nzText set' , ( ) => {
128
+ context . nzText = 'text' ;
129
+ fixture . detectChanges ( ) ;
130
+ expect ( dl . query ( By . css ( '.ant-divider-with-text' ) ) != null ) . toBe ( true ) ;
131
+ } ) ;
132
+
133
+ it ( 'should not have ant-divider-with-text when nzText removed' , ( ) => {
134
+ context . nzText = undefined ;
135
+ fixture . detectChanges ( ) ;
136
+ expect ( dl . query ( By . css ( '.ant-divider-with-text' ) ) == null ) . toBe ( true ) ;
137
+ } ) ;
138
+ } ) ;
93
139
} ) ;
94
140
95
141
@Component ( {
0 commit comments