File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -71,4 +71,25 @@ describe('TreeSelect.warning', () => {
71
71
'Warning: Second param of `onDropdownVisibleChange` has been removed.' ,
72
72
) ;
73
73
} ) ;
74
+
75
+ it ( 'warns on using maxCount with showCheckedStrategy=SHOW_ALL when treeCheckStrictly=false' , ( ) => {
76
+ mount ( < TreeSelect maxCount = { 2 } showCheckedStrategy = "SHOW_ALL" /> ) ;
77
+ expect ( spy ) . toHaveBeenCalledWith (
78
+ 'Warning: `maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.' ,
79
+ ) ;
80
+ } ) ;
81
+
82
+ it ( 'warns on using maxCount with showCheckedStrategy=SHOW_PARENT' , ( ) => {
83
+ mount ( < TreeSelect maxCount = { 2 } showCheckedStrategy = "SHOW_PARENT" /> ) ;
84
+ expect ( spy ) . toHaveBeenCalledWith (
85
+ 'Warning: `maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.' ,
86
+ ) ;
87
+ } ) ;
88
+
89
+ it ( 'does not warn on using maxCount with showCheckedStrategy=SHOW_ALL when treeCheckStrictly=true' , ( ) => {
90
+ mount ( < TreeSelect maxCount = { 2 } showCheckedStrategy = "SHOW_ALL" treeCheckStrictly /> ) ;
91
+ expect ( spy ) . not . toHaveBeenCalledWith (
92
+ 'Warning: `maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.' ,
93
+ ) ;
94
+ } ) ;
74
95
} ) ;
You can’t perform that action at this time.
0 commit comments