mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: Add a test for validation of empty params
This commit is contained in:
		
							parent
							
								
									1486cdab52
								
							
						
					
					
						commit
						786260434d
					
				@ -362,3 +362,22 @@ test('should reject updating addon config with missing required parameter', asyn
 | 
				
			|||||||
        { instanceOf: ValidationError },
 | 
					        { instanceOf: ValidationError },
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test('Should reject addon config if a required parameter is just the empty string', async t => {
 | 
				
			||||||
 | 
					    const { addonService } = getSetup();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const config = {
 | 
				
			||||||
 | 
					        provider: 'simple',
 | 
				
			||||||
 | 
					        enabled: true,
 | 
				
			||||||
 | 
					        parameters: {
 | 
				
			||||||
 | 
					            url: '',
 | 
				
			||||||
 | 
					            var: 'some-value',
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        events: [FEATURE_CREATED],
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    await t.throwsAsync(
 | 
				
			||||||
 | 
					        async () => addonService.createAddon(config, 'me@mail.com'),
 | 
				
			||||||
 | 
					        { instanceOf: ValidationError },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user