@@ -99,15 +99,34 @@ describe('Input number', () => {
99
99
expect ( component . value ) . toBe ( 0 ) ;
100
100
} ) ;
101
101
102
- it ( 'should be update value through the handler with hold shift key' , ( ) => {
103
- upStepByHandler ( { shiftKey : true } ) ;
104
- expect ( component . value ) . toBe ( 10 ) ;
105
- upStepByHandler ( { shiftKey : true } ) ;
106
- expect ( component . value ) . toBe ( 20 ) ;
107
- downStepByHandler ( { shiftKey : true } ) ;
108
- expect ( component . value ) . toBe ( 10 ) ;
109
- downStepByHandler ( { shiftKey : true } ) ;
110
- expect ( component . value ) . toBe ( 0 ) ;
102
+ describe ( 'should be update value through the handler with hold shift key' , ( ) => {
103
+ it ( 'normal' , ( ) => {
104
+ upStepByHandler ( { shiftKey : true } ) ;
105
+ expect ( component . value ) . toBe ( 10 ) ;
106
+ upStepByHandler ( { shiftKey : true } ) ;
107
+ expect ( component . value ) . toBe ( 20 ) ;
108
+
109
+ downStepByHandler ( { shiftKey : true } ) ;
110
+ expect ( component . value ) . toBe ( 10 ) ;
111
+ downStepByHandler ( { shiftKey : true } ) ;
112
+ expect ( component . value ) . toBe ( 0 ) ;
113
+ } ) ;
114
+
115
+ it ( 'with min & max' , ( ) => {
116
+ component . min = - 5 ;
117
+ component . max = 5 ;
118
+ fixture . detectChanges ( ) ;
119
+
120
+ for ( let index = 0 ; index < 10 ; index ++ ) {
121
+ upStepByHandler ( { shiftKey : true } ) ;
122
+ }
123
+ expect ( component . value ) . toBe ( component . max ) ;
124
+
125
+ for ( let index = 0 ; index < 10 ; index ++ ) {
126
+ downStepByHandler ( { shiftKey : true } ) ;
127
+ }
128
+ expect ( component . value ) . toBe ( component . min ) ;
129
+ } ) ;
111
130
} ) ;
112
131
113
132
it ( 'should be update value through user typing' , ( ) => {
0 commit comments