@@ -53,15 +53,6 @@ describe('validation', () => {
5353 expect ( field . checkValidity ( ) ) . to . equal ( input . checkValidity ( ) ) ;
5454 } ) ;
5555
56- it ( 'should not validate when explicitly set to invalid' , ( ) => {
57- field . invalid = true ;
58-
59- expect ( field . value ) . to . be . empty ;
60- expect ( field . validate ( ) ) . to . be . false ;
61-
62- expect ( field . invalid ) . to . be . true ;
63- } ) ;
64-
6556 it ( 'should allow setting decimals' , ( ) => {
6657 field . value = 7.6 ;
6758 expect ( field . value ) . to . be . equal ( '7.6' ) ;
@@ -151,18 +142,29 @@ describe('validation', () => {
151142 expect ( field . invalid ) . to . be . false ;
152143 } ) ;
153144
154- it ( 'should be invalid when trying to commit a not valid number' , async ( ) => {
145+ it ( 'should be invalid when trying to commit an invalid number' , async ( ) => {
155146 await sendKeys ( { type : '1--' } ) ;
156147 input . blur ( ) ;
157148 expect ( field . invalid ) . to . be . true ;
158149 } ) ;
159150
160- it ( 'should set an empty value when trying to commit a not valid number' , async ( ) => {
151+ it ( 'should set an empty value when trying to commit an invalid number' , async ( ) => {
161152 field . value = '1' ;
162153 await sendKeys ( { type : '1--' } ) ;
163154 await sendKeys ( { type : 'Enter' } ) ;
164155 expect ( field . value ) . to . equal ( '' ) ;
165156 } ) ;
157+
158+ it ( 'should be valid after removing an invalid number' , async ( ) => {
159+ await sendKeys ( { type : '1--' } ) ;
160+ input . blur ( ) ;
161+ input . focus ( ) ;
162+ await sendKeys ( { press : 'Backspace' } ) ;
163+ await sendKeys ( { press : 'Backspace' } ) ;
164+ await sendKeys ( { press : 'Backspace' } ) ;
165+ input . blur ( ) ;
166+ expect ( field . invalid ) . to . be . false ;
167+ } ) ;
166168 } ) ;
167169
168170 describe ( 'initial' , ( ) => {
0 commit comments