2022-03-14 22:57:01 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								import  { describe }  from  'mocha'  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { expect }  from  'chai'  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  Translations  from  "../../UI/i18n/Translations" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  ValidatedTextField  from  "../../UI/Input/ValidatedTextField" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								describe ( "ValidatedTextFields" ,  ( )  = >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 01:42:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        it ( "should all have description in the translations" ,  ( )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-14 22:57:01 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            const  ts  =  Translations . t . validation ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  missingTranslations  =  Array . from ( ValidatedTextField . allTypes . keys ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                . filter ( key  = >  ts [ key ]  ===  undefined  ||  ts [ key ] . description  ===  undefined ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            expect ( missingTranslations ,  "These validated text fields don't have a type name defined in en.json. (Did you just add one? Run `npm run generate:translations`)" ) . to . be . empty 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} )